4 ms·
I think that isn't fair to Linus. C++ with minimal use of templates, nearly no dynamic allocations and never calling any function that could possibly throw an e
by Guvante 5y ago
I think that isn't fair to Linus. C++ with minimal use of templates, nearly no dynamic allocations and never calling any function that could possibly throw an exception is pretty dang close to C.
- pjmlp 5y agoIt is quite fair to Linus, “I will not use C++ and programmers who develop projects instead of C are kicked out, lest they mess up the projects I’m involved in”, “C++ ended up with a bunch of terrible, unmaintainable garbage” So how could C++ ever be possible in the Linux kernel? The problem isn't technical, and to come back to your C++ example, there are plenty of OSes using C++ at the kernel level. macOS being one of them via IO Kit, Windows since Vista, or that maker board loved by everyone, named Arduino. Probably to Linus dismay, all Project Treble drivers (which run in userspace) on Android, are mix of C++ and Java, classical Linux drivers are considered "legacy" in what concerns AOSP project.
- formerly_proven 5y agoOn the other hand, subsurface is now mostly C++ (mostly due to a GUI framework written in C).
- pjmlp 5y agoExcept Linus doesn't touch that C++ code at all.
- spacechild1 5y agoYou would still get RAII, generic programming and compile time evaluation - which I think is a big deal.
- kaba0 5y agoJust namespaces alone would be a godsend over bloody C.