r/ProgrammerHumor • • Jan 28 '23

Meme C++

Post image
53.9k Upvotes

1.5k comments sorted by

View all comments

7

u/ParCorn Jan 28 '23

Hilarious to think that anyone would pick C over C++ given the choice.

You can literally change all your .c files to .cpp files and suddenly you are writing in C++.

Choosing C over C++ is just wilfully forgoing useful language features. Great job dingbat

1

u/a_mighty_burger Jan 28 '23

Engineers who write software for embedded systems quite often choose C over C++. For good reasons.

1

u/ParCorn Jan 28 '23

Ive been an Embedded C/C++ Engineer for over 10 years, but OK

1

u/a_mighty_burger Jan 28 '23

I'm surprised then you think nobody would ever pick C over C++. Ah well, you're more experienced in the topic, you know what you're talking about.

1

u/MSIwhy Jan 28 '23

You're just wrong, and clearly know nothing about either language https://www.geeksforgeeks.org/write-a-c-program-that-wont-compile-in-cpp/ C++ also has a alot of reserved words that make writing in it a pain new,this,friend. The features you talk about aren't even useful in something like an operating system. The Linux Kernel switched to C++ in the late 90s and reverted it due to it being a dumpster fire.

1

u/mxdev Jan 28 '23

I've done embedded C for so long, it's just easier to write code in what I'm an expert with.

I've inherited a couple C++ projects, and it just takes so much longer to figure things out. It just doesn't fill any gaps in my skillset currently to learn it for new projects.

1

u/ParCorn Jan 28 '23

I have been an Embedded Engineer for over 10 years and once our company moved to C++ things got a lot easier.

An example of why is in developing peripheral libraries, we can use placement new, compile time static_assert and template based code generation to significantly clean up our code. It’s been so much better for us.

2

u/mxdev Jan 29 '23

Not sure I entirely follow, but it allows a ridged definition for libraries to force certain coding standards? Half of it sounds like a different language than what I'm used to.

Everything I'm doing is bare metal with our own silicon, trying to push memory and power usage as low as we can get it.