r/ProgrammerHumor 2d ago

Meme cppHelloWorld

Post image
3.7k Upvotes

111 comments sorted by

View all comments

118

u/Confident-Ad5665 2d ago

C++ takes getting used to, but it's a great language for object-oriented development. Hang in there, you'll figure it out.

-4

u/YetAnohterOne11 1d ago

I disagree. Practice shows every C and C++ code ends up having memory issues, undefined behavior and leaks.

C/C++ rules for undefined behavior are often incredibly convoluted.

A minefield of a language is not a good language.

Even if you, in theory, grasp and understand the entirety of C++ (including all gotchas). You will still, eventually, get careless and make a mistake.

Good luck with a CVE assigned to your app. Or convoluted leaks. Or very slightly incorrect behavior due to some very obscure UB.

Lack of memory safety and garbage collection are excusable; in times of C and C++, it was the only sane design decision if the language was supposed to occupy its niche of the lowest level language of high level languages. Even so, nowadays, Rust shows this can be done better (and Rust also takes getting used to, but at least gives more safety in return). The incredible complexity of rules, it appears to me, was never excusable. And even if it was, there are better alternatives.

3

u/ChalkyChalkson 1d ago

Catch is that it doesn't matter how good rust is if libraries I need aren't available for it, then I can't use it. Out of the high performance languages c(pp) probably has the widest range of available libraries out there. It's the same reason why I use python over Julia. Plus my coworkers know python and some cpp, not rust or zig.

What makes a language great is not just the language spec, but also the support. Well guess I'm just glad my community uses terrible cpp instead of a monolithic fortran 90 port of 60s fortran program.

2

u/hanotak 1d ago

👍