re: Convince me that types are awesome VIEW POST


What recently convinced me was diving into a fairly large codebase I was completely new to, built with TypeScript.

Well-defined types mean that I can look at a function, and immediately see the shape of data it takes in and puts out. I don't have to go look at callsites to see all the data I have available in it.

Contrast that to the Elixir backend of that application. A lot of data passed around there is in maps, where I find myself looking around the code base to see which keys are being set.

As my manager described it to me last week, data types really get you to think about the members of an object.

code of conduct - report abuse