Comment by jdw64
13 hours ago
There are so many standards and idioms that it gets confusing. There are still legacy codebases out there — some codebase still use C++98 as their standard, others use C++11... And with Unreal Engine, the modern C++ standard is C++14, right? There are things like smart pointers, but some places don't even use them. I feel like there are just too many features. When I saw template metaprogramming — that new feature — I realized I have no talent for C++.
I have developed things with C++98, C++11 and C++14. Every of these standards are so vast, so remembering everything (even in a single standard) is not possible. Instead of knowing everything, I first fix the standard I want or need to work with.
Then I design the thing I want to build. I always design what I want to build beforehand. This takes a couple of iterations from high level to low-ish level. That last design becomes a bit language dependent. Then I select some of the core tools that I'm going to use (which kind of pointers, classes or structs, etc.)
With that design in mind, I go "library shopping" both for file formats (if any) or other stuff like vectors, etc.
Armed with the reference docs of these, I write my code with the toolbelt I have built for the project.
Some things are hard, but they are not impossible. I find thinking like compiler helps a lot.
This is true of any language. Python with flask vs django, with/without type hints. JavaScript with anhular and vue.
The varying standards are no different to major python versions or go versions - arguably there’s even less between most versions than there is in your average go release.
The differences in apps and frameworks don’t matter for day to day - std::string, Unreal’s FString and QT’s QString all are similar enough that 99.9% of the time.
Metaprogramming is one of those things; you either write it or you don’t. Knowing some basics is required but the vast majority of people use a handful of pre existing things without understanding the nuances of how it works under the hood.
> This is true of any language
Is it? Java has changed a lot, but in such a way that it's still easy to mentally map new features to the old ones, provided you have understood the core language. IDEs can even convert your code from old to new and back.
> When I saw template metaprogramming — that new feature — I realized I have no talent for C++.
It's not a new feature. And tbh, compared to Typescript, C++ templates are tame ;)
(but yeah, deciding when to stop digging into the template metaprogramming rabbit hole requires some common sense and sanity, too much template complexity is almost never worth the hassle)
It was a new feature. Over 30 years ago now. Template metaprogramming was even featured in the ARM.
> And with Unreal Engine, the modern C++ standard is C++14, right?
Unreal Engine depends on C++20 at this point.
https://dev.epicgames.com/documentation/unreal-engine/epic-c...
When I went on a business trip for screen golf program project back then, it was UE4(CPP14), By your introduction UE5 onward, it's 20. I've updated my knowledge.