loading...

re: What ever happened to putting the object type on the left? VIEW POST

FULL DISCUSSION
 

If I'm not mistaken, all of the languages that put types on the right seem to be able to infer types, so you can omit them in some cases; omitting them if they would stand before the variable name could easily lead to confusion, thus they opted for a syntax without any ambiguity.

 

This was my first assumption too.
Yet, as someone who has recently begun exploring Typescript, it still throws me off every time.

 
 

Please enlighten me about the exception(s)?

...types on the right seem to be able to infer types...

Ada is static and strong, it does not have type inference, most other languages are weak ;)

Code of Conduct Report abuse