Re:Darwin-xnu: The Darwin Kernel
by waynecochran on Saturday September 30, 2017 @01:18PM
(#15373877)
Interesting side note, source contains 8701 goto statements -- I like it.
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.
[ Parent
| on HN ]
You are saying it like if 'goto' was a bad thing. This is pretty normal for any kernel/system projects.
Re:Darwin-xnu: The Darwin Kernel
by winkywooster on Saturday September 30, 2017 @04:17PM
(#15374810)
And 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.
Re:Darwin-xnu: The Darwin Kernel
by 0xcde4c3db on Saturday September 30, 2017 @11:15PM
(#15376165)
> 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:
}