From: Tim Rentsch on 17 Jun 2010 12:50 James Dow Allen <jdallen2000(a)yahoo.com> writes: > [comments on another subthread snipped] > > The thread title is "Goto" but break, inside return, and > switch fallthrough suffer, to smaller extent, the same sin as > goto. We read Note that the paragraph below is from a posting specifically discussing goto -- not break, inside return, or switch fallthrough. > On Apr 29, 3:20 pm, Tim Rentsch <t...(a)alumni.caltech.edu> wrote: >> Keith H Duggar <dug...(a)alum.mit.edu> writes: >> > Subsequently I discussed that flame war with one of the worlds >> > genius compiler writers who confirmed the necessity of the inlining >> > etc controls explained above. However, he also added that in his >> > experience it is pointless to argue with the anti-goto mob because >> > it is a religion that ignores all inconvenient empirical evidence. >> . >> Essentially the same thing could be said of the pro-goto mob. > > Wrong. We hear the sound of a mob voice. > The anti-goto mob claims to prefer code that > is clearly more complex (is Nathan's the best you have? > Did you ever post your solution, Mr. H?) in order to avoid the > inside return (or goto). One way of telling that comments are coming from someone in a mob (either pro- or anti-) is an insistence on inherently subjective statements as being absolutely true. (Another way is attributing irrational behavior to one of the mobs but not their opposite. Both are mobs.) The phrase "clearly more complex" is an inherently subjective judgment; different people can and will judge it differently. > None of us are "pro-goto" per se; Your actions belie your words, sir. > we're > just asking to *look at all the code and make the best trade-offs*, > or select the "least of evils." No there is more: a refusal to accept others' cost functions for different aspects of a tradeoff, and (often implicitly) an insistence that others accept the cost functions the mob member thinks are "right". > It's usually better to introduce > 1 or 2 boolean variables than to write goto, but what if it's 3 > variables and you still need a break? What if by using switch > case-fallthrough's you save the need for 5 little functions? Which is 'better' depends on what cost functions one chooses to adopt. Different development teams choose different sets of cost functions, and there's nothing wrong with that, since the judgments involved are inherently subjective. > There is no "universal demerit system" for code complications, > but to assign inside-return a cost of infinity seems much > too aggressive. Just because it contradicts your sense of proprieties doesn't make it an inappropriate choice for a cost function. Different people can choose whatever cost functions they wish, as long as they don't insist that other people must use the same cost functions that they do. And again, for the record, the earlier posting being responded to was about /goto/, not /inside-return/. If you want to lump these together in your head, that's up to you, but don't insist that everyone else share that view. |