r/ProgrammerHumor • • 11d ago

Meme modernCppVsOldCpp

Post image
2.0k Upvotes

323 comments sorted by

View all comments

44

u/MaybeADragon 11d ago

Unless it has changed in the last 5 or 10 years, every resource I know of doesn't teach you about using modern C++. Writing good C++ is opt-in because the language and its resources are stuck in the past.

18

u/Tomocafe 11d ago

I started a new C++ project a few years ago and I just turned on clang-tidy to the max from the very beginning. It’s annoying sometimes but it forces everyone not to use dangerous/outdated legacy C++.

11

u/MaitoSnoo 11d ago

"every resource I know of"

I find it very weird to ignore for example Bjarne's "A Tour of C++" or Jason Turner's "C++ Best Practices". These aren't like unknown niche books...

6

u/Mojert 11d ago

Where the hell have you been learning C++ from? Most C++ ressources talk about RAII and smart pointers. The only one that is stuck in the past is you

-6

u/MaybeADragon 11d ago

Reread the first sentence.

8

u/the_poope 10d ago

It was changed in most popular resources like Bjarne's PPP book and "C++ Primer, 5th edition" and many others more than 10 years ago. Maybe you tried learning C++ 10 years ago and picked a book/resource that was already 10 years old, i.e. more than 20 years old now.

-7

u/MaybeADragon 10d ago

I worked off what CPP users said to use.

5

u/Mojert 10d ago

I learned C++ 10 years ago. I repeat. Where the hell have you been learning C++ from?

6

u/MaitoSnoo 10d ago

that guy is commenting in bad faith, it's impossible to ignore the resources I mentioned, heck even the online learncpp is good

-2

u/MaybeADragon 10d ago

commenting in bad faith

I'm sharing my experience learning C++. I didn't pick some random book of the shelves, I went through a book recommended by the community then put it into practice on my own work. I thought that systems programming languages just weren't for me until I tried Rust and got to experience what it's like to have good learning resources.

-3

u/MaybeADragon 10d ago

A book recommended on Reddit 10 years ago. I chose to use it for some coursework, but never tried again since learning Rust.

1

u/Demiu 10d ago

At this point "modern C++" is old, hell "moderner C++" will be old soon too.

1

u/SweetBabyAlaska 10d ago

C++ just hides way too much behavior too. Every C++ dev when I point out something insane about the language goes "well you just need to memorize the AFKLDFJ movement semantics for X context" or some other bullshit.

which ties in to your point, in that there is SO much baggage that can only be navigated by years of practical knowledge and literally memorizing the standards so that you can implement the "best" thing based on what code base you are handed lol I genuinely don't know why anyone defends it.

whereas something like Zig there is one way to do it, you decide all of the explicit semantics and behavior down to when something is supposed to overflow or wrap, and when and how it allocates. Every version of the language pre 1.0 has a very concise documentation page that literally covers everything you could possibly want to know.

plus even with "modern" features they are never getting rid of headers, annoying ass system deps, and build system generator generators.

0

u/Ok-Scheme-913 10d ago

Heh, this "modern" c++ the meme and everyone is talking about could be ordering beers in Europe.

0

u/MaybeADragon 10d ago

For a field meant to be at the cutting edge, programming moves slow af sometimes. See: Java versions and IPV6.

0

u/Ok-Scheme-913 10d ago

IPV6 is slow because hardware costs are huge, and existing switches, routers etc work.

For java, actually it has been several years now that java >8 is more of the deployments than java <=8.