On Sat, 23 Aug 2003 12:36:48 +0330, "Amir Pashazadeh"
<> wrote or quoted :
>I decompiled a class file (using 3 different decompilers for accurancy), and
>every time I got the same source code, there is something amazing in it, it
>has "goto" instruction! how can it be?
>does JVM (as executor) supports "goto" instruction, but no standard compiler
>supports it yet? so a custom compiler can use it?
Yes. You can't go crazy with it. The byte code verifier checks your
loops and jumps to make sure they don't do goofy things with the stack
depth.
A parser might find it more convenient for example to generate byte
code directly where the GOTO is permissible. GoTo is wicked only in
human programming where the spaghetti you can create confuses fellow
programmers. Every IF and LOOP is built in byte code of conditional
jumps and gotos.
Fear of GoTo can reach absurd levels. I crossed horns with a boss
who had a strict no goto rule. I explained to him that using a goto
in an Eiffel-like macro could save an average of 6 nesting depths per
method in his style of C code, but he rejected it on the same grounds
a Christian rejects gay marriage.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See
http://mindprod.com/jgloss/jgloss.html for The Java Glossary.