I worked on few projects in c++ many many years ago, so I don’t define myself as an expert in that language, but c++ nowadays scares me, looks like the language complexity have exploded and code looks like complex to me. All those templates … I have the feeling that languages like Rust have a chance long term to replace c++
Until they are 40 years old, with similar growth pain points.
I look at Java 18, C# 11/.NET 7, Python 3.10, and the knowledge about latest features, language and ecosystem changes across all major libraries for the last 25 years is hardly less complex.
I completely disagree. Java, C# and Python are all dramatically less complex than C++. And there is an additional issue: lack of knowledge about something in one of those languages might lead to a suboptimal implementation, but it is unlikely to lead to anything akin to undefined behaviour. As such, there is a sense in which you need to know everything about C++ in order to use it safely that isn't true of almost any other language.
Well you at least need to know a whole plethora of things that can trigger undefined behaviour, many of which are triggered by code patterns that are idiomatic in others contexts.
This is very unlike language like most other languages where you can play around with little language specific knowledge and the worst thing that's likely to happen is a runtime exception.
>you need to know everything about C++ in order to use it safely
Well, you should know the libraries that you're using in C++, but I don't think that's any different in Python or Java. Granted, the mental model is more complex in C++ but that's the price you pay for the amount of control you get.
Also, isn't undefined behavior a lot easier to come across in Python since it's dynamically typed?
python doesn't have c style undefined behavior. you might get unexpected behavior, but that is very different from undefined behavior which allows the compiler to delete your hard drive and launch a nuke if it feels like it.
Why does it matter how Python 1 worked? Nobody is using that these days. In fact , in 2022 you can probably even get away without knowing python 2 either.
I am not sure about that. Java has been around for some time now, but any Java developer can easily read code written 20y ago.
I find c++ syntax terse and hard to read. A good example is the well know boost library. Even back in the days when I was coding in c++ on day to day basis, I have always found boost code hard to read and reason about.
You can read the code, but are you sure you understand all the JVM implications of how that code changed and which versions introduced what behaviours?
My feeling is that C++ gained features. These new features allowed people to easily fall into some until-then unknown traps. Now C++ is gaining features to make these traps more visible and avoidable. The problem: to become proficient, you now need to know the features, its traps and how to avoid them.
I had the same reaction staring at all those new features.
Reading the code in that page, I felt as if I looked up only to find the night sky abuzz with otherworldly ships glowing in the dark. It made me anxious. And I wanted to run.
But now I'm wondering, is this my reaction because it's been more than 10 years since I touched any c++ or because the language got really complex? I'm curious what seasoned c++ developers think about this.
Frankly, a lot of the article is obscure corner cases that 99% of C++ developers will not encounter.
It's important that they're there, authors of very generic libraries may have to deal with them. But I'd much prefer to have seen something about modules in that list...