6 ms·
I really hope that C++ evolves with gamedev and they become more and more symbiotic. Maybe adoption of rust by gamedev community isn't the best thing to wish t
by hamilyon2 2y ago
I really hope that C++ evolves with gamedev and they become more and more symbiotic.
Maybe adoption of rust by gamedev community isn't the best thing to wish to happen to language. Maybe it is better to let other crowd to steer evolution of rust, letting system programming and gamedev drift apart
- flohofwoe 2y agoI think I don't know a single gamdev who's fond of "modern C++" or even the C++ stdlib in general (and stdlib changes is what most of "modern C++" is about). the last good version was basically C++11. In general the C++ committee seems to be largely disconnected from reality (especially now that Google seems to be doing its own C++ successor, but even before, Google's requirements are entirely different from gamedev requirements).
- durante_a 2y agoHi, I'm a game developer and I'm fond of "modern C++" and the stdlib. Sure, I would like some priorities to be different (i.e. we should have had static reflection a while ago), but it's still moving in the right direction. Particularly the idea that "the last good version was basically C++11" is exactly what I would expect to hear from someone who reads a few edgy articles on the internet but has no actual in-depth experience working with the language. C++14 and 17 are, for a large part, plain ergonomic upgrades over C++11, with lots of minor but impactful additions and improvements all over. I can't even think of anything in those two versions that would be sufficiently controversial to make anyone prefer C++11 over them, or call it the "last good version". C++20 is obviously a larger step, and does include a few more controversial changes, but those are completely optional (and I don't expect many of them to be widely adopted in gamedev for a decade at least, even though for some I wish it went more quickly).
- Arech 2y ago> stdlib changes is what most of "modern C++" is about). the last good version was basically C++11. I can only comment this like: tell me you have no idea about current state of C++ without telling me you have no idea about current state of C++.
- flohofwoe 2y agoThen let's hear some counter examples please. As far as I'm aware the last important language change since C++11 was designated init in C++20, and that's been butchered so much compared to C99 that it is essentially useless for real world code.
- Arech 2y agoThere a whole bunch of features and fixes that each new version of the standard proclaimed, which severely affected usability, expressibility and convenience of the language. Describing many of them could easily take an hour. I'm sorry, I can only highlight a few of my particular favourites that I regularly use and let you study the rest changes. https://en.cppreference.com/w/cpp/14 https://en.cppreference.com/w/cpp/14 - fixed constexpr, which in C++11 was basically unusable - great improvements for metaprogramming, which made such gems as `boost::hana` possible, such as variable templates and generic lambdas. - function return type deduction https://en.cppreference.com/w/cpp/17 https://en.cppreference.com/w/cpp/17 - inline variables finally fixes the biggest pain of developing header-only libraries - useful noexcept fix - if constexpr + constexpr lambdas - structured bindings - guaranteed copy elision - fold expressions I'm at automotive where due to safety requirements we just barely started to work with C++17, so I don't have much practical experience of the standards past it, though I'm aware there are great updates too. Overall - C++11 is as horrible compared to C++17, as C++98 and roughly 03 were compared to ground breaking back then C++11. Personally, when I skim though job vacancies and see they are stuck at C++11, I pass it. Even C++14 makes me very sceptical, even though I used it really a lot. All due to new nice improvements of C++17. https://en.cppreference.com/w/cpp/20 https://en.cppreference.com/w/cpp/20 https://en.cppreference.com/w/cpp/23 https://en.cppreference.com/w/cpp/23
- flohofwoe 2y agoOk, I'll give you fold expressions and structured bindings as actually important language updates. The rest are mostly just tweaks that plug feature gaps which shouldn't have existed in the first place when the basic feature was introduced in C++11 or earlier. IMHO by far most things which the C++ committee accepts as stdlib updates should actually be language changes (like for instance std::tuple, std::variant or std::range). Because as stdlib features those things make C++ code more and more unreadable compared to "proper" syntax sugar (Rust suffers from the exact same problem btw).
- jandrewrogers 2y agoC++17/20 are light-years beyond C++11 in terms of ergonomics and usability. Metaprogramming in C++11 is unrecognizable from C++20 things have improved so much. I hated C++ before C++11 but now C++11 feels quite legacy compared to even C++17. The ability to write almost anything, like a logging library, without C macros is a huge improvement for maintainability and robustness. Most of the features in modern C++ are designed to enable writing really flexible and highly optimized libraries. C++ rarely writes those libraries for you.
- jstimpfle 2y agoHeh, mentioning metaprogramming and logging is not exactly how you convince anybody of superior ergonomics and usability.
- kelseyfrog 2y agoIt convinced me
- ghosty141 2y agoMetaprogramming is required to get typesafe easy to use code. The problem of most template code is that the implementation gets horrendously complicated but for the user it can create A LOT of comfort. At work for example, I wrote a function that calls an rpc-method and it has a few neat features like: An rpc call with a result looks like this: call(<methodinfo>, <param>, [](Result r) {}); vs one which returns void: call(<methodinfo>, <param>, []() {}); It's neat that the callback reflects that, but this wouldn't be possible without some compiletime magic.