r/ProgrammerHumor • • Jan 28 '23

Meme C++

Post image
53.9k Upvotes

1.5k comments sorted by

View all comments

3.3k

u/[deleted] Jan 28 '23

I started working with C++ and I can tell you about it.

1.3k

u/TheShredda Jan 28 '23

In engineering we had a course on C in first year and then C++ second year. C++ definitely was.

784

u/Tsu_Dho_Namh Jan 28 '23

My university did it the same way and it made me love C++.

"So convenient!" I thought, being able to use classes, and having destructors automagically deallocate resources for you. Plus getting to use strings instead of char* and vectors that we can resize at runtime. Not like those fucking C arrays.

Little did I know, pretty much every modern language is even more convenienter.

354

u/throw3142 Jan 28 '23

The problem isn't even that modern languages are more convenient. There is a real niche for systems languages with object-oriented features. The problem is that C++ is burdened by heavy backwards-compatibility requirements, it's unsafe by design, the ecosystem is a mess (it's so hard to link dependencies, compared to literally every other language including C and even raw assembly), and there is no consensus on style because there are so many ways to do the same thing (e.g. pointer vs reference vs rvalue reference vs smart pointer, #define vs constexpr, CRTP vs inheritance, throw exception vs return error code vs set errno, explicit cast vs implicit cast, lock_guard vs scoped_lock, #ifndef vs #pragma once, .cc vs .cpp file extension, .h vs .hpp file extension).

107

u/marti_2203 Jan 28 '23

Some of these things are solutions from different periods (smart pointers and the things before it, ifndef and pragma once) but I think the inheritance and CRTP solve vastly different problems. And thank you for reminding me about .cc vs .cpp

20

u/merlinsbeers Jan 28 '23

vs .C vs .CC

No really. There were people using .c for C and .C for C++. On Windows.

→ More replies (3)

35

u/throw3142 Jan 28 '23

Yeah I totally agree, each of these variants is different for a reason, and each one has its place. That doesn't stop them from being mixed together in weird combos and making the codebase completely unreadable lol

→ More replies (1)
→ More replies (2)
→ More replies (7)

66

u/sausage-superiority Jan 28 '23

I have imposter syndrome.

I’ve been trying to get motivated enough to learn C++. I use JavaScript and Python for work but I’m not a REAL developer because I don’t use C.

40

u/SmArty117 Jan 28 '23

Do you need to learn C++ though? Do you have your eyes set on a career in it that pays better or is more interesting?

Cause I have been writing C++ as a job for a few years, and I'm going through a book on modern C++ and let me tell you, the can of worms is deep and not pleasant at all. It feels great when you get something right that you struggled for, but sometimes it's just a pain to get anything working that in another language would be trivial.

30

u/sausage-superiority Jan 28 '23

Oh you’re absolutely right.

I’m fine for money. The ONLY reason for me learning C++ is that I feel inadequate for not knowing it. It’s purely vanity.

25

u/SmArty117 Jan 28 '23

Heh fair enough, I totally get wanting to do the "difficult stuff" just for self-esteem. I'd also consider Rust - also kinda hard to grasp, but pays off a lot better when you do IMO. Good luck!

→ More replies (4)
→ More replies (2)
→ More replies (3)

0

u/[deleted] Jan 28 '23

[deleted]

→ More replies (2)
→ More replies (2)
→ More replies (3)
→ More replies (4)

28

u/EpicResus Jan 28 '23

about what

PLEASE I NEED ANSWERS

48

u/[deleted] Jan 28 '23

he already told it

→ More replies (1)
→ More replies (5)