DEV Community

Discussion on: What ever happened to putting the object type on the left?

Collapse
 
lexlohr profile image
Alex Lohr

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.

Collapse
 
tterb profile image
Brett Stevenson

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

Collapse
 
lucretia profile image
Luke A. Guest

Not all.

Collapse
 
lexlohr profile image
Alex Lohr

Please enlighten me about the exception(s)?

Thread Thread
 
lucretia profile image
Luke A. Guest

...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 ;)