goto statement

Philippe C. Martin philippe at philippecmartin.com
Wed Apr 20 12:29:32 EDT 2005


I do not want to pollute the debate but:

-) I remember a software QA managanager responsible for "C" coding rules
also not allowing us to use 'break', 'continue', or 'return' (in the middle
of a function). 

Although I find them 'cleaner' than goto, would not use goto, and certainly
do use 'return' in the middle of functions, I also agree that some people
might think the former do reduce code readibility - ex: I , somehow, do not
feel good using 'continue' and 'break'.

-) Having worked on a few lex/yacc projects, I remmember being troubled ,as
I ported the resulting c code into an embedded environement, that the
latter extensively used gotos - Was that done only because people are not
supposed to look at the generated code - or is it also simpler to generate
non-structured C code ?

Regards,

Philippe



Peter Hansen wrote:

> Maxim Kasimov wrote:
>>  uuuuf..., i don't requesting that "goto" was available in next versions
>> of python, but i'm saying if it will be so, it will be easy and quickly
>  > _debug_ some skripts, _not only_ for commenting
> 
> Then we go right back to Simon Brunning's question for
> you: "How does goto help you to remove bugs?"
> 
> Maxim, nobody is really saying that *you* cannot have
> found goto useful in debugging (though we're curious
> for a real example, rather than just rhetoric).  What
> most people are saying (roughly) is that after writing
> tens (or hundreds) of thousands of lines of code, we
> cannot think of examples where the value of "goto",
> for debugging or otherwise, outweighs the incredible
> damage it does to the structure and (thus) readability
> of code.  And keep in mind that many of us were raised
> on languages like BASIC and yet we've learned, improved,
> and moved on to the point where we fully understand the
> perceived value of GOTO in the mind of a newbie, but
> remain unconvinced that even (or especially!) for a newbie
> it is a good idea to have it available.
> 
> So far, nobody on the "use goto!" side of the fence has
> presented arguments that haven't already been shot down
> dozens of times in this newsgroup and elsewhere.  Of
> course, we should all take this hint as a reminder that
> this is a "religious" issue and that this particular
> thread is not going to settle it once and for all.
> 
> -Peter




More information about the Python-list mailing list