Blog

Posts on software development, careers, and craft.

I often see web apps with separate frontend and backend dev teams

I often see web apps with separate frontend and backend dev teams. This front/back developer split leads to a common problem: Frontend devs become...

Problem: Choosing a React state library is hard

Problem: Choosing a React state library is hard. Solution: Consider the tradeoffs. Here are 6 key tradeoffs, with examples: 1. General vs Specific...

Just learned it's easy to create beautiful warnings and notes in markdown...

Just learned it's easy to create beautiful warnings and notes in markdown files: This creates a note: [!NOTE] This creates a warning: [!WARNING] Th...

React's built-in state works great

React's built-in state works great. But, it has limitations, so, third-party state libraries are worth considering.

The New York Times just upgraded from React 16 to 18

The New York Times just upgraded from React 16 to 18. Result: ~50% fewer re-renders! Why? React 18's automatic batching and concurrency features.

Problem: You need to manipulate a query result

Problem: You need to manipulate a query result. (sort, filter, etc, because the endpoint doesn't support it) Solution: Do it in react-query’s selec...

Code smell: Setting state twice in a row Example: Solution: Eliminate...

Code smell: Setting state twice in a row Example: Solution: Eliminate showDialog state. Derive state instead. If userToEdit has a value, show the d...

I’m building a new React app with all the new features: React Server...

I’m building a new React app with all the new features: React Server Components Server Actions useActionState useOptimistic I can build surprisingl...

Habit: When I'm coding alone in my home office, I often narrate my work aloud

Habit: When I'm coding alone in my home office, I often narrate my work aloud. Benefits: - Fosters creativity - Clarifies my thinking - Exposes hol...

Why code review is critical: If the code is confusing, it’s easiest to fix...

Why code review is critical: If the code is confusing, it’s easiest to fix it now while the requirements are clear, and the author is available. As...

Web app UI security in one tweet: Assume the client will -Change the URL...

Web app UI security in one tweet: Assume the client will -Change the URL params -Use devtools to manipulate the UI -Change localStorage, cookies, o...

Just presented “Lessons from 10 years in React” at @kc_dc

Just presented “Lessons from 10 years in React” at @kc_dc. A few key lessons: Performance issues are often simply because the component is needless...

"I'm not convinced Zod is helping" One of my clients said this because the...

"I'm not convinced Zod is helping" One of my clients said this because the app is occasionally throwing Zod errors when parsing API responses. My r...

Problem: When a URL param changes, React Router renders components using...

Problem: When a URL param changes, React Router renders components using useSearchParams, even if the params the component reads didn't change. Exa...

I rarely use Jest or Vitest for UI testing anymore

I rarely use Jest or Vitest for UI testing anymore. Here's why: Testing in a real browser using Playwright or Cypress gives me more confidence, mor...

Problem: Declaring default React prop values inside the component

Problem: Declaring default React prop values inside the component. Why it's a problem: 🚩"Hides" the API inside the implementation 🚩Makes the comp...

I often help teams add tests to existing web apps via Playwright or Cypress

I often help teams add tests to existing web apps via Playwright or Cypress. When I do, I fix dozens of usability and accessibility problems too. P...

PSA: A static production JS app shouldn’t need the node_modules folder

PSA: A static production JS app shouldn’t need the node_modules folder. I just helped a client significantly speed up their deployment process…by n...

Just spent a couple hours reviewing the “State of JS” survey results

Just spent a couple hours reviewing the “State of JS” survey results. Some key insights: - React remains extremely popular, despite its favorable r...

“Why validate JSON responses via Zod if the app just crashes if the schema...

“Why validate JSON responses via Zod if the app just crashes if the schema validation fails?” Good question. True, there’s typically no good workar...

Problem: Related optional properties Why it’s a problem: - Needlessly...

Problem: Related optional properties Why it’s a problem: - Needlessly verbose - Makes null/undefined checks clunkier - Doesn’t clarify if some prop...

A Zod misuse I've noticed: Validating function args

A Zod misuse I've noticed: Validating function args. Zod is for validating runtime input: - URL params - HTTP Responses - localStorage - Cookies -...

Naming rule: The larger the scope, the longer the name

Naming rule: The larger the scope, the longer the name. If it's a global variable, "i" is a bad name. If it's only in scope for a loop, "i" may be...

Quick story about humility: I recently met someone new at a conference dinner

Quick story about humility: I recently met someone new at a conference dinner. Within a few minutes, he told me about his multiple degrees, various...

Sometimes initial page load speed doesn’t matter

Sometimes initial page load speed doesn’t matter. Example: An internal SPA app that an employee uses to do their job. They load it once, and then u...

The new course is live

The new course is live! This course compares a variety of React third-party state libraries and shows how to implement four of the most popular opt...

The React 19 announcements and the existing React docs send a clear message: 1

The React 19 announcements and the existing React docs send a clear message: 1. Use a framework 2. Server render 3. Fetch in the route My concern:...

React’s docs have a gap: They provide no advice for people running...

React’s docs have a gap: They provide no advice for people running create-react-app today. There’s only a “Start a new project” page, and that page...

A mindset I’ve found helpful for learning: Don’t expect to understand on the...

A mindset I’ve found helpful for learning: Don’t expect to understand on the first try. This reduces my anxiety. I expose myself to new ideas in mu...

Today I'm working with an app that has too many layers of abstraction

Today I'm working with an app that has too many layers of abstraction. I have so many files open that I can't remember what they're all for. I can’...