In the 70s boomers would create spaghetti code, the actual definition of spaghetti code, because they abused goto statements.

In the 70s boomers would create spaghetti code, the actual definition of spaghetti code, because they abused goto statements. Because of this baby boomer professors drilled it into their students' heads that goto statements are bad and using them is a code smell.
They have plenty of uses though, like breaking out of double loops and doubling back on conditional checks.
Is it time to stop demonizing the humble goto?

A Conspiracy Theorist Is Talking Shirt $21.68

The Kind of Tired That Sleep Won’t Fix Shirt $21.68

A Conspiracy Theorist Is Talking Shirt $21.68

  1. 2 weeks ago
    Anonymous

    I sometimes abused exception handling to throw information out of ordinary data processing and catch it on higher levels even if it wasn't a technical bug but just an exceptional intermediate result that required special treatment. I suppose the code was horrible to digest for the branch prediction of a modern cpu but it faciliated coding and was very intuitive.

  2. 2 weeks ago
    Anonymous

    >like breaking out of double loops and doubling back on conditional checks.

    What if I'm not Indian though?

  3. 2 weeks ago
    Anonymous

    Yeah.

    Computed goto is actually where it's at.

    It's absolutely needed, as programs reach levels of complexity, without using a form of computed goto the linear patternization and rapid development of an immensely complicated program cannot be reached without using excessive amounts of forced id numbers.

  4. 2 weeks ago
    Anonymous

    Considering that most people accept exceptions which are a million times worse than goto, yes it is time to stop demonizing goto.

  5. 2 weeks ago
    Anonymous

    >like breaking out of double loops
    Any half-decent programming language should have a way to do this that doesn't necessitate arbitrary goto statements.
    >and doubling back on conditional checks.
    Use a loop homosexual.

  6. 2 weeks ago
    Anonymous

    No, the only people who are ready to use gotos are the ones who don't need to be taught how to use them. Just tell the plebs it's for debugging so they don't ask questions when they see it.

  7. 2 weeks ago
    Anonymous

    if statements and do while loops are just glorified goto statements
    while and for loops are just two glorified goto statements

    it's gotos all the way down

    • 2 weeks ago
      Anonymous

      pic rel
      the loops all end up as one goto (jump) statement when optimized

      • 2 weeks ago
        Anonymous

        What program are you using here? IDA or something?

        • 2 weeks ago
          Anonymous

          godbolt

          Motherfricker nobody demonizes goto statements considering exceptions are the default error handling mechanism in current year.

          in 4 years of undergrad i was never taught about gotos. it was just completely ignored.

          we did go through jumps in assembly, but that was junior year

        • 2 weeks ago
          Anonymous

          compiler explorer

  8. 2 weeks ago
    Anonymous

    The midwit loves the goto statement.

  9. 2 weeks ago
    Anonymous

    There is also other feats assosciated with goto and computed goto which are known is known as functional programming and the use of lambda expressions.

    Because of the denial of existance of computed goto and the functionality it brings, a programming paradigm revolving around the usage of lambdas has been explicitly used in modern day programming.

    The barebones functionality is the usage of a computed goto function or can be simplified in complexity to be the computed goto function.

    • 2 weeks ago
      Anonymous

      >Anon learns what an abstraction is.

  10. 2 weeks ago
    Anonymous

    >goto is bad
    >assembly uses goto
    >cpus use assembly
    >computers not possible without cpu
    >cpu is bad
    >computer is bad

  11. 2 weeks ago
    Anonymous

    >Goto Label3
    >Goes to Stop instead of the clearly labeled Label3
    Am I missing something about how this is supposed to work?

  12. 2 weeks ago
    Anonymous

    Motherfricker nobody demonizes goto statements considering exceptions are the default error handling mechanism in current year.

  13. 2 weeks ago
    Anonymous

    you can do anything gotos can do with functions & returns, in your example how do you break out of a double for loop? you move the double for loop into its own function which can then early return.

    goto's aren't as clear as functions calls that nicely encapsulate only what they need (arguments), have (variables) and do (logic).

    • 2 weeks ago
      Anonymous

      >encapsulate only what they need (arguments), have (variables) and do (logic)
      and result in (return value)

    • 2 weeks ago
      Anonymous

      This, writing it as a function with parameters and such wins hands down. It's at least as clear and passing on variables and/or even further functions to functions also is clear and type safe.

      Even if debugging its clear-er because you do not need to try and figure out if this code arrived there the first time or if shit got fricked up when some thing that gotos back there or a bit in front a while earlier fricked the thing up as tracking nested function invocations in a stack trace is better than tracking every goto including loops and w/e.

  14. 2 weeks ago
    Anonymous

    >Is it time to stop demonizing the humble goto?
    If you have to ask, you'll always be a pathetic follower. As noted by you seething about "boomers". No doubt you're jobless or a wagie working under someone else's rules.

  15. 2 weeks ago
    Anonymous

    goto? More like goato

  16. 2 weeks ago
    Anonymous

    The problem is goto acts as a hardware hack that doesn't work well in syntax.
    If you need to break out of outer loops from an inner loop or expect predicates to change then reconsider what you're asking the machine to do.

Your email address will not be published. Required fields are marked *