Read JavaScript and TypeScript lessons from production

Learning from tutorials is great! You follow some steps, learn a smol lesson, and feel like you got this. Then you go into an interview, get a question from the boss, or encounter a new situation and o-oh.

Shit, how does this work again? ๐Ÿ˜…

That's the problem with tutorials. They're not how the world works. Real software is a mess. A best-effort pile of duct tape and chewing gum. You need deep understanding, not recipes.

I took a bet on JavaScript in 2005 when it was known as DHTML. It's been my favorite language ever since. These essays are the good stuff you can't learn from a tutorial.

Leave your email and get the JavaScript Essays series - a series of curated essays and experiments on modern JavaScript. Lessons and insights learned from practice building production software.

Latest JavaScript articles from Swizec

10 articles from 2021 ยท show all

December 2021

pg-mem and jest for smooth integration testing

The cult of TDD leads you down a dark and stormy path towards brittle code with a false sense of security. But there is a better way. A sweet spot between unit and heavy integration.

Why null checks are bad

Every null or undefined check doubles the number of tests you need ๐Ÿ˜ฑ

Small choices can wreck your codebase

wanna see the strangest looping construct I've found in production code?

November 2021

Finding unresolved promises in JavaScript

JavaScript is a fantastic server-side language because it's async. That also makes it tricky. ๐Ÿ’ฉ What happens when you swallow errors? Forget to resolve promises? Or run into a number of other anti-patterns

October 2021

How to configure Jest with TypeScript

Using plain Jest on a TypeScript codebase is kinda rough. No types in tests no thanks. Making Jest and TypeScript work together smoothly is something you do just rarely enough to forget the details. Hope this helps you and future me too โœŒ๏ธ

Learn TypeScript in 5 minutes

TypeScript solves many of JavaScript's sharpest edges. You don't need much to get started โœŒ๏ธ

September 2021

Stop SHOUTING = 'shouting'

A hill I will die on ๐Ÿ‘‰ global CONSTANT = 'constant' are bad

June 2021

A surprising feature of JavaScript optional chaining

This blew my mind, thought you'd like it too. You can do more with ?. than you thought.

April 2021

2 quick tips for 250% better Lighthouse scores โ€“ CodeWithSwiz 28

Your site may be fast for users, but Google don't care. Official metrics or bust.

February 2021

A TypeScript trick for reusable hooks

Reusable hooks are all fun and games until TypeScript starts yelling at you about incompatible types.