4 ms·
I think it's interesting that they did consider C and then decided it was too much of a risk. There's a constant theme of 'why use C++? C is faster and doesn't
by nicholassmith 14y ago
I think it's interesting that they did consider C and then decided it was too much of a risk. There's a constant theme of 'why use C++? C is faster and doesn't suck as much!' especially due to Linus' statements on the language, but often C is a technical risk as there's so much more that can go wrong. I'm not saying C++ is a better language than C, but it's definitely different and given the language is structured to be less of a headache I'm surprised it's often shot down over C anyway.
- justin66 14y agoIt's a tangent, but: has Linus ever given a presentation that involved actually discussing code? Perhaps code projected on a screen, even part of a slideshow? It's odd that he's such an accomplished engineer but every presentation I've seen him give involves saying outrageous things while starry-eyed geeks stare at him adoringly. If it weren't for the fact that he's arguing from a position of (very great) authority, he would persuade very few people of anything.
- nicholassmith 14y agoWell, I've not seen any but that doesn't preclude him actually giving them but I'm sure he has said in interviews he mostly just does email and patch wrangling rather than actual coding these days. He's loud and opinionated and one of the tech folk heroes, his opinion is going to be listened too and often parroted due to it, even if it's just his opinion rather than a technical fact.
- zxcdw 14y ago> It's odd that he's such an accomplished engineer but every presentation I've seen him give involves saying outrageous things while starry-eyed geeks stare at him adoringly. Why is this? Because the man delivers.
- qznc 14y agoLinus does not code much these days, at least not in the kernel. Writing emails and git-merging is most of his job. If Linus is coding, it is probably more on his scuba diving tool than the Linux kernel. https://github.com/torvalds/subsurface https://github.com/torvalds/subsurface
- webreac 14y agoPresentations is not his job. I remember in 1992 when he has tried to compile the kernel using g++ mode. Compiling C in C++ mode was a way to detect more errors and to support migration toward C++. A lot of nasty bugs in g++ were discovered thanks to Linus. His main concern was that code generated by g++ was a lot slower than C. Many optimisations were not possible due to the language.
- beagle3 14y agoAh, but he has earned this position of authority by actually delivering. He did not get that position of authority randomly, nor by an act of nepotism nor by making promises during an election. First, by delivering working code that ended by running the majority of phones and smart devices out there. Also, by revolutionizing source code control. No, he didn't invent (almost) any of the concepts behind git, and by now the majority of the code was not written by Linus. However, he was able to strike a balance between features, usability, speed and working model that DID revolutionize version control. Monotone pioneered a lot, but was too slow and cumbersome; so was Bazaar without pioneering much. BitKeeper had a lot of things going for it, but freedom and price working against it. is more or less on par with git, but it's git that brought the revolution. Second, by being able to successfully manage more than one huge project with hundreds of contributors, all of whom he can fire at, but which he didn't actually hire (nor can he, if he needs more work).
- papsosouid 14y ago>but often C is a technical risk as there's so much more that can go wrong. That is objectively incorrect. There is much less that can go wrong with C, as there is much less period. Everything that you can do incorrectly with C, you can do incorrectly with C++, plus 10 times more things that C++ introduced. The idea that C++ is safer because "we just won't do dangerous stuff" is silly, as any language is safe if you "don't do dangerous stuff", including C.
- nicholassmith 14y agoAlright, I probably phrased it wrong. C++ was written with specific safe guards against a number of common issues than can occur in C code, still it's more than possible to go horrifyingly wrong in C++ but the language has been designed (well, 'ish', it's still C++) to help avoid simple issues. The issues then come from the fact it's still is a fairly complex language and developers are often going to make mistakes. All languages are safe if you've written perfect code, but no one is perfect, C++ does try to catch some of the lower hanging fruit problems but if you're writing hoary code you're going to blow your foot off eventually.
- papsosouid 14y agoAnd with C you can use static analysis tools to avoid simple issues as well, plus you get a simple language so you aren't making the mistakes that you get with a huge complex language. OpenBSD is entirely C, and they have a far better track record than most C++ software.
- pjmlp 14y agoC++ allows to you to - use safe arrays with bound checking if you feel like to - use automatic memory management - pass arguments by reference and being sure they point to valid data - use proper strings without caring if the null character is missing C++ is only dangerous thanks to the C compatibility legacy. Don't use C'isms and the application will be a lot safer than doing pure C coding.
- eru 14y ago
- nullc 14y ago> as there's so much more that can go wrong Uh. Everything that can go wrong in C can go wrong in C++ by definition. C++ also adds a lot of extra things that can go wrong which don't exist in C. There are plenty of arguments to be made for C++ over C but "so much more that can go wrong in C" is not one of them. The C++ FQA is strongly recommended reading: http://yosefk.com/c++fqa/ http://yosefk.com/c++fqa/