Blog
Posts on software development, careers, and craft.
13 ways to be a lousy developer: - Don't volunteer to help others
13 ways to be a lousy developer: - Don't volunteer to help others. - Don’t try to get better or learn. - Don't test code before opening a PR. - Rub...
Common software dev mistakes are at the extremes: 1
Common software dev mistakes are at the extremes: 1. Under-engineering 2. Over-engineering Under-engineering: No CI No reviews Weak types Hard codi...
Tip: Store sharable state in the URL
Tip: Store sharable state in the URL. Examples: Filter Sort Search Page number Toggles Record IDs Why put these things in the URL? ✅I can share the...
On some teams, writing good code feels like swimming upstream
On some teams, writing good code feels like swimming upstream. I've joined teams with: No CI No types No linting Lax code reviews No automated test...
Problem: Your page has many DOM elements, and you want it to render faster
Problem: Your page has many DOM elements, and you want it to render faster. Solution: Use CSS content-visibility to avoid painting off-screen items...
How many records can you sort/filter/paginate in a web browser
How many records can you sort/filter/paginate in a web browser? I've successfully implemented client-side sort/filter/paginate with around 2,000 re...
Using Cypress, but wanna try Playwright
Using Cypress, but wanna try Playwright? Here's a new handy REPL for converting Cypress tests to Playwright. 1. Paste your existing Cypress test on...
5 types of tests: 1
5 types of tests: 1. Unit: Test 1 thing, alone 2. Integration: Test a few things, together 3. End-to-end (e2e): Test that everything works together...
A unit test shouldn’t: 🚫 Call a DB 🚫 Run a browser 🚫 Make an HTTP call 🚫...
A unit test shouldn’t: 🚫 Call a DB 🚫 Run a browser 🚫 Make an HTTP call 🚫 Rely on stuff on other machines A unit test should pass without a netw...
Writing code involves countless architectural decisions
Writing code involves countless architectural decisions. Architecture is a given. Good architecture is not. So, the real question is: Are devs maki...
Tip: npm scripts can reference env vars as variables: "start": "node...
Tip: npm scripts can reference env vars as variables: "start": "node ./hello.js $PORT" The $PORT above reads the PORT env variable. You can pass en...
Wow, just asked ChatGPT to convert some old Enzyme tests to use @TestingLib...
Wow, just asked ChatGPT to convert some old Enzyme tests to use @TestingLib instead. It did an impressive job! Just a few minor tweaks were needed!...
A sad irony: Some software projects fail simply because the team tried to...
A sad irony: Some software projects fail simply because the team tried to move too fast. They didn't stop to ask: "Should we slow down and create a...
Console noise is a problem
Console noise is a problem. Examples: ESLint warnings and errors Dependency warnings Security warnings Console logs in the browser Automated test w...
Problem: Changing code temporarily to support local development
Problem: Changing code temporarily to support local development. The risk: Accidentally committing the change. Solution: Read an environment variab...
Claim: “React Server Components (RSC) are just PHP”
Claim: “React Server Components (RSC) are just PHP”. Reality: RSC is special because it finally means we can use the *same tech* to render componen...
⚛️ 10 ways to fetch data in React: Next 13: React server component Next 12:...
⚛️ 10 ways to fetch data in React: Next 13: React server component Next 12: getServerSideProps, getStaticProps Remix / React Router / React locatio...
What’s a big pain point for you as a React developer
What’s a big pain point for you as a React developer? What do you wish was easier, faster, more powerful, or more reliable? #react
Prefer SPA: Internal app Behind a login Flakey internet Heavily interactive...
Prefer SPA: Internal app Behind a login Flakey internet Heavily interactive Favor faster subsequent page loads Have BFF/GraphQL/dedicated APIs Pref...
Server-rendering React is becoming popular
Server-rendering React is becoming popular. Why? Performance. Server-side rendering is faster because: 1. Fetches start earlier 2. Fetches run in p...
Okay, @ApiMocking has become a fundamental part of my dev and testing workflow
Okay, @ApiMocking has become a fundamental part of my dev and testing workflow. I don’t worry about endpoints or DBs being down or slow. I don’t wo...
JavaScript tip: You might not need an if statement or a ternary
JavaScript tip: You might not need an if statement or a ternary. JS has Nullish coalescing assignment. Example: user.age ??= 'unknown age'; More: h...
Problem: Using an open source component library often leads to bloat and...
Problem: Using an open source component library often leads to bloat and inconsistency. Why? Because each app has opinions. Each app needs to use t...
I thought I knew Flexbox well, but I learned a few new tricks in this...
I thought I knew Flexbox well, but I learned a few new tricks in this excellent post by @JoshWComeau. The interactive demos are fantastic. https://...
1992: Get answers in books 2002: Get answers on forums 2012: Get answers on...
1992: Get answers in books 2002: Get answers on forums 2012: Get answers on StackOverflow 2022: Get answers from AI We’re finding answers faster. �...
Problem: package.json doesn’t support comments
Problem: package.json doesn’t support comments. Solution: Create a key that starts with // and ends with the target key. Put the comment in the val...
Coding in 2002: The more effective you are at written communication, the...
Coding in 2002: The more effective you are at written communication, the more effective you are as a developer. Coding in 2022: Same. AI doesn't ch...
Modern JavaScript has over 50 operators
Modern JavaScript has over 50 operators. 🤯 + += = & &= |= ^ ^= , -- / /= == ** **= > >= () ++ != << <<= < <= &...
Just learned JavaScript has logical OR assignment and logical AND assignment
Just learned JavaScript has logical OR assignment and logical AND assignment! 🔥 Logical AND assignment: x &&= "x is truthy" // assigns if...
This resonates
This resonates. For me, writing software feels like creating art. It's a creative process. The act puts me in a state of flow. It's naturally rewar...