Re: Multiple returns vs. Single exit
"Mann, Ivan H" <[email protected]> Fri, 28 Dec 2007 15:30:40 -0600
| Newsgroups | gmane.comp.windows.devel.java.advanced |
|---|---|
| Message-ID | <3E47D20FD1918B48AC434AA83B57529601BA0CC6@usplm215.amer.corp.eds.com> |
One more comment: Way back when, when Djikstra first wrote that gotos were considered harmful a debate started about coding style, pragmatics, etc. The reason standards like "single exit" are created is because programmers who are not real good can make programs that don't work in spectacular ways and that one problem the person debugging has is knowing how control exited from this subroutine. Making it easy to find the exits (by having only one) does nothing to clarify the program. A bad programmer can still fail in spectacular ways, but now his program will not have that one problem (it will probably be worse). A much better approach would be to hire (and pay the price for) expert programmers. Another approach would be training to improve less good programmers. Obviously some managers feel it easier to produce edicts than to pay for good programmers. There are innumerable Dilbert cartoons on this subject. Back to the original question: it's sort of lame and not a substitute for good programming. They don't understand that. Ivan Mann =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com