4 ms·
People who give blanket rules such as never to use `goto` clearly do not understand where this idea comes from or why it should not be used. Many years ago in m
by mikevm 5y ago
People who give blanket rules such as never to use `goto` clearly do not understand where this idea comes from or why it should not be used. Many years ago in my undergrad I submitted a programming assignment in C which used `goto` for cleanup, as is customarily done in the Linux Kernel and other C software and I had points taken off for using `goto`. Heh.
- SAI_Peregrinus 5y agoShould've used setjmp/longjmp to do the same thing. Make it even harder to reason about.
- munificent 5y ago> People who give blanket rules such as never to use `goto` clearly do not understand where this idea comes from or why it should not be used. The idea comes from Dijkstra and he sure as hell did consider it a blanket rule: "I became convinced that the go to statement should be abolished from all 'higher level' programming languages (i.e. everything except, perhaps, machine code)."
- bgorman 5y agoC is portable machine code :)
- munificent 5y agoNot in Dijkstra's time it wasn't.
- krapp 5y agoOn any modern system it really isn't[0,1]. [0]https://news.ycombinator.com/item?id=16967675 https://news.ycombinator.com/item?id=16967675 [1]https://queue.acm.org/detail.cfm?id=3212479 https://queue.acm.org/detail.cfm?id=3212479