4 ms·
Interesting side note, source contains 8701 goto statements -- I like it. $ find . -name "*.c" -exec grep goto {} \; -print | wc -l 8701 Most of it
by waynecochran 9y ago
Interesting side note, source contains 8701 goto statements -- I like it.
$ find . -name "*.c" -exec grep goto {} \; -print | wc -l
8701
Most of it to unify releasing resources on function returns to one place at the end of the function body. This is what makes RAII in C++ so important/convenient.
- efiop 9y agoYou are saying it like if 'goto' was a bad thing. This is pretty normal for any kernel/system projects.
- winkywooster 9y agoAnd the same command on the Linux source returns 160,818. It's interesting how Dijkstra's take on the use of goto has blinded a large number of developers on the practicalities of its use.
- 0xcde4c3db 9y ago> This is what makes RAII in C++ so important/convenient. This reminds me of the C++ developer who, when asked what his favorite snippet of C++ source code was, replied with: }