Learning from tutorials is great! You follow some steps, learn a smol lesson, and feel like you got this. Then you go into an interview, get a question from the boss, or encounter a new situation and o-oh.
Shit, how does this work again? 😅
That's the problem with tutorials. They're not how the world works. Real software is a mess. A best-effort pile of duct tape and chewing gum. You need deep understanding, not recipes.
The efficacy of TypeScript
TypeScript may streamline code navigation and catch semantic errors, but it doesn't guarantee fewer bugs or faster fixes.
TypeScript runtime vs types at run-time
Bun – first impressions
I've been using Bun in a few side-projects and I like it a lot
Update state during render, better explained
A few readers wrote in to say that the React Can Update State During Render email last week made no sense. Here's a better explanation.
React can update state during render
An unexpected feature of React: updating state during render. It's a UX and performance optimization
Over-engineering tweet embeds with web components for fun and privacy
People on twitter loved this trick I learned from a coworker's pull request the other day. You might like it too.
Promise.allSettled, a wonderful tool for resilient code
The pros and cons of different approaches to writing resilient code that handles partial failures
Immutability isn't free
Or how we took an API endpoint from 16s to 3s.
Using DynamoDB Streams with the Serverless Framework
DynamoDB Streams are a convenient way to react to changes in your database. And surprisingly easy to use 🥳
pg-mem and jest for smooth integration testing
The cult of TDD leads you down a dark and stormy path towards brittle code with a false sense of security. But there is a better way. A sweet spot between unit and heavy integration.
Why null checks are bad
Every null or undefined check doubles the number of tests you need 😱
Small choices can wreck your codebase
wanna see the strangest looping construct I've found in production code?
How to configure Jest with TypeScript
Using plain Jest on a TypeScript codebase is kinda rough. No types in tests no thanks. Making Jest and TypeScript work together smoothly is something you do just rarely enough to forget the details. Hope this helps you and future me too ✌️
Learn TypeScript in 5 minutes
Stop SHOUTING = 'shouting'
A hill I will die on 👉 global CONSTANT = 'constant' are bad
This blew my mind, thought you'd like it too. You can do more with ?. than you thought.
2 quick tips for 250% better Lighthouse scores – CodeWithSwiz 28
Your site may be fast for users, but Google don't care. Official metrics or bust.
A TypeScript trick for reusable hooks
Reusable hooks are all fun and games until TypeScript starts yelling at you about incompatible types.
Many engineers think server-side code is the scary domain of True Engineers. Something newbies, juniors, and frontend engineers shouldn't touch. They're wrong. Modern backend is a joy. ❤️
In 2020's, what is "frontend"? 🤨
"He's a frontend guy, is this even a fair question to ask?" The head of engineering was worried about our systems design question …
The Big Mac index and Jest fetch testing
The Big Mac index is a purchasing power parity index published by The Economist. Jest fetch testing is a tech task so frustrating that it almost made me quit the industry. I'm writing this so you don't have to read 8234721 different blog posts, stack overflow answers, and GitHub threads with conflicting info on how to get Jest and fetch to play together.
Just for fun 👉 React vs. jQuery vs. Svelte, same 🐱 app
I was bored Monday night and decided to see if I still know how to build with jQuery. Nothing better to do, no pressing ideas, a bit of fun. Also a favor for a friend who's preparing to talk about React to a bunch of people who've never seen it before 😛
You don't want to build your own list virtualization
Chatroom is slow? I know, I'll just use list virtualization! List virtualization is hard, dear reader. So, how do you virtualize a list?
How to add real web push notifications to your webapp
There's a joke in functional programming that once you understand monads, it becomes impossible to explain them to others. The nuance is nuanced, the details are hard, let’s focus on practice
I was doing code review for a coworker, and it soon became obvious that he used a linter and that the linter gave him a bright idea: _use strict comparisons_.
How many touch points does your sales process require? Do you need 2 ad clicks or 5? Two shiny demos or one fat video? As an engineer, you might not care, but this is the stuff that keeps your CEO and growth lead and head of product up at night. A business owner that can answer that 👆 question reliably is god.
How to waste hours of life with fetch() and a bit of brainfart
Both superagent and fetch() enable you to talk to a server. The first produces clean code that gets nesty if you need many things. The second produces clean code that is Promis-y and sometimes cumbersome. The difference between superagent and fetch() isn't that one sends your headers as-given and the other lowercases their names. The difference is that superagent sends a cookie and fetch() doesn't!
This is a puzzle you can run into if you’re not careful, and sometimes, despite your best efforts, even if you are careful. It happened to me when I had a settings object that I passed into a view. The view then did things. When I made a new view from the settings object, it looked like the view I had just cleared.
A day is not 60*60*24 seconds long
Days aren't 60*60*24 seconds long. They are 1 day long, which on most days maps to 60*60*24 = 86400 seconds. But not on all days.
Using returns and callbacks in the same function. Sounds like crazy talk I know, but hear me out, I have good reason. I think.