News for hackers. Stuff that matters.
Re:Leaving Rust gamedev after 3 years by jandrewrogers on Saturday April 27, 2024 @12:07PM (#40181022)
C++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.

Re:Leaving Rust gamedev after 3 years by jstimpfle on Saturday April 27, 2024 @12:26PM (#40181173)
Heh, mentioning metaprogramming and logging is not exactly how you convince anybody of superior ergonomics and usability.
Re:Leaving Rust gamedev after 3 years by kelseyfrog on Sunday April 28, 2024 @03:52PM (#40191286)
It convinced me
Re:Leaving Rust gamedev after 3 years by ghosty141 on Tuesday April 30, 2024 @11:16AM (#40211939)
Metaprogramming 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.