Goto is the duct-tape of C++

Overheard in class: “Goto is the duct-tape of C++. It works, but it isn’t pretty. And you should be ashamed for using it. But still … it works in a pinch.”

Under the hood, programs are like 30% jump instructions, which is essentially a low level version of goto. And really when a program is executed, the software performing the execution is jumping from instruction to instruction to instruction, executing each. And a return statement or say a break statement are just goto statements with less ambiguity. I guess people avoid goto because of code readability, but it’s mostly fine. :wink:

So @Ethan has been learning C++ all by himself, just following some tutorials and stuff. I’m impressed that he chose C++ to learn.

And since he wasn’t part of a team of coders or engineers, and didn’t have to undergo any sort of code review, who cares? :slight_smile:

My first programs were all gotos and gosubs, because I learned with BASIC on a Timex/Sinclair 1000 and a TI-99 4/A. Maybe that’s why I’m a crappy programmer.

C++ is a great language to learn! That’s awesome he’s learning partially on his own!