It is now 45+ years since C++ was first conceived. As planned, it evolved to meet challenges, but many developers use C++ as if it was still the previous millennium. This is suboptimal from the perspective of ease of expressing ideas, performance, reliability, and maintainability. Here, I present the key concepts on which performant, type safe, and flexible C++ software can be built: resource management, life-time management, error-handling, modularity, and generic programming. At the end, I present ways to ensure that code is contemporary, rather than relying on outdated, unsafe, and hard-to-maintain techniques: guidelines and profiles.

  • refalo
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    28 minutes ago

    I stick to C++98 (or 03) rules because it is so much simpler, and compiles faster. I don’t have to remember countless new rules for things like initialization or constexpr/consteval. If C had classes with RAII I would just use that.