Computer Old Farts Forum
 help / color / mirror / Atom feed
From: Steffen Nurpmeso <steffen@sdaoden.eu>
To: Larry Stewart <stewart@serissa.com>
Cc: coff@tuhs.org
Subject: [COFF] Re: [TUHS] Re: Conditions, AKA exceptions. (Was: I can't drive 55: "GOTO considered harmful" 55th anniversary)
Date: Fri, 10 Mar 2023 19:09:38 +0100	[thread overview]
Message-ID: <20230310180938.6rYu2%steffen@sdaoden.eu> (raw)
In-Reply-To: <498576F7-6881-4176-B187-F4ACB0A42F76@serissa.com>

Larry Stewart wrote in
 <498576F7-6881-4176-B187-F4ACB0A42F76@serissa.com>:
 |TLDR exceptions don't make it better, they make it different.
 ...
 |On the whole, I came away with a great deal of grudging respect for \
 |ERRNO as striking a great balance between ease of use and specificity.

From my user space point of view i never understood why there is
no dedicated hardware register / (plus) error indicating flag that
callers could cheaply and easily test.  (Maybe there is on some
processor platforms, beside a one such where errno then can be
placed in some per-thread structure stored there.  Still this
requires another dedicated return value.)

I ran away from the exceptions i got used to with JAVA to
-fno-rtti -fno-exceptions when i looked at the object output of
g++ 2.95.?, and saw in the support code they use heap memory for
this etc.

 |I also evolved Larry's Theory of Exceptions, which is that it is the \
 |programmer's job to sort exceptional conditions into actionable categori\
 |es: (1) resolvable by the user (bad arguments) (2) Temporary (out of \
 |network sockets or whatever) (3) resolvable by the sysadmin (config) \
 |(4) real bug, resolvable by the author.
  ...

Really interesting point, like SMTP and other protocols which
classify errors in categories.
Errors are one of my waving-helplessly topics, where you simply
have to let things go and where "perfection" just cannot be
achieved in real-life (or add .. as time passes by).
Often you just do not find the correct answer, with errno the name
sometimes fits, but the decade-old description does not really,
and very fast you end up with overloading (eg come to a second
ENODATA because ESRCH is something different, or reuse EILSEQ for
bogus input even though the function already used to use EILSEQ
for non-convertible output).

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

  reply	other threads:[~2023-03-10 18:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230310121550.9A80718C080@mercury.lcs.mit.edu>
     [not found] ` <20230310131512.891A8212A8@orac.inputplus.co.uk>
2023-03-10 14:20   ` Larry Stewart
2023-03-10 18:09     ` Steffen Nurpmeso [this message]
2023-03-10 17:34   ` Warner Losh
2023-03-10 17:11 Bakul Shah
2023-03-10 17:28 ` segaloco via COFF
2023-03-10 17:34   ` Larry McVoy
2023-03-10 17:35   ` Bakul Shah
2023-03-10 17:42     ` Larry McVoy
2023-03-10 17:43     ` segaloco via COFF
2023-03-10 18:03     ` Dan Cross
2023-03-10 18:57       ` Bakul Shah
2023-03-10 19:57         ` Marshall Conover
2023-03-10 17:47   ` Bakul Shah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230310180938.6rYu2%steffen@sdaoden.eu \
    --to=steffen@sdaoden.eu \
    --cc=coff@tuhs.org \
    --cc=stewart@serissa.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).