The task I am working on this week involves generating downloadable PDF files for customer and supplier orders. We’d like to drive the implementation using tests and be able to find any regressions in the code automatically. After looking at different alternatives for accomplishing this, we decided to try a visual snapshot approach similar to […]
I recently needed to find and fix a bug in a web app I’ve been working on. The bug had something to do with code that was updating the dimensions of a third-party generated UI component whenever the window was resized. While troubleshooting the issue, I repeatedly used a handful of the tools provided by […]
Reasoning about a program’s behavior is extremely tricky in the best of circumstances. When you throw in asynchronicity, it is the absolute worst. It’s like your code is trapped in a convoluted time travel movie. You want to perform some operation, but that requires stepping into a time portal and coming out at some indeterminate […]
Recently, I was interested in creating a Google Chrome extension that would work similarly to a password manager, such as LastPass, to monitor the data in form submissions. Working on this task is actually what led to my last blog post, a lighthearted take on my mental stages of programming.
As I continued to build out my AngularJS + Google Sheets prototype, I ran into another problem. I wanted to load the data from two Google Sheets and access the data in the same function. I created this example, which loads in one Sheet with weather forecasts and another with weather types and descriptions, as […]
The decorator pattern gained fame in the object-oriented world after being featured in the classic 1994 Gang of Four book, Design Patterns. Since then, it’s been used extensively in traditional object-oriented programming as an alternative to inheritance. What’s really going on behind the scenes though, is composition, which means decorators are also great for cleaning […]
When using Node.js, you should never mix promises and callbacks. It’s a recipe for confusion. The problem is pretty obvious in hindsight, but it sure threw me for a loop the first time I ran into it.