I'm a fan of Open Source and have a growing interest in serverless and edge computing. I'm not a big fan of spiders, but they're doing good work eating bugs. I also stream on Twitch.
TypeScript is a superset of JavaScript, i.e. any valid plain JavaScript is also TypeScript and the types can be optional depending on how strict you make TypeScript in your project, so my guess would be that since they're optional, it's probably easier to parse the Abstract Syntax Tree (AST) when it's var/let/constvariableName:SomeType vs. var/let/constSomeType:variableName. I know that @nektro
is big into programming language design and is a fan of TS as well, so she might have some more insight into this as well.
Some feel it helps readability but Nick is right in that it also lies in that the type indicators for languages that put the type on the right are optional because the language has type inference.
You can read more about it here in a discussion I had a little while back
Why the type definitions are on the right after a : instead of on the left where final, let, var are used? What was the reasoning behind that.
TypeScript is a superset of JavaScript, i.e. any valid plain JavaScript is also TypeScript and the types can be optional depending on how strict you make TypeScript in your project, so my guess would be that since they're optional, it's probably easier to parse the Abstract Syntax Tree (AST) when it's
var
/let
/const
variableName
:
SomeType
vs.var
/let
/const
SomeType
:
variableName
. I know that @nektro is big into programming language design and is a fan of TS as well, so she might have some more insight into this as well.Some feel it helps readability but Nick is right in that it also lies in that the type indicators for languages that put the type on the right are optional because the language has type inference.
You can read more about it here in a discussion I had a little while back
What ever happened to putting the object type on the left?
Meghan 🎩