Blog

Posts on software development, careers, and craft.

Problem: Your project may be using deprecated features

Problem: Your project may be using deprecated features. Solution: eslint-plugin-deprecation I just learned about this plugin. It caught a number of...

Concern: “Code reviews slow us down”

Concern: “Code reviews slow us down”. Solution: Open a ticket for issues that can be resolved in a separate pull request. Example: “I opened ticket...

Another reason it's important to write tests: locale

Another reason it's important to write tests: locale. A dev in another country just submitted a PR that sorts numbers. The sort works for him, but...

In React, I group related state into one useState

In React, I group related state into one useState. Here’s why: ✅Requires less code. ✅Makes it easy to send to the server. ✅Can create a single onCh...

I’m reviewing a JavaScript code base with JS Doc comments like this above...

I’m reviewing a JavaScript code base with JS Doc comments like this above every function and component: I don't recommend this. TypeScript provides...

Problem: When a user clicks a button the response may be slow

Problem: When a user clicks a button the response may be slow. Solution: 1. Display a loading indicator 2. Set aria-disabled="true" on the button (...

I'm a big believer in code reviews

I'm a big believer in code reviews. But I've found review *after* merge can work well in high trust environments. Benefits: ✅ Code is merged quickl...

One of my favorite things about owning a Tesla: The phone integration

One of my favorite things about owning a Tesla: The phone integration. My phone is my key, so I don’t think about keys at all. I walk up and it unl...

Hot take: 🌶️ If I need data “power tools” like Lodash, Underscore, Ramda,...

Hot take: 🌶️ If I need data “power tools” like Lodash, Underscore, Ramda, Remeda in my web UI, I should probably improve my backend APIs instead....

The 5 keys to successful software: 1

The 5 keys to successful software: 1. Well built 2. Well marketed 3. Well supported 4. Well documented 5. Solves the right problem 5 is the key. 1-...

Some things that can’t be fully tested via automation

Some things that can’t be fully tested via automation. ✅ Is the code readable? ✅ Are there reuse opportunities? ✅ How’s the user experience? ✅ Is t...

Just audited a codebase with a REST API that returns this: { table1: []...

Just audited a codebase with a REST API that returns this: { table1: [] table2: [] main: [] } Don’t couple your API to UI elements.

A common mistake: "Let's abstract this in case we want to replace it later."...

A common mistake: "Let's abstract this in case we want to replace it later." Examples: 🚫 "Let's abstract React in case we switch JS frameworks." �...

I'm auditing an app that's using Tailwind...with CSS modules

I'm auditing an app that's using Tailwind...with CSS modules. 😬 Each component's styles are declared in a module.css file. Tailwind styles are app...

Simple JS developer productivity tip: Fail npm start if the expected port...

Simple JS developer productivity tip: Fail npm start if the expected port isn’t available. Here’s why: If the port isn’t available, the app is prob...

Just reviewed a web page making 55 fetch calls totaling 570k of JSON

Just reviewed a web page making 55 fetch calls totaling 570k of JSON. This one page is 1.6 MB. Why 55 calls? Because each database table is exposed...

Often a useEffect can be replaced by calling code when an event occurs

Often a useEffect can be replaced by calling code when an event occurs. So, when I see a useEffect, I ask: Could this code be triggered by an event...

Two related software development skills: 1

Two related software development skills: 1. Decomposition 2. Organization How we use these skills: ✅ Break tasks down into small, focused pieces. ✅...

React performance in one tweet: Declare state as local as possible

React performance in one tweet: Declare state as local as possible. If state is only used by part of the JSX: 1. Split the component 2. Move the st...

I rarely need to do React performance optimizations

I rarely need to do React performance optimizations. But we have a page with 5 big tables and a summary bar. When one table changes, everything ren...

Many programming practices have a sweet spot

Many programming practices have a sweet spot. No types vs 100% perfect types. No tests vs 100% code coverage. No pair programming vs 100% pair prog...

Problem: You want to easily update outdated npm packages

Problem: You want to easily update outdated npm packages. Solution: Use VS Code's Version Lens extension. It displays a colorful icon next to each...

Problem: You want to assure your web app isn’t logging messages to the...

Problem: You want to assure your web app isn’t logging messages to the console, and enforce it on CI. Solution: Use Playwright. With these 3 lines,...

Just hit 100k followers 🤯 Here are 10 things Twitter taught me about...

Just hit 100k followers 🤯 Here are 10 things Twitter taught me about programming and life. 1. Focus on value for others and people will listen. Mo...

In late 2022, I joined a struggling team as a part-time consultant

In late 2022, I joined a struggling team as a part-time consultant. Here’s how we turned things around: ✅ Wrote simple @playwrightweb tests to assu...

Pair programming is great

Pair programming is great. It can increase quality. It fosters creativity and collaboration. It helps catch issues early. It's a great fit for hard...

⚛️React performance tip: If your default state is expensive, put it in a...

⚛️React performance tip: If your default state is expensive, put it in a function. Here’s why: If the default logic is inlined, it's needlessly exe...

My M1 laptop is silent

My M1 laptop is silent. I don't think I've ever heard the fans come on. It's wonderful. I can't imagine going back to the distraction of whirring f...

📢 If you hate writing software, you may just be in the wrong role

📢 If you hate writing software, you may just be in the wrong role. I’ve worked with a LOT of different companies and teams over 20+ years. Typical...

Pair programming doesn’t typically replace code reviews for one simple...

Pair programming doesn’t typically replace code reviews for one simple reason: Most teams don’t pair all day. Why? Because pairing is useful, but i...