What Teaching Taught Me About Writing Code
- Share image
When I started writing tutorials, I thought I was teaching people about CSS. It took me years to notice that the readers were teaching me something too.
Every name is a tiny lesson
A good tutorial never introduces two new ideas in one sentence. It turns out that good code doesn't either. When a variable name needs a comment, it's usually trying to say two things.
Write for the version of you who has forgotten everything, which is roughly next Tuesday.
Show the broken version first
The most popular posts on this blog all start with something that doesn't work. Seeing the failure makes the fix stick. I now do the same in pull requests: a screenshot of the bug, then the change.
Delight is a feature
The little wiggle on the newsletter button isn't frivolous. It's a signal that someone cared, and people can feel care even when they can't point at it.
If there's one thing to take away: be generous with the reader. They chose to spend their afternoon with you.