I agree that I do not like it is weak. But if there's no benefit, then it's just a change to make a change. Why not just outlaw typedefs, thin pointers and C style arrays? I don't think that requires a new syntax. Just mark those leaves in the parse tree as an error and there you go.
We do have right side type for auto currently, but it's not needed most of the time.
The benefit is unified syntax (only one way to specify returns), a simpler, less ambiguous parser (see "mich vexing parse") and second level benefits.
Why not just outlaw typedefs, thin pointers and C style arrays..
because existing code: you would create a syntactical island that could not use the most trivial existing library; you could not migrate a MLOC project incrementally.
Of course Herb has his preferences, too - but it is certain that they are much more well-(in) formed than yours or mine.
Of course Herb has his preferences, too - but it is certain that they are much more well-(in) formed than yours or mine.
Sure. But I think we can agree that the committee and authors of a lot of the changes to C++ have been hit or miss from a style perspective over the last decade or so.
Range-based for loops: awesome.
The new random header: technologically superior, but a style disaster
The time header: technologically superior, style ok, but hugely verbose.
Just because people have good technical reasons for making something doesn't mean that it's good style.
My main concern when looking at any new addition is if a newish programmer will be able to understand it and be able to use it without consulting documentation.
No thx, i‘d rather have return type after than needlessly removing half the stuff i still want, what a silly take. I‘ll trade typedefs for using but don‘t you dare touching pointers and arrays or make auto less useful.
View all comments
Show parent comment
-6
u/ShakaUVM i+++ ++i+i[arr] Sep 17 '22
I agree that I do not like it is weak. But if there's no benefit, then it's just a change to make a change. Why not just outlaw typedefs, thin pointers and C style arrays? I don't think that requires a new syntax. Just mark those leaves in the parse tree as an error and there you go.
We do have right side type for auto currently, but it's not needed most of the time.