Re:C++20, How Hard Could It Be
by ncmncm on Sunday September 25, 2022 @04:49PM
(#32976052)
Then you are writing bad C++ code.
The new features are added specifically because they enable writing better programs. Avoiding them means you are choosing not to write better programs. It is allowed, but not a thing to brag about.
That does not mean every program has to use every feature. But when there is a choice between the new way and the old way to do something, the new way is very probably better.
Passing a reference, where you can, is better than passing a pointer. Passing a lambda is better than passing a function pointer. New for-loops are better than old for-loops. A unique_ptr is a better member than a naked pointer. A compiler-generated destructor is better than a hand-coded one.
Re:C++20, How Hard Could It Be
by alar44 on Sunday September 25, 2022 @06:49PM
(#32977213)
Absolutely, but none of those are really that new. I guess I'm talking more about boost libraries and that stuff. I just can't be bothered and it doesn't matter for anything I need to write.
The new features are added specifically because they enable writing better programs. Avoiding them means you are choosing not to write better programs. It is allowed, but not a thing to brag about.
That does not mean every program has to use every feature. But when there is a choice between the new way and the old way to do something, the new way is very probably better.
Passing a reference, where you can, is better than passing a pointer. Passing a lambda is better than passing a function pointer. New for-loops are better than old for-loops. A unique_ptr is a better member than a naked pointer. A compiler-generated destructor is better than a hand-coded one.
And so on.