Page 1 of 3 123 LastLast
Results 1 to 10 of 26
  1. #1
    Join Date
    Aug 2004
    Location
    little rock arkansas
    Posts
    3,482

    why are goto's bad in C++

    well i personally think they make harder to read progams
    Last edited by ostamo2; 03-26-2005 at 08:02 PM.
    ME WANT AGENTS ME WANT AGENTS ME WANT AGENTS

  2. #2
    Join Date
    Mar 2004
    Posts
    0
    who needs the spell-check now? gots??? you mean gotos

    i use them... sparingly, usaly a loop is better, though

  3. #3
    Join Date
    Aug 2004
    Location
    little rock arkansas
    Posts
    3,482
    so sue me i missed one letter
    ME WANT AGENTS ME WANT AGENTS ME WANT AGENTS

  4. #4
    Join Date
    Mar 2004
    Posts
    0
    well, ok, i think that gotos are better then function repition. but, in most cases, yes, they do make your code harder to read - while they are easir to code them loops. but if you had the extra times - go with loops

  5. #5
    Join Date
    Jun 2002
    Location
    Unknown
    Posts
    826
    i like go to's as im too lazy to make a long piece of code a function or a loop depending on the situation, a go to stament just saves time for me, granted it does make code harder to read but it makes it easy to quickly add in a loop if needed. There not that bad.

  6. #6
    Join Date
    Dec 2004
    Location
    Wisconsin
    Posts
    1,424
    Good lord, will you guys please define 'long time' for me, 20 seconds must be an lifetime for you all! But considering all the typos, yall must be in a rush... I kid I kid..

    Personally I never EVER use them, simply becuase I was soooooo thoroughly taught that it is BAD PROGRAMMING TECHNIQUE. Thanks Mr. Rubis Anyway, to each their own, unless I am the one who ends up maintaining their own!

    -ReD

  7. #7
    Join Date
    Apr 2002
    Location
    Calgary, Canada
    Posts
    7,090
    I ended up taking a crash course on C++. When we got to the break and continue commands, I asked a few questions and we got to the area of goto statements. He basically said that it was bad practice in programming to use them. I didn't question it. His words, not mine...

  8. #8
    Join Date
    Mar 2004
    Posts
    0
    back in the day of C, goto were used all the time. then it led to 'spegette' code, which was bad. so, it started to get looked down upon since then


    ~

  9. #9
    Join Date
    Jun 2003
    Location
    Trier, Germany
    Posts
    1,350
    one of the worst things about goto is, once you get used to it, you will use it all the time. i still remember, at the end of those old basic days, when i wrote my first pascal programs i was still so addicted to goto, that it made my code completely unreadable. and there is really no need to use goto in any high-level programming language, it's just a matter of not-thinking-in-goto anymore.

  10. #10
    Join Date
    Feb 2005
    Location
    Invermere BC, Canada
    Posts
    81

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •