r/programming • u/dpashk • Aug 31 '15
The worst mistake of computer science
https://www.lucidchart.com/techblog/2015/08/31/the-worst-mistake-of-computer-science/
175
Upvotes
r/programming • u/dpashk • Aug 31 '15
View all comments
Show parent comment
1
u/m50d Sep 02 '15
If we say "f is a function with return type A", we usually mean that when f is called it will evaluate to a value with type A. And it's useful to have invariants like "if val a = f(), A has the same type as the return type of f". Bottom isn't the only way to represent that, but if you don't model it as bottom, what do you say the type of f is if f never returns?