frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: Do you still enjoy coding in C++?

20•hasley•1h ago
In the recent years C++ received a lot of backlash due to its complexity and (perceived) feature creep. However, since C++11 I really enjoyed writing C++ with its strict type system (including const), range-based for loops, smart pointers, and how much you can do with templates. On the other hand, I know that it can be very tricky to write, for instance, a correct iterator, to get handling of rvalue references right, or to read error messages that involve templates.

So, do you enjoy or dislike writing C++ source code and why?

Comments

mort96•42m ago
I enjoy writing C++ code.

I acknowledge that C++ is a bad language in a lot of ways, but it's a bad language which I know really well, and it fits with how I think about code. And it lets me effortlessly do "clever" things with how memory is managed to avoid unnecessary allocations etc. I've already learned most of its idiosyncrasies, handling rvalue references/move semantics, how to go about implementing contracts like iterators and containers, etc.

I also like writing Rust, and I like how Rust makes sure I don't make mistakes. I think Rust is a better language in many ways and I think it's the future of low-level programming (and I think it's wild that it took so many decades to get a proper competitor to C++!). But I also like how C++ doesn't care and lets me do whatever I want without acting as a nanny. I would never ever dare to write a publicly exposed web server in C++, but a game? Sure!

arya0•41m ago
idk but my claude seems to really enjoys writing code in C++
adev_•39m ago
In one word: Power.

C++ is by far the most powerful language around. And this is for the best and (often) also the worst.

In term of generic programming, control on hardware, capacity of abstraction and more generally expressivity: Nothing, even today, come even close to C++.

It is a language full of foot guns and it has its fair share of legacy problems.

But if you learn to avoid it (throught experience and pain). You can reach a productivity and a level of performance in C++ which is very difficult to beat with anything else, including Rust.

Ironically, I find it particularly true in the age of A.I.

Because the amount of C++ around is so tremendous, that agents are currently pretty good at it if guided properly.

egorfine•39m ago
There is C++ and then there is C++. Totally different things.

One I enjoy programming. Another I dread.

nottorp•29m ago
That's the real answer. Which C++?

I'm beginning to believe that some of the Rust evangelists are there just because they'd rather write code in anything but <some dialects of> C++...

iExploder•4m ago
I know exactly what you mean. But I would even say there are more C++'s than just two.

"C++, but codebase is 20 years old"

"C++, but we ban or dont like most of C++ features"

"C++, but everything must be a template"

"C++, but codebase is completely new and we only use the new features"

"C++, but its the stl codebase"

"C++, but you are reading Stroustrup's book"

logicchains•38m ago
I like writing in C++ because Claude does most of the work and if I structure the source well it compiles much faster than my Rust code.
ketzu•26m ago
I really enjoyed writing C++. At least the C++ with for loops, calling functions and the sort. Not so much the c++ of template specifications. I recently saw [1] and the point of C++ building new things with the template mechanics really resonated with me. Features built that way stopped me from using the part of C++ I really liked.

However, I stopped writing C++ once I switched to Rust. I assume I would still enjoy writing C++, as long as I can avoid a lot of the templating features. (I might have a different opinion if I worked on different kinds of C++ projects, eg more people, more library oriented, etc.)

[1] https://www.youtube.com/watch?v=DZTkT1Cq_aY

pjmlp•24m ago
Yes, on side projects where I get to use concepts or modules, or even ranges.

Languages like C++, Scala, Haskell, is where I get the most fun coding, unfortunately the question can be reformulated as "Do you still enjoy coding?", as we get pushed to program into natural languages instead.

staszewski•22m ago
What is coding?
pjc50•21m ago
I'd like to put in a "no" after spending many years writing C++; my day job is in C# now.

The templating system is more powerful than any other language I have significant experience with, but that also lets people write incomprehensible systems. And the compile times always have been really long.

throwaway81523•13m ago
Yes I mostly enjoy it, but I don't do anything critical with it and I'm nowhere near expert level. I use the subset of it that makes sense to me. If I were doing something critical I'd want to use Ada, which I've played around with a little bit.

I think the lurking question is about Rust. I've read a book about it and it has some attractions but also what I think are some poor decisions. I suppose I'll have to use it for something sometime. C++ is sort of like Perl, it seems to me. A lot of what seems like bloat is actually affordances, so the thing you want is often surprisingly close at hand. Some things of course are awful.

I wouldn't call C++ a good language but it does most of the things. Enjoyment doesn't always mean productivity anyway. I enjoy using Forth but that's almost like enjoying riding a unicycle. I wouldn't do anything substantial with Forth except for recreation. I do feel fairly productive in C++.

coderenegade•6m ago
Modern dialects of C++, sure. There's a nice language in there, it just comes with everything else and the kitchen sink. The most horrific code I've ever had the misfortune of working on was also C++.
cjfd•4m ago
I like coding in C++ a lot. I think it is great that it can both be a high level language an a low level one. One has control of the bits if one wants that but there are also a lot of goodies to make things happen automatically. I think RAII is the greatest invention in programming ever.
adg001•3m ago
I never enjoyed programming in C++. I feel its (original) syntax and approach to OOP to be obnoxious. I never looked into C++11, though; I hope things improved. The first love was always for C; notwithstanding all its shortcomings, I feel at home writing C, and I would still enjoy doing so.

ChatGPT Desktop forwards your SSH agent to remote machines

35•DenGorbachev•2h ago•9 comments

Ask HN: What are you working on? (November 2026)

221•david927•13h ago•740 comments

Ask HN: Do you still enjoy coding in C++?

20•hasley•1h ago•15 comments

Ask HN: How your SEO traffic doing? Up or down?

2•bigmuzzy•1h ago•0 comments

Ask HN: How do you manage your AI agents' context across clients and projects?

68•Michel_Aventin•2d ago•44 comments

Ask HN: Will Humans Become Useless?

2•misano•3h ago•5 comments

Those who have lost their job to AI what was your job?

2•dev_grex•5h ago•3 comments

Ask HN: How did you convince family and friends to join your XMPP/Matrix server?

99•mtlynch•1d ago•91 comments

Tell HN: A flood of reports of Opus 5.5 being nerfed

18•b--l•11h ago•11 comments

Tell HN: Gemini trains on chat history, even for subscribers (personal accounts)

734•jameslk•5d ago•201 comments

Ask HN: Is it normal to not write code for a years as software engineer?

3•khalidahmad•8h ago•5 comments

Ask HN: What's your current AI agentic setup?

565•eggbrain•4d ago•696 comments

Ask HN: What in the world is taking Ubuntu so long?

217•linsomniac•2d ago•139 comments

I am building Threadz. Human first AI writing app

3•shoebilyas_hanz•10h ago•1 comments

Ask HN: What are your advice for a CS/IT student for the future?

5•L0in•23h ago•19 comments

Claude usage credits purchased after Dec 7 will expire 12 months after purchase

17•bbg2401•2d ago•10 comments

I turned an ESP32-S3 into a Tailscale gateway with recovery functions

8•Mattboxx•1d ago•2 comments

We're bringing back the HN meeting in Mexico City

10•ysangkok•1d ago•0 comments

Ask HN: If LLM reverse engineering is deemed illegal, is that precedent for OSS?

4•apatheticonion•1d ago•10 comments

Is YouTube starting to protect channel RSS feeds?

6•kradeelav•1d ago•2 comments

HN's HTML has changed slightly

3•1vuio0pswjnm7•16h ago•2 comments

Seeking advice: Wix stolen my .com domain

13•wixcom•2d ago•12 comments

Ask HN: What tech companies do you think have a good moral compass?

6•gehwartzen•2d ago•16 comments

Ask HN: What fun things to do with an iPhone 11?

9•wanderingpixel•2d ago•7 comments

Tell HN: Be Careful with Stripe Connect

17•breue•2d ago•4 comments

Slickdeals.net Is Compromised

22•intenex•2d ago•2 comments

You've reached the end!