Gentoo Archives: gentoo-user

From: "Poison BL." <poisonbl@×××××.com>
To: gentoo-user <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] Debian just voted in systemd for default init system in jessie
Date: Mon, 24 Feb 2014 02:50:00
Message-Id: CAOTuDKoUFdBhk__bu0GoA7YJqNcrCLuS7TJWHQH+Z5fqd+aL1Q@mail.gmail.com
In Reply to: Re: [gentoo-user] Debian just voted in systemd for default init system in jessie by "Canek Peláez Valdés"
1 On Sun, Feb 23, 2014 at 9:20 PM, Canek Peláez Valdés <caneko@×××××.com> wrote:
2 >
3 > On Sun, Feb 23, 2014 at 8:10 PM, Walter Dnes <waltdnes@××××××××.org> wrote:
4 > > On Mon, Feb 24, 2014 at 03:07:09AM +0200, Alan McKinnon wrote
5 > >
6 > >> We don't do error handling. We don't even try and deal with it at the
7 > >> point it occurred, we just chuck it back up the stack, essentially
8 > >> giving them message "stuff it, I'm not dealing with this. You called me,
9 > >> you fix it."
10 > >
11 > > The developer is not going to be psychic to the point of knowing what
12 > > the user *WANTED* to do, years after the code was written... or which
13 > > different users were expecting which different outcomes. E.g. if
14 > > portage encounters a problem during a build, do you *REALLY* want it to
15 > > jump in and randomly patch source code and/or makefiles to get it
16 > > working? NO!!! You want it to halt, with an informative error message,
17 > > possibly including suggestions for corrective action.
18 >
19 > But in Unix you usually don't halt, you set errno and go on your merry way.
20 >
21
22 Actually, from everything I've seen (and it's at least true throughout
23 what I've worked with in glibc) you *do* stop dead in your tracks, set
24 errno, and return some (hopefully indicative of a possible error)
25 value. In the case of standalone executables rather than library
26 calls, you stop where you are, if you're feeling generous you output
27 something to stderr on the way out the door, then exit(errno). The
28 process that called *you* then goes on its merry way, handling your
29 response of "Hey, something went wrong. Good luck." however it
30 chooses, if it chooses to.
31
32 > > If I mistakenly
33 > > tell a system to do B, really meaning do A, that's my fault. If I tell
34 > > it to do A, and it decides to do B, I will be extremely p'd off.
35 >
36 > I don't see what does that have to do with any of Alan's points.
37 >
38 > Regards.
39 > --
40 > Canek Peláez Valdés
41 > Posgrado en Ciencia e Ingeniería de la Computación
42 > Universidad Nacional Autónoma de México
43 >
44
45 It ties a bit into the above, really. Concise, job specific tools that
46 do one thing and do them well, and don't try to magic up a guess of
47 what they think the user *wants* when it can't give what the user
48 *specifically* asked for are going to be a lot less destructive than
49 tools that *do* try to guess and go on their merry way (when they're
50 wrong) than simply handing the situation back to the user (not
51 necessarily the end user, just the user that asked for that tool, and
52 asked it to do that one job), who knows their particular
53 circumstances, as well as what they want in that instance.
54
55 I'll add in a very specific note that I'm not chiming in on the topic
56 of systemd itself, as I've yet to play with it anywhere. I'm just
57 chiming in on the "go on your merry way" part. The caller goes on
58 their merry way, not the called.
59
60 All that aside, your side of the discussions on systemd have, at
61 least, made me curious enough to throw together a vm to play with
62 sometime this week when I get time.
63
64 --
65 Poison [BLX]
66 Joshua M. Murphy