C++ In The Linux kernel
An anonymous reader submits "A researcher at Reykjavik University Network Laboratory (netlab.ru.is) has just released a Linux patch allowing for complete kernel-level run-time support for C++ in the Linux kernel, including exceptions, dynamic type checking and global objects (with constructors and destructors) The implementation is based on the C++ ABI in GNU g++, but contains various kernel level optimizations, that reduces the cost of throwing exceptions by an order of magnitude, thus making C++ exceptions viable in several scenarios. Furthermore, the Linux module loader is extended to handle weak symbols in C++, so that dynamic type checking is reduced to a pointer comparison, in contrast to string comparison."
Sounds like an exercise in obfuscation. How will SCO handle this?
Zhrodague.net - I do projects and stuff too.
I disagree. Exceptions are appropriate in many cases for conditions like "file not found" errors. These can be expected to happen in the ordinary operation of the program.
The whole advantage of exceptions is removing the need for complex deeply-nested if (errorcode) statements or error-prone goto exit jumps. It also removes the dilemma of functions returning useful information and an error code at the same time (without exceptions APIs usually provide a messed-up combination of in-band and out-of band information).
If you never use exceptions, you have to deal with all of that garbage even if the language is prepared to help you. Why not use the feature to clean up your code? Handle errors in a few choice spots where you're prepared to deal with them, not on every alternate line of your app.
And, to add one more thing, nobody around here appears to have bothered to read what that fucking patch does anyway.
It doesn't add C++ support to the kernel, you blithering slashbots.
It adds native kernel support to C++ in userspace.
Doh!
Say who? C++ is not a better C anymore than my an iPod is not a better alarm clock radio.
...language wars aside...
C++ and C solve different problems.
IMO C is good for low level and structured [re: modular] programming. Despite what many think this isn't limiting to say kernel development. Sadly many "developers" think a 1000-line main() function is "impressive".
C++ is meant to take C and throw it in an OOP direction. Although any program you can write in C you can write in C++ [and vice versa] this doesn't mean C++ is an "improved C".
It's stupid comments like yours that really drive down the merits of actual computer science. Since you don't understand the issue you take up an irrational and off-base point of view. The problem is that the world is full of lazy stupid people just like you. They fill up the halls and next thing you know someone is leveraging your dynamic synergy between solution providers and contact base deployments!
C++ has it's uses. C has it's uses. C++ is not "C v2.0".
Tom
Someday, I'll have a real sig.