Blog
Posts on software development, careers, and craft.
Wow, these GitHub Copilot stats are pretty compelling
Wow, these GitHub Copilot stats are pretty compelling. In a study of 95 devs, those using Copilot finished in 55% less time. Full study: https://sn...
When I work in dynamic languages, I feel more stressed
When I work in dynamic languages, I feel more stressed. Why? Because I have to remember the data types and object shapes used by every function. Th...
Tech moves fast
Tech moves fast. Here's how I organize what I learn. 1. I store checklists, links, and notes in GitHub issues: https://github.com/coryhouse/reactjs...
The larger the dev team, the more important it is to have: ✅ Static types ✅...
The larger the dev team, the more important it is to have: ✅ Static types ✅ Automated tests and linting ✅ Automated code formatting ✅ Clear definit...
Zod question: How do you keep Zod and TypeScript in sync
Zod question: How do you keep Zod and TypeScript in sync? 2 options: 1. Derive TS types from your Zod schemas (via infer) 2. Generate Zod schemas f...
I just did the Zod tutorial by @mattpocockuk Wow, this is so well done
I just did the Zod tutorial by @mattpocockuk Wow, this is so well done! Such a slick way to learn Zod basics. 👍 https://www.totaltypescript.com/tu...
In TypeScript, "any" is occasionally necessary when building reusable libraries
In TypeScript, "any" is occasionally necessary when building reusable libraries. But in app code, "any" is rarely necessary. I'm reviewing an app t...
I work with around 25 companies every year
I work with around 25 companies every year. Three years ago, 90% of my clients used plain JavaScript. Today, 90% of my clients use TypeScript. The...
Situation: You have a big list of icons or images
Situation: You have a big list of icons or images. You want to dynamically display a few without importing them all. Solution: Create a lazy loadin...
I hoped Web Components would take off
I hoped Web Components would take off. (I even wrote a course on them). They didn’t. Why? Because frameworks frequently innovate and improve. Stand...
Prefer async/await over promises or callbacks
Prefer async/await over promises or callbacks. ✅ Reads top down ✅ Typically more concise ✅ The func signature clearly says "I return a promise" (si...
Tech I’ve learned in 2022: 1
Tech I’ve learned in 2022: 1. React 18 2. Next.js 12 3. Advanced TypeScript 4. trpc 5. pnpm 6. Turborepo 7. Cypress component testing 8. Playwright...
Four TypesScript code smells: 1
Four TypesScript code smells: 1. Using “any” 2. Using “as” 3. Not validating HTTP responses (via tools like Zod) 4. Setting “strict” to false Why?...
I ❤️ React
I ❤️ React. But, it’s not perfect. There are features you should avoid. Here’s “React: The Bad Parts” 👇
I ❤️ GitHub actions
I ❤️ GitHub actions. I just set up a GitHub action that runs Cypress on each PR, and blocks merges until it passes. Setup time required: 3 minutes,...
What 20’s me wanted: Stuff
What 20’s me wanted: Stuff. Nicer car Nicer clothes Nicer home What 40’s me wants: Freedom. Work when I want, where I want, on what I want, with wh...
Years ago, I was a senior developer
Years ago, I was a senior developer. I was promoted to manager of development. Result? I was a lousy manager. In retrospect, I can see clearly why...
How I learned #TypeScript: 1
How I learned #TypeScript: 1. I read the docs. 2. @basarat book: https://basarat.gitbook.io/typescript/ 3. @swyx React cheat sheet: https://react-t...
Really impressed with React Router 6.4
Really impressed with React Router 6.4. Composing data and actions with routes makes so much sense. Happy that we can enjoy this pattern outside of...
My take on global state in React: 1
My take on global state in React: 1. Use react-query for remote state (HTTP calls). 2. Use context for low frequency updates. If I have other globa...
Tired of writing JavaScript sort functions from scratch
Tired of writing JavaScript sort functions from scratch? (I always Google it). Here’s a package for writing concise sort functions in a clear, decl...
TypeScript tip: Consider generating types
TypeScript tip: Consider generating types. Example: I have a component library with 100 components. I want a union type that contains all the compo...
In TypeScript, you can create a custom function to check an object's type
In TypeScript, you can create a custom function to check an object's type. This is called a "User Defined Type Guard" The function returns true if...
Reusable component design tip: Extend the native root element's type, and...
Reusable component design tip: Extend the native root element's type, and pass native props to the root element via rest syntax. Benefits: 1. Your...
Just learned about localforage - An npm package that makes it easy to store...
Just learned about localforage - An npm package that makes it easy to store data in IndexDB, using a slick, localStorage like API. Supports 3 APIs:...
Reusable component design tip: Make impossible states impossible
Reusable component design tip: Make impossible states impossible. 4 ways to make the impossible, impossible: 1. Use TypeScript. 2. Declare union ty...
Reusable component design tip: Honor the native HTML element's API
Reusable component design tip: Honor the native HTML element's API. If it accepts children, your reusable component probably should too. If it acce...
13 Reasons Software Development is a Unique, Amazing Career
1. Creative freedom. Product managers and designers specify *what* I should build. But, I get to decide *how* to build it. I choose my patterns, libraries, tech…
Sometimes, it's handy to render specific content in @nextjs on the server or...
Sometimes, it's handy to render specific content in @nextjs on the server or the client. Here's a slick, declarative way to do so via a component....
The React ecosystem: Dozens of state management libraries Dozens of mature...
The React ecosystem: Dozens of state management libraries Dozens of mature component libraries Multiple routing libraries Many mature frameworks Na...