Re: java and goto instuction! amazing!

Discussion in 'Java' started by Roedy Green, Aug 23, 2003.

  1. Roedy Green

    Roedy Green Guest

    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.
    Roedy Green, Aug 23, 2003
    #1
    1. Advertising

  2. Roedy Green

    DiscoStu Guest

    > 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.


    Hehehe that last bit is hysterical! :) Goto is obviously evil because
    people have told me so for the longest time, I think someone with a
    lab coat might even have proved it. I dont fully understand it so
    therefore it must be evil and morally wrong. </sarcasm>

    Lets all go fishing maybe
    DiscoStu, Aug 24, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tor Iver Wilhelmsen

    Re: java and goto instuction! amazing!

    Tor Iver Wilhelmsen, Aug 23, 2003, in forum: Java
    Replies:
    1
    Views:
    767
    David Off
    Aug 23, 2003
  2. E.C. Bäck
    Replies:
    0
    Views:
    421
    E.C. Bäck
    Aug 25, 2003
  3. Replies:
    0
    Views:
    390
  4. Mike Painter
    Replies:
    0
    Views:
    414
    Mike Painter
    Nov 2, 2006
  5. nais-saudi
    Replies:
    0
    Views:
    410
    nais-saudi
    Sep 12, 2010
Loading...

Share This Page