TDD purism belongs to the world of dynamic typing.
A strict type system doesn’t mean inflexible. We can bend it to meet our needs with the utilities that ship with TypeScript.
Adding type checking to dynamically typed languages is possible, and awesome!
Chances are you’ve worked with the any
type in TypeScript. It’s widely overused, and subtly dangerous. Let’s explore why you should avoid it, and when you might truly need to use it.
When we inevitably make changes to our codebase, any help is appreciated, and a type system can be your best friend.
Treating your JavaScript type checker as a linter doesn’t allow you to fully leverage your static type system.
Lean on Elm’s friendly compiler to enforce currency-related constraints.
Sum types are a powerful domain modeling technique. Let’s look at how to use them to remove invalid states.
Adding static types after the fact can be a boon to your React Native codebase.
Elm types like String
can represent an infinite number of possible values. Let’s use types to reduce that number and better declare intent.