Recent Blog Posts by Ben Nadel
Working Code Podcast - Episode 147: Potluck
This week, we go around the table and talk about a variety of topics. I talk about Transactive Memory Systems Theory and how it might be applied in an engineering context. Carol—having moved into a new home and a new job—talks about the joys of starting something new in her life. Tim talks about the short-comings of a ticketing system; and, Goodhart's Law (which states: "when a measure becomes a target, it ceases to be a good measure"). And, Adam considers what his life would look like if he took on more of a leadership / force-multiplier role at work... read more →
Understanding The TrimWhitespace() Function In Lucee CFML
The other day, when I was looking into which whitespace characters are removed by trim(), I came across a Lucee CFML function that I hadn't seen before: trimWhitespace(). The Function doesn't have an in-depth description; and, looking at the Java code didn't immediately clarify the function's behavior. As such, I wanted to try it out for myself in order to see if the function might be useful to me in the future... read more →
Generating A Table Of Contents Using jSoup And ColdFusion
I'm authoring my Feature Flags Book using Markdown. Then, I'm converting the Markdown into HTML using Flexmark and ColdFusion. And, once I have the raw HTML, I'm using jSoup to augment the DOM for output. As part of this, I'm dynamically injecting a Table of Contents (ToC). In the book, I'm only including the h2 headings; but, it got me thinking about how I might use jSoup and ColdFusion to create a more inclusive table of contents... read more →
Transactive Memory Systems Theory And Engineering Team Mentality
On the most recent episode of The Hidden Brain podcast: The Secret to Great Teams, psychologist Anita Woolley discusses which characteristics consistently show up across high-performing teams. Of the topics included, the one that really grabbed my attention was that of "Transactive Memory Systems Theory". I had never heard this theory discussed in the context of teams; and, as they discussed it, I felt that it wasn't entirely aligned with how I see many engineering teams (including my own) attempting to work... read more →
Replacing RxJS With A State Machine In JavaScript
I have a lot of trouble working with reactive streams. It's just not how my brain works best. Give me a simple event-stream, and I can mostly hold that in my head. But, start to combine streams together, and my brain freezes up like a deer in headlights - my eyes darting from operator to operator, desperately trying to build-up a mental model of what is actually happening. As such, I recently removed RxJS from an application and replaced the reactive streams with state machines. It's definitely more code; but, I find it easier to reason about and maintain... read more →
Working Code Podcast - Episode 146: Resiliency Is Hard
The products that we build can become quite complex and involve many interconnected parts. Due to this complexity, and to the properties of the natural world, these products will begin to fail in new and exciting ways. There's really no way to stop a system from failing; but, we can build systems that are more resilient to failure. That said, this is oftentimes much more challenging than we expect. On today's show, we talk about the complex systems that we've built personally; and, how we attempt to keep them online in the face of uncertainty... read more →
Working Code Podcast - Episode 145: Shiny New Things
Adam, our early-adopter in residence, talks to Carol about Bun, Skeleton, and Svelte. With a focus on introducing new tools to an existing team, the two mainly talk about Bun, a hot new all-in-one JavaScript toolkit that is simultaneously a runtime, a server, a package manager, and a test runner. Come find out why its feature-set and speed leave Adam singing, My application don't want none unless you got Bun, hun!.. read more →
Which Whitespace Characters Does trim() Remove In ColdFusion
Yesterday, an external API call that I was making failed because one of the values that I was posting contained a trailing "Zero width space" character (\u200b). The value in question was being passed-through ColdFusion's native trim() function; which was clearly not removing this whitespace character. As such, it occurred to me that I didn't really know which characters are (and are not) handled by the trim() function. And so, I wanted to run a test... read more →
Using FileReadLine() With Seekable Files In ColdFusion
Last week, I started to explore seekable files in ColdFusion. A seekable file allows us to jump to an arbitrary offset within the file contents (which I believe can be done without having to read the entire file into memory). I've recently been dealing with consuming large text-files at work; and, I'm wondering if a seekable file might be something I can use to create a "resumable" consumption process. As such, I wanted to play around with using the fileReadLine() function in conjunction with seekable files in ColdFusion... read more →
Working Code Podcast - Episode 144: The Power Of One
In a perfect world, we always do our best. But, our capacity for "best" changes on a day-to-day basis (see The Four Agreements by Don Miguel Ruiz). On some days, doing our best means jumping out of bed and absolutely crushing the day! On other days, doing our best means that we rallied just to get out of bed. And, that's OK. When we're in the slog - when our "best" is degraded - it can be helpful to identify a single, small challenge for the day; a challenge that can be accomplish and celebrated. This technique is what Carol calls the "Power of One"... read more →
Coming Soon: Feature Flags - From Concept To Cultural Revolution
In my tenure as a co-founder and principal engineer at InVision, I went from never having heard of "Feature Flags" (aka "feature toggles" aka "feature switches"); to seeing them become widely adopted by our engineering team; to witnessing a complete cultural revolution in regard to how our company approached product development. For me, feature flags are as transformational as databases — they are as important as both logs and metrics. I cannot imagine creating another product without them... read more →
Using Labeled Loops In JavaScript
Earlier this week, I looked at using labeled loops in ColdFusion. Labeled loops allow you to break and continue an outer loop from within the context of an inner loop by explicitly naming your loop statements. I had never used this functionality in ColdFusion before; and, it turns out, the same functionality is available in JavaScript. As such, I wanted to try it out in the browser as well... read more →
Working Code Podcast - Episode 143: Moving On, Rewriting, And Replatforming
While change is inevitable, managing and adapting to change is always a challenge. Change represents the end of something we knew and - at least for some period - loved; and, ushers in the start of something completely unknown. On today's show, we explore the difficulties in "moving on" using several different contexts: Jobs, tech stacks, video games, API implementations, front-end frameworks, and more... read more →
Including CSS File Content Using CFInclude In ColdFusion
In my first pass at building Dig Deep Fitness - my ColdFusion fitness tracker - I'm using a traditional, multi-page application (MPA) approach. Which means, every navigation is a full-page refresh. This is slower than a single-page application (SPA). As such, in order to help decrease page load times - especially on first load - I'm rendering my temporary CSS directly in the page <head> tag. This way, the browser doesn't need to block-and-request the .css file in a separate HTTP request. And, to keep things super simple, I'm doing this with the CFInclude tag; which, in ColdFusion, can include any kind of text file... read more →
Using Labeled Loops In ColdFusion
The other day, I was watching a tutorial on the Svelte JavaScript framework and I saw that they used the $: notation to denote reactive values. I believe that this is just an old JavaScript feature for labeling parts of the code (which Svelte is then overloading). I've never used that JavaScript feature myself; but, it did remind me that some of this labeling concept is also available in ColdFusion as well, specifically for loops. I've never used this feature in ColdFusion either; so, I thought it might be worth a quick exploration... read more →
Using Seekable Read Files In ColdFusion
Yesterday, when I was looking at how to loop over a file using CFLoop, I came across an old post of mine in which Raymond Camden mentioned the fileSeek() function. In all my years of ColdFusion, I've never used fileSeek() - which allows us to jump to an arbitrary offset within a file. I believe that fileSeek() works with both readable and writable files; however, the documentation on this is unclear. For this post, I'm looking at using seekable read files in ColdFusion... read more →
Using CFLoop To Iterate Over A File Line-By-Line In ColdFusion
Yesterday, at work, I had to take a CSV (Comma-Separated Values) file with 4.7 million lines of data in it and break it up into smaller files that each had 25K lines of data. I don't do a lot of file I/O (Input, Output) at work, so I'm a bit rusty. I ended up using the fileOpen(), fileReadLine(), and fileClose() functions to imperatively iterate over the file without reading it fully into memory. It wasn't until after I was done that I remembered the CFLoop tag can actually do all of that for me declaratively in ColdFusion... read more →
Using Feature Flags To Hack Your Own Psychology
On a recent episode of the Hidden Brain podcast: You 2.0: How to Break Out of a Rut, they talked about the "goal gradient". This is the idea that at the start of a journey, you move quickly due to the excitement; then, you slow down for the long slog in the middle; and finally, towards the end - when the goal is in sight - you move quickly again with a renewed sense of purpose. Studies demonstrate that this is just as true for mental tasks as it is for physical tasks. And, as I was listening to the episode, it occurred to me that feature flags are a perfect way to hack your own psychology in order to remain maximally productive when building large features within a product... read more →
Working Code Podcast - Episode 142: Tangents All The Way Down
When Carol's not here to keep us in line, the show quickly flys off the rails. So much so, in fact, that we never made it to the intended topic - it's just tangents upon tangents upon tangents. We touch upon "vendoring" of our external libraries, installing dependencies with apt-get, dictation app differences between macOS and iOS, the regret of not building features sooner, building the perfect demo for clients, and the "trap" of having to innovate. And that's not even everything! Carol - we need you! You're our only hope!.. read more →
Wireframing For Everyone By Michael Angeles, Leon Barnard, And Billy Carlson
This morning, I finished reading one the latest "A Book Apart" releases: Wireframing For Everyone by Michael Angeles, Leon Barnard, and Billy Carlson. A quick read, the book explores the value-add of wireframes from the individual, team, and product perspectives; and, steps through the creative process from raw idea to formulation to engineering hand-off to deployed solution. I loved this book! It felt like coming home... read more →
Working Code Podcast - Episode 141: Building Stuff So You Can Build Stuff
Inspired by an article from Dimitri Glazkov: Build a thing to build the thing, we talk about the importance of consuming of our own products. Often referred to as "Dog Fooding", this means that we must try and build something in the same way that our customers would be expected to build something. And, in doing so, better identify the feature gaps and the points-of-friction. In order to best meet our customers where they are, we have to - in a sense - become our customers... read more →
Using Position: Sticky With Multi-Sided Anchoring In CSS
The other day, in Dig Deep Fitness, I created a user interface (UI) in which I had two side-by-side lists of radio-buttons. In an effort to keep the UI simple but effective, I attempted to make the :checked radio-button position:sticky. And, I ended up doing so using both top and bottom anchoring. Before that, I had assumed that a sticky element could only be anchored on one side. Turns out, a sticky element can be anchored on multiple sides at once in CSS... read more →
Working Code Podcast - Episode 140: Fraud, What Is It Good For?
If a property is exposed on the internet, people will try to take advantage of it. This might be in the form of sending spam through a communications portal, scamming cellular providers via SMS tolling, or using payment forms to validate stolen credit cards. And that's just to name a few possible attack vectors! It appears there's no hurdle too high nor process too tedious for the fraudsters to circumvent. On today's show, we share our own war stories about detecting, preventing, and dealing with the aftermath of fraud on our own web-facing applications... read more →
Error "Type" Isn't Always A String In Adobe ColdFusion
Yesterday, while working on Dig Deep Fitness, my ColdFusion fitness tracker, I accidentally consumed an ordered struct as if it were an array. As expected, ColdFusion threw an error; however, my centralized error handling logic broke because the type property of the thrown error was not a string, it was a complex Java object. I don't think I'd ever run into this issue before - I've always believed that the type, message, detail, and extendedInfo properties were guaranteed to be a string. I guess not... read more →
Sanity Check: Using Overflow Scrolling On CSS Flexbox Panels
I'm a huge fan of CSS Flexbox. As someone who had (?has?) to support IE11 up until the very end, CSS Flexbox became my go-to for complex layouts. However, even with years of Flexbox experience under my belt, I'm not always confident that I understand exactly how it will behave when it contains overflowing content. One scenario in which I've been using Flexbox recently is to create a dynamic set of "panels". Consider a set of side-by-side panels in which one panel is dynamically added or removed to and from the DOM (Document Object Model), respectively. Is it safe to apply overflow:auto to these CSS Flexbox panels?.. read more →
Working Code Podcast - Episode 139: New Tables vs New Columns
Early on in my career, my default behavior was to add new database columns to any existing table that felt "similar enough" in nature. After years of evolving an application, however, this has lead to relatively wide tables with only a loose sense of cohesion. More recently in my career, I've started to err on the side of creating new tables in order to house new columns. While this approach adds complexity in some ways, it also reduces complexity in other ways and creates a more clearly defined data model. Or, so I hope... read more →
My ColdFusion "Controller" Layer Is Just A Bunch Of Switch Statements And CFIncludes
The more experience I get, the more I appreciate using an appropriate amount of complexity when solving a problem. This is a big part of why I love ColdFusion so much: it allows one to easily scale-up in complexity if and when the requirements grow to warrant it. When I'm working on my own, I don't need a robust framework with all the bells-and-whistles. All I need is a simple dependency-injection strategy and a series of CFSwtich and CFInclude statements... read more →
Working Code Podcast - Episode 138: Ben Goes Streaking!
As I've been building-out Dig Deep Fitness, I've been wanting to include an "Activity Streak" indicator as a way for people to feel good about the consistent effort that they put into their workouts. "Streaks", however, are bucketed by "day"; and, said "day" is specific to the user's current timezone experience. Historically, I've stored all of my application dates in UTC time; but, I sense that this won't be appropriate for "Activity Streak" tracking. As such, I'm turning to my brilliant Working Code co-hosts for their sagely advice... read more →
Layla Porter On Modular Monolith Boundaries
Yesterday, I listened to episode 1,856 of the dotnet rocks podcast with guest Layla Porter, Developer Advocate at VMWare. The show discussed "Modular Monoliths"; and, was one of those exciting moments in which I learned that the mental model I've constructed about an idea is completely wrong. That is to say, a "modular monolith" is not at all what I thought it was... read more →
Auto-Saving Form Data In The Background Using The fetch() API
In Dig Deep Fitness, my ColdFusion fitness tracker, the main gesture of the app is the "Perform Exercise" view. In this view, the user is presented with a series of inputs for resistance weights, reps, and notes. Depending on how fast a user is moving through their workout, they may be on this one view for several minutes without submitting the form back to the ColdFusion server. This "pending data" makes me nervous. As such, I've started auto-saving the form data in the background using JavaScript's fetch() API... read more →