Readings and musings, 1/22/2021

Overview

In my quest to find my writing voice, I’m experimenting with different formats. Walkthroughs, fiction, examples … and now, “here’s what I read this week”. A simple list of links and articles, with some thoughts and commentary on each. This may not work or last, but what the hell. It costs a small amount of my time, and it might provide something valuable to someone. Away we go!

Web Components Will Replace Your Frontend Framework

link

I’ve been learning about Svelte, and have dabbled in other modern frameworks like React and Vue. However, the core Javascript language continues to evolve. The recently added Web Components concept may eliminate the need for complicated frameworks in some situations.

Web Components allow you to introduce your own elements to the DOM. So in addition to built-in elements such as input and div, we could have something like:

Marty's Incredible Component

<MartysIncredibleComponent>
  <!-- Mind blowing things within -->
</MartysIncredibleComponent>

WebComponents provide many of the hooks and capabilities of modern reactive frameworks. I suspect, however, that attempting to recreate a React/Vue site using simple WebComponents would prove difficult, if not impossible. Regardless, it’s always good to keep up with new capabilities in a language. And there may be a time when you don’t want the bloat of a reactive framework, and Web Components can do the job alone.

Sapper

link

As I work through the Svelte tutorial, I’ve also been looking ahead to Sapper. Sapper introduces Server-Side Rendering for Svelte, as well as simple filesystem-based routing, code splitting, and offline support. In other words, this is basically the Svelte version of next.js. If you enjoy using Svelte, you should also learn Sapper.

Digging through their documentation and many online examples, it seems like the biggest use case is “create your own blog”. My impression is it’s mainly intended for static “brochure ware” sites, not so much for dynamic apps (eg, like an email client).

Node.js Server & Authentication Basics

link

This is a very well written tutorial. The author walks through setting up a simple REST server, with authentication and sessions. It utilizes node, express, passport, and other libraries.

I loved this tutorial because he explained every line of code (rather than glossing over details). He also patiently explains how to use cURL to test the endpoints and functionality. My experience with expressJS is minimal - I’ve really only seen it referenced in other examples, without much explanation. This article filled in some blanks, and I recommend it to anyone curious about expressJS.

Top 10 Javascript Frameworks for 2021

link

This article was fairly interesting to a newbie like myself. However, I noticed one of the 10 frameworks (request) had a glaring “DEPRECATED!” disclaimer on its github page. Upon further inspection (and the comments on the article), it appears several of the libraries he mentions have been scheduled for retirement. So while it was useful to learn about some debugging capabilities (eg chalk and debug), the article may not be accurately describing the current javascript landscape.

You win some, you lose some.

10 Interview Questions Every JavaScript Developer Should Know

link

I love articles like this. They help me confirm what I know, and identify the ideas and concepts I don’t know. This one even provides followup links to learn more about the concepts being discussed. I was happy to confirm that I can speak intelligently about most of the things here (async vs sync, functional programming, inheritance vs composition, etc). However, I found myself racking my brain to remember what prototypical inheritance actually was. I had to review a few articles to shore that up, including this one. I walked away with some education, and a few more TODOs to deepen my understanding in some areas. Time well spent.

Things You Should Never Do, Part I

link

I was in a meeting this week discussing a software rewrite, and someone mentioned this article as a warning AGAINST rewriting. I used to read Joel on Software quite a bit, he’s full of wisdom and entertaining prose. This article was no different, and offers a compelling argument against rewriting something from scratch. In fact, he calls rewriting from scratch the “single worst strategic mistake that any software company can make”.

The long and the short - legacy projects are so “hairy” and full of meandering code because they’re mature. They’ve had time to weather all bug fixing and production issues, and are “battle tested”. Pretty sobering stuff, and definitely worth reading.

Is your existing code base really, truly “unsalvageable”?

Increase Jekyll Build Speed

link

I use Jekyll for this site, and have noticed recently that its building really slowly. When my machine starts to slog, I usually wait too long, finally get frustrated, and start googling for answers. This article helped me find the answer.

It turns out I’ve got some node_modules folders in my site (I’m preparing to reference example projects to prove I’m learning this stuff!). In it’s default mode, Jekyll will watch and attempt to build anything in the folder hierarchy. And if you’ve ever looked into node_modules, you’ll know it’s endless and legion.

With some simple exclusions in my _config.yml file, my Jekyll build is back to being almost instantaneous. Score! This has reduced my frustration, and made it much easier to find glaring bugs in my writing.

We all win.

Conclusion

That’s it for this week, hopefully someone was able to glean a nugget of value from this post. Comments appreciated, hit me up on twitter if you have any feedback. Thanks!

Written on January 22, 2021