5 ms·
When I first started coding, I thought loop structures were confusing and redundant when I could accomplish the same thing with GOTO. So that’s how I implemente
by freetime2 3y ago
When I first started coding, I thought loop structures were confusing and redundant when I could accomplish the same thing with GOTO. So that’s how I implemented all my loops for years until I eventually took a course and a teacher told me I was never to use GOTO again.
- deleted 3y ago[deleted]
- wongarsu 3y agoDijaksta's “goto considered harmful“ is often interpreted as a much broader opinion than it was, but this is a perfect example of what he was against
- User23 3y agoYeah Dijkstra's main objection to goto is that it's really hard to formally define its semantics and even if you do, the formalism is so complex it's hard to reason about. Break and continue on the other hand are considerably easier to formalize.