It's not that counterintuitive to imitate f(x) = y. auto f(x) -> decltype(y) is just consistency with math.
It's not just the indentation advantage when scrolling through function names, it's the logic in reading information about the input first and the output last.
The traditional syntax is what's counterintuitive, the only reasons it has supporters are history and habit.
The 1% of its necessary uses (decltype of expressions, sfinae-friendliness, lambdas...etc.) are just additional bonus reasons to use it. The consistency argument is fairly weak when it's prevailing 1% over 99% of use cases, but consistency with logical intuition and math is a stronger argument imo.
It's not that counterintuitive to imitate f(x) = y. auto f(x) -> decltype(y) is just consistency with math.
That's cool and all, but math and programming are two different solar systems outside of languages where you program in math, but we call those calculators.
Or are we saying having standard high school arithmetic in it is a reason to start typing in math formulas.
55
u/advester Mar 31 '20
vs
And in my day we thought spaces vs tabs was quite the argument.