News for hackers. Stuff that matters.
Re:Goto (2007) by moffkalast on Thursday October 21, 2021 @12:00PM (#28946433)
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 :)

Re:Goto (2007) by brundolf on Thursday October 21, 2021 @12:09PM (#28946596)
But 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 :)"

Re:Goto (2007) by agent327 on Thursday October 21, 2021 @12:24PM (#28946844)
You 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.
Re:Goto (2007) by masklinn on Thursday October 21, 2021 @02:20PM (#28948778)
> 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.

Re:Goto (2007) by GrumpyYoungMan on Thursday October 21, 2021 @12:58PM (#28947448)
What'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. :)
Re:Goto (2007) by andi999 on Thursday October 21, 2021 @01:45PM (#28948207)
The real hidden gotos are:

- state machines - early return of a function

Re:Goto (2007) by 1-more on Thursday October 21, 2021 @01:11PM (#28947644)
a case statement is the one where the GOTO peeks out the most, imo.