|
|
|
|
|
by krapp
1268 days ago
|
|
So they're really going to add the syntax that looks like, but isn't actually, type annotations for the convenience of people using a third party tool, which is useless in the language itself. It isn't native typing for javascript, which would be nice, but will never happen. Ah well, Javascript was a nice simple language for a while, but I guess it was inevitable that enterprise would ruin it. |
|
What happened in the last decade is that JS from a toy language was promoted to an enterprise grade language and is now used to deliver huge software projects. IMHO on such projects strong typing is a must have requirement, this explains huge popularity of Typescript in recent years. The problem with TS is that they went a little bit overboard with typing: you can have strange constructions like union types and crazy generic type defs - all to provide backward compat with untyped code, that could call func with e.g. string, object and array for the same function parameter. If we add strong typing to JS that _is enforced by the runtime_ we may skip this compatibility ballast and have something more simple.