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.
I took a bet on JavaScript in 2005 when it was known as DHTML. It's been my favorite language ever since. These essays are the good stuff you can't learn from a tutorial.
Leave your email and get the JavaScript Essays series - a series of curated essays and experiments on modern JavaScript. Lessons and insights learned from practice building production software.
Curated JavaScript Essays
Get a series of curated essays on JavaScript. Lessons and insights from building software for production. No bullshit.
Latest JavaScript articles from Swizec
My biggest React App performance boost was a backend change
Performance lives in the unlikliest of places. Follow the metrics.
January 31st, 2023
Over-engineering tweet embeds with web components for fun and privacy
A way to embed tweets in static sites with full pre-renders and live updates using just 9kB of client-side JavaScript, 2 HTTP requests, and full reader privacy ✌️
October 26th, 2022
Quick tip about JavaScript's optional chaining operator
People on twitter loved this trick I learned from a coworker's pull request the other day. You might like it too.
April 22nd, 2022
Promise.allSettled, a wonderful tool for resilient code
The pros and cons of different approaches to writing resilient code that handles partial failures
April 4th, 2022
Immutability isn't free
Or how we took an API endpoint from 16s to 3s.
February 4th, 2022
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.
December 21st, 2021
Why null checks are bad
Every null or undefined check doubles the number of tests you need 😱
December 10th, 2021
Small choices can wreck your codebase
wanna see the strangest looping construct I've found in production code?
December 3rd, 2021
Finding unresolved promises in JavaScript
JavaScript is a fantastic server-side language because it's async. That also makes it tricky. 💩 What happens when you swallow errors? Forget to resolve promises? Or run into a number of other anti-patterns
November 3rd, 2021
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 ✌️
October 19th, 2021
Learn TypeScript in 5 minutes
TypeScript solves many of JavaScript's sharpest edges. You don't need much to get started ✌️
October 12th, 2021
Stop SHOUTING = 'shouting'
A hill I will die on 👉 global CONSTANT = 'constant' are bad
September 21st, 2021
A surprising feature of JavaScript optional chaining
This blew my mind, thought you'd like it too. You can do more with ?. than you thought.
June 24th, 2021
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.
April 27th, 2021
A TypeScript trick for reusable hooks
Reusable hooks are all fun and games until TypeScript starts yelling at you about incompatible types.
February 19th, 2021
Modern backend is a JavaScript function
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. ❤️
September 22nd, 2020
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 …
August 7th, 2020
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.
August 22nd, 2019
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 😛
May 24th, 2019
LOLCODE-to-JavaScript compiler babel macro
A fully functioning LOLCODE-to-JavaScript compiler implemented as a Babel macro. You never thought you wanted this and now here it is. You're welcome. 🐱
May 16th, 2019
Building an interactive DOM benchmark, preliminary results
February 27th, 2018
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?
February 1st, 2018
How to populate react-redux-form with dynamic default values
January 25th, 2018
How to add real web push notifications to your webapp
You've probably seen web notifications before. YouTube shows them when it goes to a new song, Facebook pings them when a new message comes in, scammy websites ask for permissions and you say no. The usual. You can fire those notifications from anywhere inside your JavaScript.
November 16th, 2017
JavaScript promises are just like monads and I can explain both in less than 2 minutes
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
September 21st, 2017
How JavaScript linters cause bugs
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_.
September 14th, 2017
Counting web sessions with JavaScript
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.
May 11th, 2017
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!
November 1st, 2016
Livecoding #23: Slackbots and OAuth
September 26th, 2016
A puzzle in JavaScript objects
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.
September 9th, 2016
Livecoding #15: Reaching the limits of canvas redraw speed
July 20th, 2016
Animating with React, Redux, and d3
March 11th, 2016
Don't Worry; It's a Compiler Bug
December 29th, 2015
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.
November 18th, 2015
There's a "bug" in ES6 modules
November 2nd, 2015
React+Flux can do in just 137 lines what jQuery can do in 10
October 16th, 2015
React components as jQuery plugins
August 7th, 2015
Webpack lazy loading on Rails with CDN support
June 4th, 2015
How to wait for DOM elements to show up in modern browsers
March 26th, 2015
How to run JavaScript tests in Chrome on Travis
January 27th, 2015
Javascript debugging [slightly] beyond console.log
My favourite tool for javascript debugging is `console.log`. I mean, I love `console.log`. If I ever get a programming tattoo, it's going to be `console.log` or some variation thereof. Simple to use, works every time, and every programming language I've used since I was 9 has had some variation of it.
January 14th, 2015
Kids, always remember to clear your intervals
November 5th, 2014
My new favourite Javascript trick
Using returns and callbacks in the same function. Sounds like crazy talk I know, but hear me out, I have good reason. I think.
June 26th, 2014
Mixing mixpanel into backbone
January 24th, 2014
About achieving polymorphism in Javascript
October 15th, 2013
Are map, reduce, and filter turing complete?
September 17th, 2013
Writing modular Backbone with Backbone.SubRoute
July 31st, 2013
Dynamic languages have jumped the shark
May 31st, 2013
Videos from first Javascript meetup in Ljubljana
May 3rd, 2013
Sexy animated spirographs in 35 sloc of d3.js
March 7th, 2013
My very own daily WTF
January 10th, 2013
Elegantly using socket.io in backbone apps
December 14th, 2012
Testing socket.io apps
November 30th, 2012
Cool thing Thursday: alertify.js
November 29th, 2012
Game development in Webgl
November 19th, 2012
Experienced developers can't solve this problem
November 2nd, 2012
Cool thing Thursday: Ceylon
September 27th, 2012
Cool thing thursday: in-browser 3D modeling with live preview
September 20th, 2012
Blackbox testing node.js apps
July 23rd, 2012
Why I will always suck at programming [Grega Stritar]
July 19th, 2012
Flotr2 - my favorite javascript graph library
June 1st, 2012
Using Backbone to improve multiselects
April 13th, 2012
Tracking RSS readers with Google Analytics
April 6th, 2012
The exciting future Javascript
April 2nd, 2012
My language is better than yours
March 30th, 2012
Closure and currying magic for cleaner javascript
March 14th, 2012
Webdevs, you have no idea how much you know
March 12th, 2012
The commonest javascript bug
February 24th, 2012
Heroku, mongo, node.js - a problem
January 30th, 2012
Appcelerator Titanium might've made it to my toolbox
January 23rd, 2012
Learning me a Haskell
December 23rd, 2011
A lesson about client-side templating
December 19th, 2011
Javascript's lack of strftime
December 12th, 2011
Fun javascript feature
December 7th, 2011
Parsing JavaScript with JavaScript
November 11th, 2011
Firefox's "funny" css3 image scaling quirk
October 17th, 2011
Functional isn't always better
October 7th, 2011
So how many readers _actually_ read a blog post?
September 16th, 2011
I learned two things today 11.8.
August 11th, 2011
node-unshortener can unshort any url
May 21st, 2011
A cool JavaScript property you never noticed
A few years ago I was playing around with JavaScript trying to find the cleanest way to implement callbacks in functions. Primarily I wanted a readable way to make certain the last argument passed is a callback, withut having to rely on knowing how many arguments there are and so on. Instead I stumbled upon a pretty cool feature of how javascript handles function arguments.
April 16th, 2011
Hard work is a total waste of time
September 22nd, 2010
jQuery imageless buttons a la Google get an update
July 12th, 2009
Slovenia php conference day2 (live blogging)
June 6th, 2009
Adobe AIR's javascript no eval or include is moronic
March 25th, 2009