Comment by jeffbee

7 hours ago

That is both really useful and a great example of why they should have stopped writing code in C decades ago. So many kernel bugs have arisen from people adding early returns without thinking about the cleanup functions, a problem that many other language platforms handle automatically on scope exit.

> stopped writing code in C decades ago.

And what were they supposed to use in 2006? Free Pascal? Ada?

  • Someone suggested C++ and you should see the response from Linus

    https://harmful.cat-v.org/software/c++/linus

    • Of course I specifically avoided invoking that language's name within the context of kernel programming in fear of summoning a Linus.

      And he's so right. I didn't think like that back then, but new/delete (which have to be overloaded for kernel) behind allocators behind containers, vtables, =0, uninitialized members, unhandled ctor errors, template magic, "sometimes rvo", compiler hints, "sometimes reinterpret cast", 3rd party libraries, it would have been a disaster 20 years ago. Now he's being nice to Rust partially to spite that lang I love some more.