r/cpp • • Dec 07 '22

C++ overtakes Java in language popularity index

https://www.infoworld.com/article/3682141/c-plus-plus-overtakes-java-in-language-popularity-index.html
382 Upvotes

137 comments sorted by

View all comments

119

u/feverzsj Dec 07 '22

Kinda make sense. There are tons of embedded c++ jobs emerged this year. Mostly from automotive and medical industry.

68

u/SkoomaDentist Antimodern C++, Embedded, Audio Dec 07 '22 edited Dec 07 '22

Only a fool starts a new embedded project using C unless it's for a rare niche platform that doesn't have a working C++ environment. Unfortunately there are still many fools around.

E: I didn't expect to get downvoted on /r/cpp of all places for advocating using C++ instead of C for systems where C++ is almost ideally suited for...

37

u/[deleted] Dec 07 '22

C is still popular for its simplicity.

85

u/Raknarg Dec 07 '22

Simplicity in this case is not an advantage. Assembly is simple too, and it's simpler than C. The simplicity means that it's much harder to do more complicated things, and way easier to make mistakes.

18

u/[deleted] Dec 07 '22

I should clarify what I mean by "simple".

I meant that it's easier to follow and lacks implicit function calls (e.g constructors, function overloading) and data (e.g the extra pointer for virtual functions). It's not simpler to write, but it's simpler to read.

Contrast it to assembly which is all just instructions that not only vary between architectures, but require extra work to understand what happens due to the lack of names and proper types.

From my absolutely subjective experience, I always found it easier to do work on C code bases compared to C++ (you could also claim it's just much easier to make a mess in C++).

2

u/jusstathrowaawy Dec 09 '22

I always found it easier to do work on C code bases compared to C++ (you could also claim it's just much easier to make a mess in C++).

I'm inclined to agree with this. Part of my soul always dies when I open up a C++ header file someone else wrote and I see they're using inheritance.