Viewing a single comment thread. View all comments

immibis t1_iyam8iu wrote

It's easier to understand something when all the pieces are next to each other in a straight line. You tell the computer to do this, then this, then all of these, then frobnicate the widgets, then pass the salt. When you see a loop, you know the computer is going to repeat what's in the loop a certain number of times, then do the stuff after the loop.

"goto" lets you tangle up the pieces as much as you like. The problem is not the word "goto" itself, but it is the fact that if you didn't create a tangled mess then you'd be able to write it without the word "goto". An otherwise straightforward program with one or two "goto"s is often still understandable, but when you have many of them, it can be hard to understand exactly what the program is doing, e.g. you might not even be able to work out how many times a certain line of code gets run.

Note that when Edgar Dijkstra wrote his famous letter "Go To Statement Considered Harmful" in 1968, structured programming with instructions like "if" and "while" were somewhat new and people weren't using them as much as they could have.

Ironically, many programmers write the exact same kind of mess with classes and methods, and think it's good because there's not a single "goto".

1

PooPartySoraka t1_iyb34q0 wrote

is "frobnicate" something you made up or a term you heard somewhere else? is it popular? i fkn love it it made me think of "rekafoobulating the energymotron" from futurama and i'm gonna use it all the time xD thank you

1

immibis t1_iyb4c7v wrote

it's a pretty common placeholder verb

1