A look at how both statically and dynamically typed languages have pros and cons and how we should identify the benefits and choose languages that provide the best of both worlds.
Internally as well we have good debates over the relative merits of dynamic vs static languages. My colleague Ryan Adams made great points about choosing good software development practices over relying on static typing and showed the elegance of something like Python over Java, in his piece Static types won’t save us from bad code. …
In this article I’ll take a look at some new features in TypeScript 4.1 — namely Template Literal Types, Key Remapping and Recursive Conditional Types. At the end I’ll show some crazy examples of using these features to do a bit of meta-programming.
I’ve always loved TypeScript and the language just keeps getting better with each evolution. 4.1 has lots of interesting new features. Here I’m going to look at:
TypeScript has supported string literals types since 1.8.
type Beatles = "John" | "Paul" | "George" | "Ringo"
These are extremely powerful when we want to bring safety to stringly typed API’s. Literal types were later extended to support numeric, boolean and enum literals as well. …