[Coco] GOTO and code maintainability
Boisy G. Pitre
boisy at tee-boy.com
Mon Sep 7 13:33:17 EDT 2009
On a related note, I found this article from Dijkstra's on programming
languages quite humorous:
http://www.cs.virginia.edu/~evans/cs655/readings/ewd498.html
On Sep 7, 2009, at 10:42 AM, Michael Furman wrote:
>
> On Sep 7, 2009, at 7:44 AM, Mark McDougall wrote:
>
>> Aaron Banerjee wrote:
>>
>>> Has anyone else run into this type of "GOTO intolerance" while
>>> programming?
>>
>> At uni we were introduced to programming using Pascal, and in those
>> days "GOTO" was a 4-letter word. I graduated to C and for many
>> years it was drummed into me that the aforementioned was to be
>> avoided at all costs.
>>
>> To this day, you could probably count the number of times I've used
>> "GOTO" (in C) on one hand. At one point I was even resorting to
>> using a big "if (1)" statement with "break"'s littered within for
>> exiting on error conditions. I thought it was clever - until I
>> realised that (a) it didn't work with nested conditional structures
>> (for,while,etc) and (b) it was actually _clearer_ to the reader
>> using "goto"!
>>
>> [Of course this particular scenario is somewhat moot now with
>> proper exception handling in modern languages, but that's beside
>> the point.]
>>
>> I've learned that there's many ways to skin a cat, some better than
>> others, but to say "never" is probably foolish (with one exception
>> - I'll _never_ use Java for anything!). OK, 2 exceptions - add C#
>> to that list.
>>
>> Regards,
>>
>
> I happen to have copies of Dijkstra's original letters to
> Communications of the ACM on this subject. They are interesting
> reads, even if dated:
>
> Read this first: http://www.ocs.net/~n6il/dij68-2.pdf "Go To
> Statement Considered Harmful"
> Then this: http://www.ocs.net/~n6il/dij68.pdf "Go To Statement
> Reconsidered"
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
--
Boisy G. Pitre
E-mail: boisy at tee-boy.com
Web: http://www.tee-boy.com/
More information about the Coco
mailing list