Algol (1958) is the spiritual parent language of the C/C++/C#/Java family. It introduced the accursed "int x" syntax which Niklaus Wirth tried to undo with Pascal and other designs. Yet the notation persists and perpetures a 60-year confusion around types and values.
-
Show this thread
-
Replying to @TimSweeneyEpic
What's wrong with "int x" ? looks good to me as it mimics math a little.
1 reply 0 retweets 1 like -
Replying to @younesouhbi
"int x" seems benign, but it runs aground when we expand the type system. Is "int<a,b>x" one declaration or two inequalities? Do we extend the patterns with functions? "int f(int)" seems nice, but what about "int(int)(int(int))f(int(int)(int(int)))"?
5 replies 0 retweets 5 likes -
Replying to @TimSweeneyEpic @younesouhbi
If we support overloading functions on constants, in a Haskell pattern-matching style like "factorial(int i)=i*factorial(i-1); factorial(0)=1;", what does "f(int)=0" mean? Is it saying "f of the type int is zero" or "f of any integer is zero"? See C++ template specialization...
1 reply 0 retweets 4 likes
It's tempting to say these are edge cases, but programming languages must scale. That's their entire purpose! If we can't write scalable abstractions on types and values, then libraries devolve into layers of workarounds like C++ std, rather than bundles of features.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.