I’ve been writing a lot about AI. I’ve gotten some interesting responses, ranging from… THANK YOU! I feel seen! To… You’re completely fucking wrong you dinosaur. The most interesting responses continue to come from people who literally hate writing code. Mostly because I’m surprised they read my stuff at all, to be honest! One of those conversations was with someone who self-identified as “an entrepreneur.” As they describe it, AI let’s them churn out their ideas in large nu...| gomakethings.com
If you’re a craftsperson who sells the output of your craft, there’s a constant tension between building things well and building things faster/cheaper. If you work for a product or software company, there’s pressure to add more features in less time, and reduce the cost of doing so. If you build things for others, there’s pressure to deliver more for less. In a perfect world, everything you build would be a masterpiece of your craft.| gomakethings.com
Chris Ferdinandi is a web developer with ADHD, helping people build the web better.| gomakethings.com
I’ve worked on so many projects recently that were more complicated than they needed to be because they used JavaScript to generate HTML. JavaScript is… Slower to load Slower to run More prone to breaking Harder to read and reason about Doesn’t actually look like the final output It’s inferior to just using HTML in nearly every way. I’m not saying never use JavaScript, though. I think JS is great at augmenting and enhancing what’s already there, and adding interactivity that canno...| gomakethings.com
I often run into two very different types of coders in my travels as a front end consultant. Over-abstracted. Everything that could possibly be reused or repeated at some point in the future is pulled out into its own small, single-purpose JS function or CSS class… whether it’s used more than once or not. Unabstracted. Everything that’s used more than once is copy-paste-edited, resulting in a lot of duplicate code.| gomakethings.com
This week, I had a conversation on Mastodon with Kyle Leaders and Jake Lazaroff about reactivity and DOM diffing in Web Components… I have to say I’ve been actually enjoying working with #webcomponents in #vanillajs lately. I haven’t attempted anything too complicated, but I love the idea of reusable components. Next up, I need to figure out how to best do reactive updates. This is one area where the native web platform falls a bit short.| gomakethings.com
The other day, we looked at the JavaScript Constructor Pattern, and how you can use it to create JS libraries. Today, I wanted to look at the JavaScript Class Pattern: what it is, how it’s different, and how to use it. This article is excerpt from my completely updated Writing JS Libraries course and ebook. Let’s dig in! (If you didn’t read the constructor pattern article, you should do that first.| gomakethings.com
If you grew up playing video games in the 80’s, you may remember the Konami Code, a cheat code you could enter on many of the video games made by Konami. The Konami Code is Up Up Down Down Left Right Left Right B A. Entering it at, for example, the start of Teenage Mutant Ninja Turtles would unlock Very Hard Mode. Entering it at the start of Contra would give you 30 lives.| gomakethings.com
Today, I wanted to talk about the “right” way to load web components to ensure they work predictably every time. Let’s dig in! The challenge Web components are self instantiating. Let’s imagine you’re creating a table of contents. When you use a traditional JavaScript library, you explicitly instantiate the library on a specific element. const myTOC = new TableOfContents('#toc'); But with web components, all you need to do is include the custom element associated with the component.| gomakethings.com
… doesn’t exit. I can’t find the post anymore, but a month or three ago, Miriam Eric Susanne posted something about how we keep building extremely problematic tools with the promise that we’ll work out all of the bad stuff at some imagined point down the road. Sure, it uses 8x as much water to do the same thing. But look how cool it is! We’ll figure that before we launch.| gomakethings.com
For years, a trend in our industry has been to build single-page apps, or SPAs. With an SPA, the entire site or app lives in a single HTML file. After the initial load, everything about the app is handled with JavaScript. This is, in theory, supposed to result in web apps that feel as fast and snappy as native apps. Today, I want to explore why that’s nonsense. Let’s dig in!| gomakethings.com
Yesterday, we talked about why Web Components won’t replace React or Vue. Today, let’s look at how to create your first Web Component. Let’s dig in! A really basic example Let’s kick things off with the most generic and overused of examples: a counter button. When the user clicks the button, we want to update it to to display the number of times it’s been clicked.| gomakethings.com
Over the weekend, I sent an email to my newsletter subscribers asking them what kinds of things they’d like to learn about Web Components. One of the most common questions I got back was some variation of… Will Web Components replace JS libraries like React and Vue? Personally, I don’t think so. Let’s dig in! Web Components are a different kind of component To me, one of the reasons why Web Components have taken so long to catch on is that they were originally described as “a browse...| gomakethings.com
I’ve worked with Web Components a little bit over the last few, but really struggled to understand the use case for them. Until this week. Between Jeremy Keith’s article on HTML Web Components, plus using one for a client project with NASA, something just clicked in my brain finally. I’m now convinced that they’re the best way to author DOM manipulation libraries. Over the last few days, I converted half a dozen old JS libraries of mine to Web Components.| gomakethings.com
Yesterday, I wrote about how SPAs were a mistake. Today, I want to talk about how you can build multi-page apps (or, you know, regular websites) that are as fast as SPAs. Let’s dig in! A quick summary The sites and apps I build are absurdly fast. They load nearly instantly. Even on spotty 3G connections on the other side of the world, where many of my students live, things still load really quickly (like, 3 seconds or less fast).| gomakethings.com
Last week, Jeremy Keith wrote about what he calls HTML Web Components. Some people treat Web Components like JS library components, where everything is rendered with JavaScript. But Jeremy has a different suggestion… Try not to bring React’s mindset with you… Think about composibility with existing materials. Do you really need to invent an entirely new component from scratch? Or can you use HTML up until it reaches its limit and then enhance the markup?| gomakethings.com