Blog
Posts on software development, careers, and craft.
Problem: Dead code
Problem: Dead code. (code that isn't called) 🚫 It's a sign of a bug 🚫 Creates a maintenance burden 🚫 Wastes time during refactoring 🚫 Adds nois...
Here's the difference between amateurs and pros: My friend is a wood worker
Here's the difference between amateurs and pros: My friend is a wood worker. He noticed multiple problems with my cabinets. 🚫 Cheap hinges 🚫 Low...
The big risk of using global state managers: Some teams think "Let's put all...
The big risk of using global state managers: Some teams think "Let's put all our state here." For example, I've seen many teams use Redux to store...
A test doesn't just make sure it works
A test doesn't just make sure it works. A test makes sure everyone understands how it should work. Tests are documentation.
React tip: Components designed for a single use should have only required props
React tip: Components designed for a single use should have only required props. An optional prop for a single use component is illogical. If the p...
How to write reliable end-to-end tests: 1
How to write reliable end-to-end tests: 1. Use a DB with a static dataset. 2. If 1 isn’t possible, “smoke test”. Don’t assert specific data exists....
Two related signs of a mature dev team: 1
Two related signs of a mature dev team: 1. Production bug fixes are rare. 2. When bug fixes occur, they're accompanied by an automated test that as...
Problem: JavaScript's sort method mutates the existing array
Problem: JavaScript's sort method mutates the existing array. Solution: The new toSorted method. It returns a new array, and doesn't mutate the exi...
A recipe for creating a TypeScript codebase that’s hard to maintain:...
A recipe for creating a TypeScript codebase that’s hard to maintain: Centralize all types Downsides: 🚫 We have to constantly jump between files 🚫...
Another reason to avoid prefixing TypeScript interfaces with "I": It can...
Another reason to avoid prefixing TypeScript interfaces with "I": It can lead to duplicated types, because types and interfaces are prefixed differ...
Many companies create needless overhead and complexity by batching deployments
Many companies create needless overhead and complexity by batching deployments. “Can we finish by the next release date?” “Who needs to approve thi...
Technologies foster mindsets
Technologies foster mindsets. React: Think of your UI as nested components. React query: Think of query results as a global cache. TypeScript: Thin...
React performance tip: You probably don't need to optimize React's...
React performance tip: You probably don't need to optimize React's performance on your own. I've been working in React for nearly a decade. I rarel...
React performance technique: Split a big component if some state is only...
React performance technique: Split a big component if some state is only used in a portion of the JSX. Splitting reduces the amount of JSX rendered...
There are many ways to write unreliable software
There are many ways to write unreliable software. These 8 practices help me write reliable software. ✅Static types ✅Feature flags ✅Automated tests...
Avoid centralizing TypeScript types
Avoid centralizing TypeScript types. Why: 🚫 Creates ownership ambiguity 🚫 Makes it less clear what the type is for 🚫 Makes it unclear when we ca...
Before I quit my job, I did a “safe” trial run: I asked my boss for 90 days...
Before I quit my job, I did a “safe” trial run: I asked my boss for 90 days of unpaid leave. He accepted. In 90 days, I trained multiple companies,...
Just got access to the GitHub Copilot Chat beta
Just got access to the GitHub Copilot Chat beta! 🎉 Now I can ask Copilot to perform tasks via chat. I predict this is how most developers will use...
If a function accepts a boolean, consider declaring two separate functions
If a function accepts a boolean, consider declaring two separate functions. Doing so improves readability and composability.
TypeScript tip: Avoid specifying a type inside map
TypeScript tip: Avoid specifying a type inside map. The array's type automatically applies to the map function.
As a React developer: If I'm copy/pasting JSX, I should probably create a...
As a React developer: If I'm copy/pasting JSX, I should probably create a reusable component. If I'm copy/pasting logic, I should probably create a...
“This code seems needless, but surely it’s here for a reason
“This code seems needless, but surely it’s here for a reason. We better not touch it”. Once code is merged, it’s hard to find unnecessary complexit...
I review TypeScript code daily
I review TypeScript code daily. Here are 6 suggestions I often make to improve types: ✅Eliminate any ✅Avoid optional fields ✅Avoid type assertions...
TypeScript tip: Avoid prefixing interfaces with "I"
TypeScript tip: Avoid prefixing interfaces with "I". The "I" prefix is a C# convention, but not a TypeScript convention. In TypeScript, prefixing w...
I've seen well-functioning teams suddenly struggle just because an *extra*...
I've seen well-functioning teams suddenly struggle just because an *extra* developer was added to the team. Hence, a rule: You can't add or remove...
Problem: You want to reset React state when a component’s props change
Problem: You want to reset React state when a component’s props change. Solution: Change the component’s key when the props change. When the key ch...
All developer productivity stats are flawed, and can be gamed
All developer productivity stats are flawed, and can be gamed. But, like it or not, I’ve seen managers quietly monitor these 5 stats: Number of com...
I use @playwrightweb or @Cypress_io to write 2 types of tests: 1
I use @playwrightweb or @Cypress_io to write 2 types of tests: 1. End-to-end tests Goal: Load each page to assure the app works against the real AP...
Measuring developer productivity with 100% accuracy is impossible
Measuring developer productivity with 100% accuracy is impossible. Yet everyone “knows” when someone on the team is struggling or not pulling their...
Hard truth: Some devs are WAY more productive
Hard truth: Some devs are WAY more productive. As a consultant, I work with dozens of teams. I see massive differences in developer output. Here's...