Blog
Posts on software development, careers, and craft.
In Chrome, if I write an infinite loop, the tab just freezes and cannot be...
In Chrome, if I write an infinite loop, the tab just freezes and cannot be closed. I have to force close the entire browser, and thus ALL tabs. 👎...
I'm dealing with an unhelpful error message that doesn't provide a useful...
I'm dealing with an unhelpful error message that doesn't provide a useful line number. I'm using my favorite approach: bisect. 1. Delete half the c...
Why I ❤️ TypeScript: TypeScript gives me what I love about C#: Strong types...
Why I ❤️ TypeScript: TypeScript gives me what I love about C#: Strong types and excellent autocomplete. And TypeScript avoids what I don't like abo...
I'm updating a client's React component library
I'm updating a client's React component library. I'm converting old class-based demos to use functions with Hooks. It's striking how much of this t...
3 reasons to use TypeScript instead of React PropTypes: When checks run: PT:...
3 reasons to use TypeScript instead of React PropTypes: When checks run: PT: Runtime 👎 TS: Compile time 👍 Where output displays: PT: Browser cons...
Unpopular opinion: I like switch statements
Unpopular opinion: I like switch statements. 1. Switch clearly conveys "One of these cases applies" at a glance. 2. Switch's default case encourage...
Realization: Independence increased my productivity
Realization: Independence increased my productivity. - No commute - Fast internet - No recurring meetings - I choose my tools - My machine is much...
To save money💰 Buy used Avoid buying the “best”
To save money💰 Buy used Avoid buying the “best”. Look for diminishing returns (point where extra cost isn’t worth it) Upgrade less often (avoid sw...
To save money, look for “diminishing returns” (the point where the better...
To save money, look for “diminishing returns” (the point where the better item isn’t worth the extra cost). Examples: 2015 Dell laptop vs 2020 MacB...
Unpopular opinion: ESLint rules should be strict
Unpopular opinion: ESLint rules should be strict. We expect books to have consistent formatting/patterns. I believe code should be held to the same...
I ♥️ pure functions
I ♥️ pure functions. ✅Simple data as input ✅No side-effects ✅No external dependencies ✅Simple data out ✅Easy to compose ✅Easy to test
Rules keep me safe
Rules keep me safe. Rules help me avoid overdoing it. Rules keep me from ruining my health, relationships, finances, and happiness. Examples: I'm n...
Woot
Woot! This is big: @Cypress_io now supports testing Firefox and Edge! 🎉 Really excited to see cross browser support finally arrive in my favorite...
How I write code: 1
How I write code: 1. Write small, focused, well-named, pure functions. 2. Compose related functions in well-named modules. Result: ✔️ Easy to under...
I'm working in the cleanest code base I've ever worked with
I'm working in the cleanest code base I've ever worked with. It also has more automated tests than any app I've ever worked with. I believe the two...
It's sad how many people I see making good money, creating their own prison
It's sad how many people I see making good money, creating their own prison. Many people are implicitly saying this: "I'd rather live a lifestyle I...
Common mistake I see in React apps: Putting state in the wrong spot
Common mistake I see in React apps: Putting state in the wrong spot. Simple strategy: 1. Put state in the component that needs it. 2. Do child comp...
Common thread among people I respect: An abundance mindset
Common thread among people I respect: An abundance mindset. They don’t tear down others to build themselves up. They celebrate the success of other...
As a consultant, I'm seeing an epidemic: Companies are wasting millions by...
As a consultant, I'm seeing an epidemic: Companies are wasting millions by giving developers slow laptops. Today I said "npm install x". My laptop:...
So far, I ♥️ being independent
So far, I ♥️ being independent. 1. Don't need to keep Slack open 2. No commute 3. Don't need permission to take vacation or work odd hours 4. Quiet...
I ♥️ remote work
I ♥️ remote work. Oddly, woke up at 4am today. No biggie. Started work. Turns out it's a snow day ☃️, so kids are out of school. I'm using the time...
I put a React component in its own file when: ✅It's reusable by itself ✅It's...
I put a React component in its own file when: ✅It's reusable by itself ✅It's big, so it's helpful to be in its own file. Less scrolling. Easier to...
Wow, now that I understand state machines, I can't help but see them
Wow, now that I understand state machines, I can't help but see them. I'm looking at code from last week and going: "Ah! These 7 state variables ca...
Common testing mistake: Describing behavior without context
Common testing mistake: Describing behavior without context. Poor name: 👎 should show 'Edit' button Better name: 👍 should show 'Edit' button when...
I avoid nested destructuring, especially when declaring defaults
I avoid nested destructuring, especially when declaring defaults. It requires the reader to carefully group curly braces. Can you confidently and q...
You don’t need a library to create a UI that uses a state machine
You don’t need a library to create a UI that uses a state machine. Recipe: 1. Create a list of potential statuses (loading, saving, submitted, erro...
React tip: With boolean props, prefer a false default
React tip: With boolean props, prefer a false default. Example of hiding a legend, defaulted to visible: <Fieldset showLegend={false} /> 👎 &...
React features I avoid at first, then only refactor to when necessary:...
React features I avoid at first, then only refactor to when necessary: useReducer: Use when useState is insufficient (complex state) useMemo/memo:...
App without tests: 1
App without tests: 1. Developer thinks he’s done 2. Developer merges code 3. Days later, we find regressions. 👎 App with tests: 1. Developer think...
Why work remote
Why work remote? Focus Choose a schedule that works best for you Weave work around life Work where you’re most comfortable and inspired Take meetin...