4 ms·
Honestly, the changes in C++ 20 and 23, plus the upcoming changes for 26 (looking at you, Concurrency TS v2) have so drastically improved the language it's almo
by gavinray 3y ago
Honestly, the changes in C++ 20 and 23, plus the upcoming changes for 26 (looking at you, Concurrency TS v2) have so drastically improved the language it's almost like the ES5 -> ES6 evolution of JavaScript.
I might be in the minority here, but I genuinely enjoy writing modern C++.
My complaints are about it's dependency management story and lack of integrated, standardized tools for things like dependencies, testing, logging, etc.
- JohnFen 3y agoI don't know if you're in the minority or I am, but I find modern C++ to be borderline intolerable (and I've been programming mostly in C++ from before there were C++ compilers). I used to love C++ (and still do if we're talking about older standards), but the new stuff is just a baroque torture.
- eps 3y agoAye, same here. I don't mond C++ evolving into some thing of its own beyond all recognition, but there is a distinct lack of modern "C with Classes" language. Basically, C on steroids. There are attempts at that, but none is perfect and/or has enough traction to be viable.
- WanderPanda 3y agoI just want a C with templates (and function overloading)?
- eps 3y ago"this" and virtual functions are pretty damn useful too.
- CuriousCosmic 3y agoYou can still have "C with Classes" in modern C++ if you really want that. Just set a style guide that limits your code to that. There's more viable coding styles in C++ than I can honestly even bother to count. There's absolutely no reason to limit the language to one specific coding style when doing so would alienate large groups of users and you can set those limits yourself on your project.
- JohnFen 3y agoThis is what I do for my own projects, but it's not a viable thing to do with my work projects since I don't set the style.
- eps 3y agoYeah, I know and that's how I've been using it for the past decade, but it's not that simple. The language keeps changing and this forces adding cruft to the code if one wants to use newer compilers. For example, there are cases where the existence of move semantics necessitates adding some boilerplate when working with STL containers. There's no functional reason for it, just something to please the compiler.
- josephg 3y agoI’m excited for Zig for this reason. I’ve been writing a lot of rust lately and - well, it’s fine. Good at what it’s trying to do. But Zig seems a lot more fun. Much more in the spirit of C.
- eps 3y agoTo each their own, but I find zig syntax to be on the ugly side and the resulting code unelegant.
- Night_Thastus 3y agoAnything C++11 forward is alright with me, though 17 introduces some very nice conveniences like <execution>, <filesystem> and most critically <optional>. Honorable mention to std::clamp too.
- ska 3y ago> Honorable mention to std::clamp too. One shudders to think how many times variations of that template have been written in house.
- Night_Thastus 3y agoHeck, I find so many cases where std::min and std::max could be used as well.
- frfl 3y ago23 introduced <expected> (result/either) as well
- spacechild1 3y agoI would like to add: - structured bindings - auto parameters in lambdas - init statements in if and switch clauses - template argument deduction for constructors
- TillE 3y agoYou're absolutely not in the minority, old C++ was awful and there have been so many improvements to the language and standard library to help write simpler, clearer code. I was just recently appreciating the if statement with an initializer in C++17, which helps me express exactly what I want for variable scope in one line instead of multiple awkward ones.