4 ms·
>All languages that tried to fight complexity either grew up to adopt complexity and stay relevant, or faded away. And yet, to this day, C is just as, if not m
by PopsiclePete 9y ago
>All languages that tried to fight complexity either grew up to adopt complexity and stay relevant, or faded away.
And yet, to this day, C is just as, if not more popular, than C++. Why is that? I can do so much more in C++, but I, and my colleagues, pick plain-old C every time.
- pcwalton 9y agoYou're in the minority. For new projects, C is much less popular than C++.
- marrs 9y agoIt might not be that easy to tell. The C++ I write (for myself) is essentially plain C. No templates, dynamic dispatch, constructors, or exceptions. Most of the standard libs I use begin with the letter 'c'. It uses some C++ features, but it's philosophically much closer to C code.
- pjmlp 9y agoIf it only compiles with a C++ compiler, it is C++, regardless of the amount of language features being used.
- marrs 9y agoThat's fine, but I don't think that's what people mean when they say C++. I certainly wouldn't call myself a C++ coder and, if I applied for a C++ job, I'm pretty sure that, after I had explained that I don't do exceptions, virtuals, or the STL, I'd be politely shown the door.
- pjmlp 9y agoThanks Linux. C was already on the way out when Linus created Linux. Apple was migrating from Object Pascal to C++. IBM had CSet++ for OS/2. Borland, Microsoft, Zortech, Symatec were selling C++ frameworks. UNIX vendors were playing with Taligent and CORBA. BeOS and Symbian were developed in C++. Then came Linus, made Linux with GNU on top. GNU project for a long time always mentioned that the go to language for GNU projects should be C. All major C compilers are written in C++ nowadays, there is hardly any reason to stay with C outside UNIX world.
- pvg 9y agoC was already on the way out when Linus created Linux. That seems a little... fanciful. There was a lot of C++ and it was a great way to show how modern and forward-looking you were (and to sell compilers, tools, frameworks) but standardization hadn't got far, interoperability was poor, problems great and small abounded. A number of the things you mention above were spectacularly unsuccessful.
- pjmlp 9y agoYes, C++ was a pain to write portability before 2000, but so was C, in spite of having been standardized in 1990, most compilers were a mix of K&R C and ANSI C. Nevertheless, all major desktop OSes were going C++ for their application frameworks, before the widespread adoption of GNU software. > A number of the things you mention above were spectacularly unsuccessful. Mostly due to politics between corporations and very little to do with C++ itself.
- littlestymaar 9y ago> but standardization hadn't got far That's true, but not really fair: even ANSI C standard was only 2 years old at that time, despite C being way older than C++. Standardization takes a lot of time …