Hacker News new | ask | show | jobs
by simias 2347 days ago
That's a very optimistic way of looking at things. More than a decade ago (pre-C++11) I used to be a pretty proficient C++ developer. I had a bunch of books about C++ designs, I would use Boost left and right, I knew my design patters, I knew advanced templating tricks etc...

Then I kind of grew frustrated by the complexity and super long build times and for a few years I left C++ on the side, going back to C and other languages. Now I'm a big fan of Rust.

These days when I see a modern C++ codebase using "auto" all over the place, lambdas, the new constructor/initializer syntax, std::move and more, it can be very tricky for me to understand what some code is doing. I feel like I'm reading a new C-based language where I can understand most of it but I feel like some key components are eluding me. Generally I end up figuring it out but I really don't feel comfortable modifying the code because I don't understand all the implications. Very few languages, especially as old and huge as C++, change so drastically and so fast.

And again, I considered myself an advanced C++ user not so long ago.

>With C++ you only have to use a feature introduced after C++11 if you decide you really want to use it.

If you're the original developer who makes the decisions. If you end up working on a project using a different subset than the one you're used to then you're screwed. That's what the parent is talking about.

2 comments

> Now I'm a big fan of Rust.

> These days when I see a modern C++ codebase using "auto" all over the place, lambdas, the new constructor/initializer syntax, std::move and more, it can be very tricky for me to understand what some code is doing.

But what if you had spent 1/10th of the time you spent learning Rust looking at these features (frankly looking at the wikipedia pages for each revision is enough most of the time I think :

https://en.wikipedia.org/wiki/C%2B%2B11

https://en.wikipedia.org/wiki/C%2B%2B14

https://en.wikipedia.org/wiki/C%2B%2B17

https://en.wikipedia.org/wiki/C%2B%2B20

)

> But what if you had spent 1/10th of the time you spent learning Rust looking at these features

You can write object-oriented code in C too (e.g. gtk, glib etc). It just involves much more boilerplate, and it doesn't offer the same amount of built-in safety guarantees.

So I know enough Modern C++ to use it, but why would I when there are far better alternatives?

Because those alternatives, while better at syntax + semantics part, are still quite immature at IDE + libraries + eco-system part.

For example, try to use Rust to implement a UWP component callable from .NET, interacting with the Visual Layer, while using mixed mode language debugging inside Visual Studio.

those alternatives don't always offer what C++ has - for instance template<int I> is damn useful in many cases and not many languages have that
> That's a very optimistic way of looking at things.

It's the way a professional software developer who actually works with C++ projects looks at C++.

> More than a decade ago (pre-C++11) I used to be a pretty proficient C++ developer. (...) Then I kind of grew frustrated by the complexity and super long build times

Honestly, that comes out as utter bullshit. It sounds like you tried to find out which were the cliche criticisms and mindlessly repeated them, without noticing none of it makes any sense.

The main "complexity" that C++11 added was smart pointers and threading. It is simply unbelievable how someone who parrots they switched to Rust claims that stuff such as smart pointers and threading is too complex to learn. It's the sort of stuff that any developer quickly picks up with a cursory glance through the docs.

Your whole statement is even less believable if we were to believe your claim that you were somekind of Boost wizard who "considered myself an advanced C++ user", because Boost is the staging ground for whatever was added to the C++ standard.

Quite honestly, I find it hard to believe any of your claims.