Hacker News new | ask | show | jobs
by olmo 3752 days ago
Sorry moron4hire but you are underestimating TS types system.

You can write quite crazy expressions abusing Boolean operators and he successfully keeps the static type.

You can also have different method overloads signatures as long as you have a more general implementation that does the dynamic checks at run-time manually. Most of the time you can use Union types anyway.

The big collection of definition files for almos any JS library out there is a living proof of how is possible to describe statically almost any JS API.

Let's face it, dynamic languages are about laziness, not about 'unconstraibed creativity'

1 comments

Laziness is the root of computer science. There is no virtue in hard work for hard work's sake.