What I Learned This Week 2
I made it to the second edition of “What I Learned This Week”. Fantastic. Let’s get on with it.
eXtreme Programming Explained #
I finished reading eXtreme Programming Explained (Second Edition) by Kent Beck. I told a friend I felt guilt for not having read it yet. I even felt guilt, avoiding revealing to myself I was an XP impostor. Once I started reading it, I realized I felt more welcomed by the book than I expected. I also felt relieved it was more brief than I expected! Somehow I conflated it being a classic with it being a tome.
I strongly recommend the book if your work involves producing software.
I actually didn’t learn much new. I had already experienced this way of working in my career and was familiar with the practices and principles, thanks to several progressive managers and leaders earlier in my career. That’s actually reassuring, and I now feel okay saying I’m an XP practitioner (by preference)! I gained a deeper appreciation for my knowledge and experiences, though, especially learning the values underpinning XP And I always like coming back to the fundamentals.
This said, I wonder if reading the book will help or harm me. Very, very few organizations have adopted XP. (Nat Bennett wrote an article on why so few organizations practice XP, which I also recommend.) I have become less patient with organizations that stick to less effective ways of producing software and this book feeds my frustration. It adds wistfulness for a world where we could have had this, but alas, we do not. “Now, get back into the feature factory, you code monkey!”
More TypeScript project setup #
open-source-stack template for TypeScript projects #
I saw Alem Tuzlak published a video on creating and publishing a TypeScript project in 2024 using a template he and his team at Forge 42 created. I saw the video shortly after publishing last week’s post, where I shared my research on the same topic. I like the template Forge 42 have provided and have restarted my project using it.
In particular, I like how it provides test applications for the library. I hadn’t considered this technique, but it fits my library’s intended use in Remix applications. The test app shows users how to use the library in their own applications. I like self-documenting code, and this fits the bill.
npm workspaces #
The open-source-stack template uses npm workspaces. I had seen workspaces in several open source projects, such as Remix, but hadn’t used them myself. I actually thought they were a feature exclusive to pnpm, so I felt surprised to see them in an npm project.
I probably spent two days off-and-on trying to understand how they worked in this setup, where the root level project is a library, but also listed as a workspace, along with the test applications.
It’s clever, and I’m not sure I understand it fully yet.
For example, it seems like it ought to cause some circular dependencies with all the projects getting linked into node_modules
, and yet it still seems to work.
In other languages like Python, developers can easily run headfirst into circular dependencies, and that prevents the code from running.
Also typically the root level project is there to gather packages in its subdirectories—known as the root project. The Remix monorepo gives a good example of this. In the structure of open-source-stack template, the root project is, itself, a workspace/package, and in fact, is the only package intended to be published. So I’m not yet clear on whether its workspace nature precedence over the root project nature, but this is my current understanding. Like the circular dependencies matter, it seems like it might not work, but it does, and that’s a surprise and a relief.
HTTP Cookies #
I hadn’t yet worked with HTTP cookies. Yes—like, at all—in nearly two decades of software development. Let this be another reminder to me and everyone else that the field of software development is vast and deep.
Once again, MDN provides a great resource on HTTP cookies.
Cross-references in Hugo #
I wanted to refer to last week’s post, and I wanted to do it in a robust way. Sure enough, Hugo has cross references, so today I got to use those. Well done, Hugo team.