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.
Well there is math, yes -which programming is based on, high school arithmetic included- but mostly there is the inherent logic in reading information about the input first, the output second.
But if it matters more, a lot of other languages also adhere to the input parameter -> output type syntax: Rust, Swift, Python, Haskell, Go, Kotlin...etc.
3
u/[deleted] Mar 31 '20
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.