:: Re: [DNG] Studying C as told. (For …
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Irrwahn
Ημερομηνία:  
Προς: dng
Αντικείμενο: Re: [DNG] Studying C as told. (For help)
On Fri, 24 Jun 2016 14:33:21 -0400, Steve Litt wrote:
[...]
> I often use continue and break, but every time I do, I make a mental
> note that I'm decreasing modularity and thus reducing the scalability
> of my code. Of course, I might have also increased my code's
> readability by reducing redundant indentation. It's a tradeoff.


Well put. Only to add that a similar argument can be formed
regarding the more general[1] "goto" statement.[2] Structured
programming is a virtue, but one has to hang the tenets high
enough to comfortably walk beneath.[3]

IMHO the people that (ab)used Dijkstra's famous essay (with
the original title "A Case Against the Goto Statement") as
the foundation of some kind of religion did him and the
programming community as a whole a bad service. For the
interested, David Tribble's "Go To Statement Considered
Harmful: A Retrospective"[4] makes for a good read.


[1] NB: "break" and "continue" are just "goto" in disguise.

[2] For example in the notorious case of releasing resources 
    in reverse order of allocation in the event of an error.


[3] Lame attempt at translating a witticism once made by a 
    German politician.


[4] http://david.tribble.com/text/goto.html


Regards
Urban