Rui Maciel
4/24/2010 12:20:00 PM
io_x wrote:
> [Xpost to: alt.comp.programming, alt.lang.asm,
> comp.lang.c, comp.lang.c++, comp.programming]
>
> the people that speak not good about "goto"
> are uttled wrong; their code bug full etc
>
> more distant is your code from goto
> more your code is bug full and incompresible
>
> the "goto" is the key word for programming;
> all the remain, other than goto or jmp or jc or jz,
> and the easy cpu layout
> is the wrong way for programming
>
> i advise all you
> Good Morning
I see there is a small misconception in this issue. The only nasty thing that is usually
said about goto is that it's use may end up generating code which isn't easy to read, to
interpret and to follow.
Adding to that, high level languages implement multiple flavors of conditionals and loops,
which end up performing the exact same tasks goto is used for but in a way which is
"cleaner", easier to read, to interpret and to follow.
Yet, loop/conditionals aren't and be all, end all solution. Some tasks, such as state
machines, can still be better implemented with the plain old goto, sometimes in a "cleaner"
way than with any mix of loop/conditionals which are available in any high level language.
So, in essence, goto isn't the problem nor is it a problem. It's just a way of performing
certain tasks. Sometimes it isn't the best tool and sometimes it isn't the worst tool.
Nonetheless, that doesn't make it bad.
On the other hand, popular misconceptions which are often cited but aren't based on any
objective reasoning can constitute a problem, and this appears to be one of those cases.
Rui Maciel