Earlier quoted context omitted.
It's a really annoying widespread opinion. I've been looking for people who really do write OSes in modern C++.
IncludeOS? [0] From the CppCon 2016 presentation description: "Early in the design process we made a hard choice; no C interfaces and no blocking POSIX calls. We’ve done everything from scratch with modern C++ 11/14 - Including device drivers and the complete network stack all the way through ethernet, IP and ARP, up to and including UDP, TCP and recently also an http / REST API framework. To achieve maximum efficien…
Thor – A minimalistic operating system in assembly and C++
11–20 of 152 posts
Re: Thor – A minimalistic operating system in assembly and C++
#12Earlier quoted context omitted.
That's Linus's opinion, yes. Not everyone has to share it.
Yes, but his opinion counts more than some John Doe's as Linus supports his case with solid arguments.
Solid argument that.
His two other arguments:
- infinite amounts of pain when they don't work (and anybody who tells me that STL and especially Boost are stable and portable is just so full of BS that it's not even funny)
Considering that the linux kernel is strongly tied to the specific C dialect supported by GCC and is not portable at all, this argument is bullshit.
- inefficient abstracted programming models where two years down the road you notice that some abstraction wasn't very efficient, but now all your code depends on all the nice object models around it, and you cannot fix it without rewriting your app.
You can abstract yourself in a corner in C as well. In C++ you are more likely to pay less for abstractions.
Sorry, but I take it personally when me and my colleagues are called substandard programmers.
Re: Thor – A minimalistic operating system in assembly and C++
#13An OS in C++? But Linus said... http://harmful.cat-v.org/software/c++/linus
That said, this absolutely doesn't mean that you CAN'T do systems level programming in C++. I've actually done real RTOS and motor control work on a small embedded platform that went in a robot using C++! This is in an actual shipping product too, not just a hobby project...
As Linus said, it's definitely easier to come up with something inefficient in C++, and you do have to limit yourself to a sane set of features. That said, I think some of the things C++ brings to the table can make development a lot easier without sacrificing performance as long as you have a disciplined team and sane coding guidelines. But what makes sense for a personal project or a small team may not make sense for a larger project, and while I think Linus is justified in his opinion, you definitely shouldn't take it to mean that you CAN'T do systems programming in C++.
Re: Thor – A minimalistic operating system in assembly and C++
#14An OS in C++? But Linus said... http://harmful.cat-v.org/software/c++/linus
Re: Thor – A minimalistic operating system in assembly and C++
#15An OS in C++? But Linus said... http://harmful.cat-v.org/software/c++/linus
Re: Thor – A minimalistic operating system in assembly and C++
#16Earlier quoted context omitted.
Yes, but his opinion counts more than some John Doe's as Linus supports his case with solid arguments.
'It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do nothing but keep the C++ programmers out, that in itself would be a huge reason to use C' Solid argument that. His two other arguments: - infinite amounts of pain when they don't work (and anybody who tel…
It's much, much harder to do than in C++. It's also much more obvious when it happens, and in collaboration others will spot it quickly.
His tone is harsh but I find it completely right. I prefer to use C at work exactly because the same kind of software would be an absolute nightmare to write in C++ (it is very low-level soft, extremely similar to kernel code).
C++ is good if you can enforce very strict guidelines and if every single programmer that contributes to the code is very good at C++. Those are pretty big if, especially if you work with a partially open source codebase.
Re: Thor – A minimalistic operating system in assembly and C++
#17An OS in C++? But Linus said... http://harmful.cat-v.org/software/c++/linus
Re: Thor – A minimalistic operating system in assembly and C++
#18Re: Thor – A minimalistic operating system in assembly and C++
#19Earlier quoted context omitted.
That's Linus's opinion, yes. Not everyone has to share it.
It's a really annoying widespread opinion. I've been looking for people who really do write OSes in modern C++.
Re: Thor – A minimalistic operating system in assembly and C++
#20Earlier quoted context omitted.
Yes, but his opinion counts more than some John Doe's as Linus supports his case with solid arguments.
'It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do nothing but keep the C++ programmers out, that in itself would be a huge reason to use C' Solid argument that. His two other arguments: - infinite amounts of pain when they don't work (and anybody who tel…
Templates may bloat your binary size and increase compile times, but they're plenty fast.