Showing 12 posts by,

Josh Johnston

A little while ago I had a magical moment. We were building a web application and the product team had decided to phase out a certain feature. This meant that one of the UI components we had built was no longer needed. From the beginning of the project we had put some thought into a modular architecture, and so all of the code for this component was nicely contained within a single directory. Now that it wasn't being used anywhere, we could safel [...]

Remember how Marty McFly traveled to the past and changed that one small thing, then when he came back to the future (ohhhhhhhh) his dad was all buff and cool, instead of the sniveling weakling we saw at the start? In the same way, CSS Modules has introduced one small change at the heart of css and now there is a new world of improvements to discover. This post is a continuation from last week’s introduction to CSS Modules where we will take a cl [...]

If you’ve ever worked on software that uses global variables you’ll know why they are avoided. And as a codebase becomes larger and more complex you’ll observe two things: first you will feel a growing desire to make these globals get away, and second you’ll find this an unexpectedly difficult task. The reason: ease of maintenance is very closely tied to how dependencies are structured in your code. Globals quickly lead to dependencies out of con [...]

It can be tricky to write software that produces the correct result. But we all know that this only marks the line where the real challenge begins. Finding a good way to model the solution can make the difference between something that “makes sense” and is a joy to work with, versus something that ends up wrapped in comments like this: // // Dear maintainer: // // Once you are done trying to 'optimize' this routine, // and have realized what a te [...]

Greetings adventurer! On our last trip we explored a popular nodejs library and discovered some interesting gems there. That was ~100 lines of code, but this time we’re going to attempt something a little more ambitious: React! Ever try finding your way around a huge codebase? It doesn’t take very long before the vertigo kicks in. When looking at something like React, what we see is the cumulative result of years of effort from hundreds of very b [...]