logoalt Hacker News

raincole • today at 3:38 PM • 10 replies • view on HN

No language scares me like C++ does. Look at this page: https://www.learncpp.com/cpp-tutorial/variable-assignment-an...

This is just a single section of the first chapter of a beginner tutorial. And it's already more things to remember than, say, the whole Lua.


Replies

tavavex • today at 6:05 PM

The real kicker is the countless ways in which code that looks normal at a glance is subtly wrong in ways the language will not warn you about. There's a trillion ways to do anything in C++, spread over multiple decades of language design, each way involving a hundred lower-level considerations you've never heard of but must know to understand which one to pick, and what feels like half of the approaches causes some random subtle memory leak or undefined behavior.

pjmlp • today at 4:08 PM

I know C++ since 1993, naturally don't know everything about the language.

I also don't know everything about Java, .NET, Python, JavaScript, SQL, HTML, CSS, and yet work gets done.

To use other languages as example, I bet most folks would fail a pub quiz based on the latest version of those languages, now with about 20 to 40 years history as well.

➕ show 2 replies
tolugenius • today at 3:53 PM

C++ is a language I heard is very "beginner unfriendly, and expert friendly" and it's true, I'm trying to relearn and really not clicking with me, anyone have tips on relearning or better sites than even learncpp?

➕ show 3 replies
qurren • today at 7:07 PM

C++ wasn't scary until they kept adding feature-of-the-month to the language. I can't understand recent C++ code anymore. Just leave constructors alone. We don't need constexpr. We don't need spaceship operators and all of that nonsense.

aleksiy123 • today at 4:04 PM

My favourite programming gif is relevant here I think

https://mikelui.io/img/c++_init_forest.gif

➕ show 1 reply
chuckadams • today at 3:45 PM

Reading Effective C++ those many years ago was eye-opening in a couple ways: initially for the intended reason in the title of the book, but later it felt like having a map to a minefield: good info to have, but it felt more prudent to stay out of the minefield in the first place.

apples_oranges • today at 3:42 PM

C++ dev here. I love this mess of a language ..

➕ show 5 replies
CamperBob2 • today at 4:17 PM

Soooo glad I don't have to deal with C++ anymore. Sure, AI might end humanity, but in the meantime, it will never have to pay for its own drinks as long as I'm in the bar.

on_the_train • today at 3:39 PM

In a cruel twist of destiny, it doesn't actually get much more complex than initialisation. But it's something that rarely goes wrong. Static analysis has that nailed down.

➕ show 2 replies
fnord77 • today at 3:45 PM

lol

    int x = 5;
    int x {5};
    int x = {5}
    int x (5);