[squeak-dev] The Inbox: Graphics-ct.410.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Mon Sep 23 09:21:43 UTC 2019


I moved this submission to the treated inbox because we seem to agree that caseOf does not improve readability here.

In general, I would try to preserve the original meaning, which would have been that "self error: 'implementation error'." be the otherwise-clause.


Best,
Marcel
Am 15.08.2019 18:59:06 schrieb tim Rowledge <tim at rowledge.org>:


> On 2019-08-15, at 2:10 AM, Thiede, Christoph wrote:
>
> Of course, excessive use of #caseOf: might indicate the lack of an inheritance tree, but I don't think this is specific to #caseOf:, the same smell can be written with many conditionals as well.

It is a long understood truism that there is no language in which the poor programmer cannot write FORTRAN.

I've long ago lost count of the number of times I have seen stuff like

(thing isKindOf: Weeble) ifTrue:["do something daft"].
(thing isKindOf: Blobby) ifFalse: ["do related ridiculous thing that could be factored properly"].
thing doodah caseOf: .... etc etc

I used to find it disheartening. Now I just find it tedious and occasionally profitable as I get paid to make it right.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Oxymorons: Government organization



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190923/024e175c/attachment.html>


More information about the Squeak-dev mailing list