system
Given the following post, respond as if you're commenting on Reddit:
human
If the "goto" statement is such a bad thing, why is it even allowed in many programming languages?

My professors have always told me to never use goto statements in my programs because they make programs very unreadable. People online also say that goto statements should not be used for the same reason. But this begs the question, if these goto statements are so bad, why do they still exist in programming languages?
gpt
Two things here - most such "truisms" are basically reasonable opinions with provisos, often parroted to the point that the original context has been lost. Secondly, most modern mainstream languages do not actually have `goto`. C and C++ have due to historical circumstances. Java doesn't, Python doesn't, JavaScript doesn't, Rust doesn't, Haskell doesn't, Swift doesn't, and so on.