Blog
Posts on software development, careers, and craft.
If your frontend approach doesn’t offer a way to abstract repeated HTML,...
If your frontend approach doesn’t offer a way to abstract repeated HTML, then you should avoid Tailwind. But if you don’t have a way to abstract re...
Three misconceptions I’ve noticed among people who don’t “get” Tailwind: 1
Three misconceptions I’ve noticed among people who don’t “get” Tailwind: 1. People think it’s “inline styles”. (It’s not. It’s utility classes that...
The longer I work in TypeScript, the more this is clear to me: When building...
The longer I work in TypeScript, the more this is clear to me: When building apps with TypeScript, if my code is hard to type, my design is probabl...
React performance problems are rare
React performance problems are rare. So, if I have a performance problem, I typically did one of 4 things: 🚫 My component is too big (so I split i...
Code reviews are a powerful way to improve code quality
Code reviews are a powerful way to improve code quality. But sometimes a code review is too late. Sometimes a code review exposes code that shouldn...
Limiting work-in-progress is useful
Limiting work-in-progress is useful. But, I’ve found the ideal number of tasks in progress is greater than one. Why? Because I often get stumped, b...
"Storing your unit test and the file under test in separate folders is like...
"Storing your unit test and the file under test in separate folders is like storing your hand soap in the closet." -@scottsauber at @kc_dc Colocate...
Microservices provide more team autonomy than Microfrontends
Microservices provide more team autonomy than Microfrontends. Here’s why: With Microservices, each microservice dev team can pick their own tech. W...
Just presented “React: The Most Common Mistakes in 2023” at @kc_dc
Just presented “React: The Most Common Mistakes in 2023” at @kc_dc. Here are the slides! http://bit.ly/react-kcdc-2023
I’m helping a company build a VERY big React app by composing many separate...
I’m helping a company build a VERY big React app by composing many separate React projects. 19 teams, and growing! I just audited the projects and...
I try to avoid introducing global state as long as I can
I try to avoid introducing global state as long as I can. Here’s why: The moment a system has global state, it tends to attract needless usage.
React mistake: Declaring state too high
React mistake: Declaring state too high. Why it's a problem: 🚫 Needless extra code 🚫 Needless extra renders 🚫 Needless complexity for no benefit...
Problem: Your web app is too big for one team to build
Problem: Your web app is too big for one team to build. Solution: Use Module Federation (MF) to compose apps. Here's how it works: 1. One team buil...
6 months ago, I started consulting a team with 1,300+ "any" in their TypeScript
6 months ago, I started consulting a team with 1,300+ "any" in their TypeScript. Since then, we've released tons of features, and dramatically impr...
I used to think every pull request (PR) needed to be "perfect"
I used to think every pull request (PR) needed to be "perfect". All win, no downsides. But sometimes a PR is many steps forward, and one step backw...
Yesterday, one of my clients had a problem
Yesterday, one of my clients had a problem. I tweeted my solution. It got over 6,000 engagements containing many thoughtful suggestions. Thank you...
Problem: When you deploy a new version of your SPA, users with a tab open...
Problem: When you deploy a new version of your SPA, users with a tab open will keep using the old SPA code. Yesterday, I shared one solution. Peopl...
Problem: When you deploy a new version of your SPA, users with a tab open...
Problem: When you deploy a new version of your SPA, users with a tab open will keep using the old SPA code. Solution: 1. Specify the app version in...
⚛️ React Tip: Don't nest React component declarations
⚛️ React Tip: Don't nest React component declarations. If you declare a React component in a React component, React creates a new instance of the c...
Mindset that motivates me to go to the gym daily: Going to the gym is a...
Mindset that motivates me to go to the gym daily: Going to the gym is a privilege. Someday I may not have the time. Someday I may not have the mone...
Goal: Allow the user to select items in a list
Goal: Allow the user to select items in a list. Three state approaches, from worst, to best: 1. list and selectedList 👎 2. list and selectedIds 👎...
TypeScript mistake: Needless “defensive” coding
TypeScript mistake: Needless “defensive” coding. Example: Making fields as optional “just in case”. Downsides: 🚫 Reduces clarity 🚫 Hurts type saf...
data is rarely the right variable name
data is rarely the right variable name. When in doubt, note the TypeScript type's name. Example: 🚫 function addItem(data: SelectedItem) 👍 functio...
Problem: If we allow ESLint warnings, the number of warnings will grow over time
Problem: If we allow ESLint warnings, the number of warnings will grow over time. Here why: 🚫 It’s hard to see when new warnings occur 🚫 Noisy ES...
Problem: Git pre-commit hooks are slow, which is annoying when I commit...
Problem: Git pre-commit hooks are slow, which is annoying when I commit frequently. Solution: Skip them like this: git commit -m “message here” -n...
I’ve worked on teams with high quality, reliable, comprehensive tests
I’ve worked on teams with high quality, reliable, comprehensive tests. How good were our tests? I made changes *without even running the UI*. 🔥 I...
Just learned about Million, a new alternative React virtual DOM
Just learned about Million, a new alternative React virtual DOM. Million diffs state instead of DOM. This is faster when there's a little state, bu...
Problem: Sometimes people disable an ESLint rule, then forget to remove the...
Problem: Sometimes people disable an ESLint rule, then forget to remove the disable when it’s no longer needed. Solution: Enable the report-unused-...
The URL is often underused in web apps
The URL is often underused in web apps. I use the URL for state when the user may want to... ✅ Share the state ✅ Bookmark the page and maintain the...
A bug I see in nearly every web app: If someone saves a stale record, it...
A bug I see in nearly every web app: If someone saves a stale record, it overwrites the newer DB record. 😬 Solution: 1. Provide 'updated' time wit...