From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26923 invoked from network); 10 Mar 2023 18:09:47 -0000 Received: from minnie.tuhs.org (2600:3c01:e000:146::1) by inbox.vuxu.org with ESMTPUTF8; 10 Mar 2023 18:09:47 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 8D17B4158E; Sat, 11 Mar 2023 04:09:45 +1000 (AEST) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) by minnie.tuhs.org (Postfix) with ESMTPS id BEB514158D for ; Sat, 11 Mar 2023 04:09:40 +1000 (AEST) Date: Fri, 10 Mar 2023 19:09:38 +0100 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: Larry Stewart Message-ID: <20230310180938.6rYu2%steffen@sdaoden.eu> In-Reply-To: <498576F7-6881-4176-B187-F4ACB0A42F76@serissa.com> References: <20230310131512.891A8212A8@orac.inputplus.co.uk> <498576F7-6881-4176-B187-F4ACB0A42F76@serissa.com> Mail-Followup-To: Larry Stewart , coff@tuhs.org User-Agent: s-nail v14.9.24-432-g67dd7ec606 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-ID-Hash: A54HVABDOIGGC7CL5OWGTAAD2SZZ5DJ6 X-Message-ID-Hash: A54HVABDOIGGC7CL5OWGTAAD2SZZ5DJ6 X-MailFrom: steffen@sdaoden.eu X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: coff@tuhs.org X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [COFF] Re: [TUHS] Re: Conditions, AKA exceptions. (Was: I can't drive 55: "GOTO considered harmful" 55th anniversary) List-Id: Computer Old Farts Forum Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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. =46rom 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)