Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think it will take years of working in c++ to fully appreciate the nightmarish many-tentacled footgun monster it can be.

At the end of it you might even develop Stockholm syndrome and be one of those posting “if you just restrict yourself to these parts of the standard and run this 6 static analysers on your code then c++ is perfectly safe if you’re not an idiot”.

If you don’t want to learn c++ for its own sake, that’s time you could better spend learning a language that’s not actively trying to harm you.

Source: coded c++ for 20 years, now writing rust as much as possible.



> If you don’t want to learn c++ for its own sake, that’s time you could better spend learning a language that’s not actively trying to harm you.

With enough time, you will realize that any language try to harm you and has quirks. Just different quirks in different scope. Rust included.

> Source: coded c++ for 20 years, now writing rust as much as possible.

I coded for C++ for a smilar time. Now I write Rust on my free time and I still enjoy C++.

This "nightmarish many-tentacled footgun monster" is still a pleasure to use for many use cases and far more powerful than Rust for some scenarios ( constexpr/consteval, template with const litteral, overloading, low level control on memory allocator and a gigantic ecosystem of high quality libraries)


Why not D, then? Just curious. D is “a better C++,” and it is a mature language.


I looked into D once or twice. Found learning materials severely lacking. Having to read up on the differences between 2 (3?) compilers and choose between them wasn’t a great intro.

For the work I do GC is also a non-starter. I know it’s got some level of no-gc now but the last time I looked it wasn’t well-supported.

In short it seemed interesting but on-boarding felt hard. And with that the value proposition wasn’t there or well-advertised: It’s supposedly “better” in some ways such as faster compile times and better meta-programming and frankly that didn’t seem worth the effort.

Rust by contrast does an excellent job of onboarding and making it easy to learn the language (at least at an introductory level). It also comes with a very straightforward value proposition: just as fast as c++ but whole classes of bugs simply aren’t possible. Add in a little bit of ergonomics and functional flavour and I was hooked.


I love D's community and what they were trying to achieve, but it appears that the language has lost its opportunity to adoption or sense of direction.

What I liked on it over Java and .NET languages, is no longer relevant after GraalVM, and the low level features in C# 7/8 adopted from Midori, came to be.

Also C++20 now makes much D less relevant.

Unfortunately the recent @safe and @live discussions don't inspire confidence in which direction they want to drive the language design.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: