Goto Statement Debate

The cluster centers on debates about the 'goto' statement in programming, questioning if it's still considered harmful, its uses in error handling and loops versus structured alternatives like break/continue, and references to historical arguments like Dijkstra's paper.

📉 Falling 0.3x Programming Languages
3,530
Comments
20
Years Active
5
Top Authors
#9581
Topic ID

Activity Over Time

2007
1
2008
16
2009
131
2010
40
2011
104
2012
180
2013
177
2014
279
2015
220
2016
184
2017
153
2018
215
2019
217
2020
209
2021
336
2022
283
2023
365
2024
217
2025
191
2026
12

Keywords

GOTO CATCH IMO kerneltrap.org TRY FINALLY BASIC goto rc loop harmful code statement considered loops recursion canceled

Sample Comments

knollimar Dec 5, 2025 View on HN

Was the case against the goto statement so good we can't mention it?

shikoba Sep 21, 2021 View on HN

Some code are more elegant to write with a goto than a loop.

bfe Sep 12, 2013 View on HN

That goto is considered harmful.

stochastimus Apr 26, 2021 View on HN

does this mean that goto is not always considered harmful? ;-)

mickdarling Jun 5, 2020 View on HN

Doesn’t this just boil down to “GOTO may be useful”?

centimeter Dec 25, 2020 View on HN

Goto doesn't have a performance benefit over other control flow structures with a modern compiler.

t1m Nov 24, 2013 View on HN

New appreciation for the goto statement.

fsniper Apr 23, 2024 View on HN

Good old segmentation and goto's at work! Are goto's still considered harmful?

ghtrytttttnsa Feb 4, 2019 View on HN

Only wimps consider goto harmful.

grumpyprole Feb 12, 2022 View on HN

Yes there's nothing wrong with goto if you need it. Of course, if you are just doing a loop, then a loop structure better communicates the intent and is safer. This is just abstraction and its a good thing. An example from functional programming is direct recursion versus maps/folds, again better to use these abstractions when possible, but direct recursion offers the most flexibility.