Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. goto statement [moved]

goto statement [moved]

Scheduled Pinned Locked Moved The Lounge
questiondiscussion
27 Posts 16 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R RomTibi

    Is it wrong to use goto into a program? Why? When?:)

    36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War

    Moved by Admin on Saturday, December 08, 2007 6:11:58 PM. This is not a programming question. This is a programming discussion

    V Offline
    V Offline
    Vasudevan Deepak Kumar
    wrote on last edited by
    #21

    Goto is normally discouraged because it violates a good program (control) flow and makes debugging/troubleshooting a bit difficult and sometimes a nightmare.

    Vasudevan Deepak Kumar Personal Homepage
    Tech Gossips
    A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

    1 Reply Last reply
    0
    • CPalliniC CPallini

      :-D:laugh::-D

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      U Offline
      U Offline
      User 4688356
      wrote on last edited by
      #22

      see using goto makes your program less structured and makes use of no logic...it must be avoided

      CPalliniC 1 Reply Last reply
      0
      • U User 4688356

        see using goto makes your program less structured and makes use of no logic...it must be avoided

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #23

        Member 4691687 wrote:

        using goto makes your program less structured

        Maybe. But it really helps to rollback in particular circumstances.

        Member 4691687 wrote:

        nd makes use of no logic...

        Nope. Program logic heavily relies to developer's one. :-D

        Member 4691687 wrote:

        it must be avoided

        I don't like design dogmas. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

        In testa che avete, signor di Ceprano?

        1 Reply Last reply
        0
        • P PIEBALDconsult

          Yes, but not as wrong as asking a programming question in a non-programming forum.

          D Offline
          D Offline
          David St Hilaire
          wrote on last edited by
          #24

          How about if I try to help him out with this code sample I came across from someone who was apparently trying to avoid using a goto? I don't have access to the actual function anymore, but the basic idea went: do { //some code here if ([condition]) break; //some more code here if ([condition]) break; //this goes on for awhile.... if ([condition]) break; // ... } while (false); // clean up code

          1 Reply Last reply
          0
          • R RomTibi

            Is it wrong to use goto into a program? Why? When?:)

            36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War

            Moved by Admin on Saturday, December 08, 2007 6:11:58 PM. This is not a programming question. This is a programming discussion

            D Offline
            D Offline
            Delphi4ever
            wrote on last edited by
            #25

            In the first programming course I had, the textbook described GOTO as "evil"! EEEEeeeEEEviiiil! :mad: If you used GOTO, GOSUB or global variables, you flunked. That was made clear from the beginning. If you used the three "G"'s, you had not understod functions and you failed the course. I have never used the three "G" ever since. I think it makes the code hard to read. I so hate spagetti code. A function has some input and generate some output. Very simple. No globals comming down from heaven above. Put them in the function parameters. If there are many parameters, just organize them in a struct. If there are lots of data (like a picture) make a pointer and call-by-reference. The only exeption is const Pi=3.14. That may be global, but only in the math module.

            1 Reply Last reply
            0
            • CPalliniC CPallini

              In fact, I use it outside the programs: "Goto hell!" is one of my favourite expressions. Am I wrong? :-D

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #26

              A thorough software professional is one who when his wife yells at him "goto hell", worries more about the goto. Get more here.[^] :laugh:

              Luc Pattyn [Forum Guidelines] [My Articles]


              Sorry for any delays in replying, I currently don't get e-mail notifications.


              CPalliniC 1 Reply Last reply
              0
              • L Luc Pattyn

                A thorough software professional is one who when his wife yells at him "goto hell", worries more about the goto. Get more here.[^] :laugh:

                Luc Pattyn [Forum Guidelines] [My Articles]


                Sorry for any delays in replying, I currently don't get e-mail notifications.


                CPalliniC Offline
                CPalliniC Offline
                CPallini
                wrote on last edited by
                #27

                Luc Pattyn wrote:

                A thorough software professional is one who when his wife yells at him "goto hell", worries more about the goto.

                :-D :laugh: :-D Thank you so much :-D again

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

                In testa che avete, signor di Ceprano?

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups