frontend

How I Use TypeScript Without Losing Flexibility

Thoughts from the intersection of code, craft, people, and progress.

Yes, it's strict—but it's freeing once you lean into it.

TypeScript is most helpful when it clarifies the important boundaries in a system, not when it turns every small function into a legal document. I use it to make change safer while leaving enough room for the code to remain readable and adaptable.

TypeScript is most useful to me as a communication tool. A good type explains what the system expects and makes an impossible state awkward to express, without pretending runtime uncertainty has disappeared.

The answer is rarely a universal rule. It is a way of looking at the decision clearly enough to choose on purpose.

Prefer the thing that survives contact

Front-end work has a habit of looking simple from a distance. The browser then introduces real content, small screens, old devices, keyboard navigation and somebody using the product in a way nobody drew in the design file.

That is why I favour choices that are easy to inspect. Start with semantic HTML, let CSS do the layout work it was designed for, and add JavaScript where it creates genuine value. Cleverness is occasionally useful; legibility is useful every day.

The best front-end code does not show off. It makes the interface feel obvious.

A practical way to start

The useful review starts with a short checklist:

  • What problem are we actually trying to remove?
  • Who will have to understand this after us?
  • What evidence would make us change direction?

None of those questions produces an automatic answer. They do make the trade-offs visible, which is usually the point where a team can stop arguing from instinct and start making a decision together.

The web is wonderfully forgiving, but users should not have to rely on that forgiveness. Build from sturdy foundations and the interesting parts become much easier to enjoy.

There will always be exceptions. The trick is to make them deliberate exceptions rather than habits nobody remembers choosing.