April 24, 2022, noon

PinkLetter - Help me help the community grok type thinking

PinkLetter (odone.io)

Welcome to my PinkLetter. A short, weekly, technology-agnostic, and pink newsletter where we cultivate timeless skills about web development.

My Ramblings This Week

Want to learn type-level TypeScript tricks while helping me research content?

Here’s a list of topics I’m juggling in my mind:

  • make bugs impossible with precise static types
    • make impossible states impossible
    • make impossible functions impossible
    • if it compiles it works
    • make the compiler remember (so you can focus on the important stuff)
  • go faster (not slower) with type driven development
    • don’t add types later; do start with types
    • thinking in types
    • reading code faster (types are to the map as values are to the street view)
    • writing code faster
    • refactoring code faster
    • prototyping code faster
    • types are just another tool
  • make impossible states impossible
    • always parse values that come from the outside
    • prevent values that don’t make sense
  • make impossible functions impossible
    • handle all possible inputs
    • enforce state machines
    • manage both happy and unhappy paths
  • remove redundant unit tests
  • hardcore type-level programming
    • make nested types readable
    • make type errors readable
    • don’t be clever with types; do be pragmatic

See anything interesting in there? Or am I missing anything?

Reply to this email and let me know: I’d like to learn better ways to make people grok those things and share them back with the community.

Elsewhere on the Web

The Joy of Small Projects by Dominick Schroer

  1. Pick the best project you can think of
  2. Pick a very aggressive and limiting timeline
  3. Reduce the project to its absolute minimum
  4. Execute that plan to completion

(Riccardo: Do this on each ticket and you will be the most fluid developer on the Kanban board. The best part? Instead of starting from a fixed solution and committing to an estimation, start from a timebox and commit to getting as close to solving the (business) problem as possible.)


Learn Git Branching by Peter Cottle

“Learn Git Branching” is the most visual and interactive way to learn Git on the web; you’ll be challenged with exciting levels, given step-by-step demonstrations of powerful features, and maybe even have a bit of fun along the way.

(Riccardo: Looks like they managed to make it both educational and fun. Good job!)


How the TypeScript Compiler Compiles by Orta Therox

A systems-level look at the TypeScript compiler. How it converts a file into something into data, checks the validity of that data and finally creates .js files on the disk.

(Riccardo: This is one of the best crafted technical talks I’ve ever watched.)

You just read issue #95 of PinkLetter (odone.io). You can also browse the full archives of this newsletter.

Brought to you by Buttondown, the easiest way to start and grow your newsletter.