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=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32342 invoked from network); 10 Mar 2023 14:21:31 -0000 Received: from minnie.tuhs.org (2600:3c01:e000:146::1) by inbox.vuxu.org with ESMTPUTF8; 10 Mar 2023 14:21:31 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 497CD41539; Sat, 11 Mar 2023 00:21:06 +1000 (AEST) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by minnie.tuhs.org (Postfix) with ESMTPS id 5BFC241535 for ; Sat, 11 Mar 2023 00:21:01 +1000 (AEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id F03D832005B5 for ; Fri, 10 Mar 2023 09:20:59 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 10 Mar 2023 09:21:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=serissa.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1678458059; x=1678544459; bh=rGToSP3ZrTWfhvO1hULsvxU1hycrUzLjdTM GF5+8ipA=; b=IDw3cSbxYsbjUChEZDFYngRj+lYvEel8TuGtuDIY4lrxFLEl3Gc IdE1yjTLltijbKlhRMq2Ti34FOtp2sJuzJ1vqwtYjt1qy0o+h8Du0TIxjqbzAno4 TGN7XrOlivm0nusEM7Kw5dNGhr05LBiYPAwVjoX4b8pFk797/VUHxlAJr6x7QMqM clF1E5bJNT/XGpY4TSXgjekO8VP6FGxIyXytPv7eIj9xr3vP+W8EYzoIwKbgFCRR +cEI8xmEENMO3j1daPWDBU/Jq8KqVlNxy4uKFc5nF65DkZl9gA50OxwhX8wLy84S EZvqpFnVp8s3lJSSMh53pPQyUd7BIljR2vA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1678458059; x= 1678544459; bh=rGToSP3ZrTWfhvO1hULsvxU1hycrUzLjdTMGF5+8ipA=; b=F yrDvw7mss05TTXnbDuvwVb3B8qRlnG+CyJ7KQRU1uhfQ6cCxuwLoJsi+KXDRLluT pFMxtDJ12AINzqxWKKhYVrVuJzwBNf+l621Y3R1tchdOeYMr+zfsEOySZwNELgvi GxD9InJ9ge4HZnGF6L5eEYZQpxC3yzBEL6EpO2YNWpAEQoxNwJL2ydVhTvxxJoV0 vFrSp/ZkK/9CRskaJaCM9IEham0HHNf3koSRibPZ/SIxStxJMHAeiQTVYR/7xtW2 ogN/vT6AP1Gq/g9lZDedNrAxV5lc2udJ6YSVlqe5zZ9Bs8V5FCQA9OsQFOs3zSS6 BWnKWSurJ9C5JMhh+x86A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddukedgieduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpegtgffhggfufffkfhgjvffosehtqh hmtdhhtdejnecuhfhrohhmpefnrghrrhihucfuthgvfigrrhhtuceoshhtvgifrghrthes shgvrhhishhsrgdrtghomheqnecuggftrfgrthhtvghrnhepjeejuddtjeejfefgieffje etffeigfefuefhffeutddufedtgfehkeelffetvdffnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepshhtvgifrghrthesshgvrhhishhsrgdrtg homh X-ME-Proxy: Feedback-ID: ibf61458d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 10 Mar 2023 09:20:59 -0500 (EST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Larry Stewart Mime-Version: 1.0 (1.0) Date: Fri, 10 Mar 2023 09:20:48 -0500 Message-Id: <498576F7-6881-4176-B187-F4ACB0A42F76@serissa.com> References: <20230310131512.891A8212A8@orac.inputplus.co.uk> In-Reply-To: <20230310131512.891A8212A8@orac.inputplus.co.uk> To: coff@tuhs.org X-Mailer: iPad Mail (20D67) Message-ID-Hash: J7JQE6LCB24TMPSO3RZY6BILZT2YNLZ4 X-Message-ID-Hash: J7JQE6LCB24TMPSO3RZY6BILZT2YNLZ4 X-MailFrom: stewart@serissa.com 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 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: TLDR exceptions don't make it better, they make it different. The Mesa and Cedar languages at PARC CSL were intended to be "Systems Langua= ges" and fully embraced exceptions. The problem is that it is extremely tempting for the author of a library to u= se them, and equally tempting for the authors of library calls used by the f= irst library, and so on. At the application level, literally anything can happen on any call. The Cedar OS was a library OS, where applications ran in the same address sp= ace, since there was no VM. In 1982 or so I set out to write a shell for it= , and was determined that regardless of what happened, the shell should not c= rash, so I set out to guard every single call with handlers for every except= ion they could raise. This was an immensely frustrating process because while the language suggest= ed that the author of a library capture exceptions on the way by and transla= te them to one at the package level, this is a terrible idea in its own way,= because you can't debug - the state of the ultimate problem was lost. So n= o one did this, and at the top level, literally any exception could occur. Another thing that happens with exceptions is that programmers get the brigh= t idea to use them for conditions which are uncommon, but expected, so any u= ser of the function has to write complicated code to deal with these cases. 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. I also evolved Larry's Theory of Exceptions, which is that it is the program= mer's job to sort exceptional conditions into actionable categories: (1) res= olvable by the user (bad arguments) (2) Temporary (out of network sockets or= whatever) (3) resolvable by the sysadmin (config) (4) real bug, resolvable b= y the author. The usual practice of course is the popup "Received unknown error, OK?" -Larry > On Mar 10, 2023, at 8:15 AM, Ralph Corderoy wrote:= >=20 > =EF=BB=BFHi Noel, >=20 >>> if you say above that most people are unfamiliar with them due to >>> their use of goto then that's probably wrong >>=20 >> I didn't say that. >=20 > Thanks for clarifying; I did know it was a possibility. >=20 >> I was just astonished that in a long thread about handling exceptional >> conditions, nobody had mentioned . . . exceptions. Clearly, either >> unfamiliarity (perhaps because not many laguages provide them - as you >> point out, Go does not), or not top of mind. >=20 > Or perhaps those happy to use gotos also tend to be those who dislike > exceptions. :-) >=20 > Anyway, I'm off-TUHS-pic so follow-ups set to goto COFF. >=20 > --=20 > Cheers, Ralph.