logoalt Hacker News

coldpie • today at 3:50 PM • 4 replies • view on HN

I have a theory that the reason people like C++ is because it's challenging to use. It's like a puzzle or a riddle or a Dark Souls game. It feels good to get something done in C++ because there's so, so many ways for it to go wrong that when you do it right(-ish...), it feels like you're a master of a complex skill. This makes it a terrible language for actually getting things done, of course, but people like that feeling of overcoming the challenge, so they keep using it.


Replies

cogman10 • today at 4:01 PM

Here's the thing. I'd say that C++ is a great language for getting things done.

It gives you one of those fat swiss army knives I had as a kid with a spoon, fork, knife, toothpick, saw, nail trimmer, etc. The problem is it's easy to get dirty and the spoon would get locked in place after one use. But it was there, and it worked (once).

C++ is extremely malleable. I think the reason people like it is very similar to the reason people like lisp. That ability to do horrors like make a lisp interpreter with macros or templates is the charm of C++.

And if you are the only one writing it, it can be a joy because there are few limits to what you can or can't do.

It's only when you have to share a codebase with others that things can get out of hand fast without some committee established usage code and pledge.

➕ show 2 replies
materielle • today at 4:07 PM

It definitely has to be more complicated than that. I know the stereotype is that the C++ language lawyers are up in their ivory towers and don’t “get stuff done” like us pragmatic JavaScript or Python developers.

But the reality is a ton of domains like graphics, video games, and cloud infrastructure is built on C++.

I think the Spanner and Chrome devs “got stuff done” for instance.

I could go on a tangent about the whole “maker vs coder” debate that has sprung up around AI. It feels similar to the C++ idea you’re talking about. The idea is that people who actually understand code and computer science concepts deeply are too busy yak-shaving to be productive like us “makers”.

That ivory tower type definitely exists.

But this false dichotomy seems to be defense mechanism more than anything.

There are smart people that are basically better at everything. They understand C++ deeply, but can code in Python too, build massive pieces of infrastructure like Spanner, and now they are better at driving AI, too.

Not that I’m defending any of the horrible language design decisions of C++. But, you see what I’m saying. People who have skills beyond is in one area aren’t necessarily deficient in another area. Maybe they are just smarter and more skilled than us in a ton of ways.

➕ show 1 reply
trealira • today at 6:19 PM

IDK, I just like C++. I don't think that's the reason. It doesn't feel that good to get something done in C++, and it doesn't feel like a puzzle; it just feels mostly straightforward. The language which is actually like a puzzle and which feels good to write is Haskell, in my opinion, but it's not always as easy to get stuff done in Haskell. I suppose this is why many Haskell coders moved to Rust.

pjmlp • today at 4:12 PM

Nope, I like C++ because it was already Typescript for C in 1993, coming from Turbo Pascal.

Followed by the great developer experience of using Turbo Pascal alongside Turbo C++, later Delphi and C++ Builder on RAD Studio.

An experience that many languages still fail to reproduce nowadays, with exception of Java and .NET tooling.

You don't need to master every single feature.