4 ms·
Yeah to those still adamant about it, if you've ever used a: - function call - if sentence - any kind of loop You've used a GOTO under the hood. I hope you
by moffkalast 5y ago
Yeah to those still adamant about it, if you've ever used a:
- function call
- if sentence
- any kind of loop
You've used a GOTO under the hood. I hope you can live with yourself, you monster :)
- brundolf 5y agoBut there's a reason we come up with sanctioned, constrained concepts built atop more powerful lower-level ones. Constraints in code benefit maintainability, correctness, and sometimes even performance. "Yeah to those still adamant about it, if you've ever used statically-typed code, you've used untyped assembly under the hood. I hope you can live with yourself, you monster :)"
- agent327 5y agoYou put a smiley so I suppose it's possible you know better, but this kind of shallow, thoughtless critique is just painful to read, especially when following such a well-presented, historically accurate description of the debate surrounding goto. This is especially true given that Dijkstra himself refutes your argument, such as it is, in the opening paragraph of his seminal paper.
- GrumpyYoungMan 5y agoWhat's even worse is that, at the machine language level, condition and unconditional jumps are all that there are; we've all been using GOTOs constantly without even knowing it. :)
- 1-more 5y agoa case statement is the one where the GOTO peeks out the most, imo.
- andi999 5y agoThe real hidden gotos are: - state machines - early return of a function
- masklinn 5y ago> You've used a GOTO under the hood. That it's under the hood is the point of using constrained control-flow control. It's significantly easier to reason about `if` and `while` and `for` than about `goto`. That is basically the same reason functional programming have more HoFs than `fold`. You can do everything with `fold` and that's a problem because it creates way more cognitive overhead for the reader, they can't know what the code is trying to achieve until they get all the details, nor is the compiler able to check anything. Likewise goto.