← Back to context

Comment by einpoklum

3 days ago

Much of the complexity may be perceived, but much is also real, because of the commitment to backwards compatibility and non-breakage, plus poor default behavior of many things, often due to the C legacy, sometimes due to inopportune choices in earlier versions of the standard. Just think of things like variable initialization with () and/or {} ; or various kinds of implicit casts ; the hoops you need to go through to work with variants; etc.

But I agree that one doesn't have to learn everything, or nearly-everything, to write decent-to-good modern-C++ code.

The problem is that many confuse C++ Language expertise (often snarkily called a "language lawyer") with C++ Programming expertise. A famous example is Scott Meyers who is squarely in the first camp and who has publicly stated as not having written any sizeable C++ programs. Given that C++ is quite a baroque language it is important for programmers to focus on the second aspect and slowly build up their knowledge of the first aspect over time (most experienced programmers tend to do this in any language).

  • As a person who has some of both, I'm not so sure I agree. Many developers just get into the habit of assuming they don't need any more language knowledge, since they get by already, and the codebase they use is filled with code which fails to utilize most modern language features, and _that_ is already quite a hassle to know well enough to use.

    • Information and knowledge can be had at any age but it takes experience over time to gain wisdom. It is not that experienced developers are reluctant to learn new things but are cautious and conservative when it comes to adopting and putting them into practice especially for non-trivial systems in production. They have already tamed the complexity of their system and devised workable solutions to thorny problems and hence do not deem it wise to rewrite everything just because of some new fad and/or exciting feature being introduced in their language of use.

      The fact that C++ is a multi-layered language with assured backwards compatibility really helps in slowly migrating to newer design paradigms and performant techniques while being sure/stable every step of the way.