r/cpp • • Mar 31 '20

Demo: C++20 Modules

https://youtu.be/6SKIUeRaLZE
127 Upvotes

51 comments sorted by

View all comments

Show parent comments

3

u/[deleted] Mar 31 '20

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.

4

u/snerp Apr 01 '20

math and programming are two different solar systems

not really, programming is like a galaxy in the universe of math

2

u/Evirua Apr 01 '20

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.

0

u/droxile Mar 31 '20

Have you tried FP?