Cro: Maintain it With Zig
Cro: Maintain it With Zig
Posted Sep 10, 2021 11:12 UTC (Fri) by excors (subscriber, #95769)In reply to: Cro: Maintain it With Zig by tlamp
Parent article: Cro: Maintain it With Zig
I think a lot of the recent C++ changes aren't about making it more powerful, they're making it easier to use the power that the language already had. Like you can now write "std::lock_guard lock(some_mutex);" instead of "std::lock_guard<std::mutex> lock(some_mutex);" (thanks to class template argument deduction) - not a big change, but it makes the code a bit cleaner. Or more substantially, with features like "if constexpr" you can do metaprogramming (i.e. code that's executed at compile-time, and its inputs/outputs can be both values and types) in a procedural style that's quite similar to regular C++, whereas previously you had to write everything in a weird recursive functional style with horrible SFINAE tricks. And there's a lot of language cleanups so that code which always seemed natural to write in C++ but previously generated obscure compiler errors, now compiles correctly and does what you'd expect.
The language specification is getting more complicated, but programs written in the language can now be simpler and less crufty, which seems like a good tradeoff.
