Skip to main content
Ben Nadel at Scotch On The Rocks (SOTR) 2011 (Edinburgh) with: Heiko Wagner
Ben Nadel at Scotch On The Rocks (SOTR) 2011 (Edinburgh) with: Heiko Wagner

Recent Blog Posts by Ben Nadel

Working Code Podcast - Episode 112: Listener Questions

By Ben Nadel on
Tags: Podcast

This week, we reach into our bag of Listener Questions and pontificate on such curiosities as: Who would we want to be and what skills would we want to learn if we could step into an alternate reality? Would Danny DeVito make an intriguing Wolverine? Which are the best programming-related movies and shows? And, we all laugh a little nervously as Tim shares just how much time he's clearly spent figuring out how to get rid of a dead body... read more →

A Simple Slide Show Using Hotwire And Lucee CFML

By Ben Nadel on

Now that I have my ColdFusion and Hotwire playground up and running, I can start to explore the features of the Hotwire framework. And, one of the most attractive features is the ability to update a portion of the page using a full-page render. This works by scoping DOM (Document Object Model) changes to a given <turbo-frame> element. To see this in action, I wanted to create a simple slide show using Lucee CFML... read more →

OnRequestStart() / OnRequest() Methods Invoked Even If Requested Template Doesn't Exist In Lucee CFML

By Ben Nadel on
Tags: ColdFusion

While setting up my ColdFusion and Hotwire Demos project, I stumbled upon an application behavior that is unique to Lucee CFML (as opposed to Adobe ColdFusion). Historically, with ColdFusion, attempting to request a .cfm file that doesn't exist would result in a "Missing Template" error; or, if defined, would trigger the onMissingTemplate() event handler. This was true regardless of the method defined in your Application.cfc framework component. In Lucee CFML, however, it seems that the onRequestStart() and onRequest() life-cycle method will be invoked even if the requested template doesn't exist. Which is awesome!.. read more →

Setting Up My ColdFusion + Hotwire Demos Playground

By Ben Nadel on

A month ago, I started building a ColdFusion and Hotwire application as a learning experience. Only, once I finished the basic ColdFusion CRUD (Create, Read, Update, Delete) features, I didn't really know how to go about applying the Hotwire functionality. I realized that I bit off more than I could chew; and, I needed to go back and start learning some of the Hotwire basics before I could build an app using the "Hotwire way". As such, I've started a new ColdFusion and Hotwire Demos project, where I intended to explore stand-alone aspects of the Hotwire framework... read more →

Working Code Podcast - Episode 111: How To Learn Stuff Good

By Ben Nadel on
Tags: Podcast

Learning something new - whether it be a language, framework, or library - can be challenging. And, if you're already an expert in some ways, it can be both humbling and frustrating to suddenly feel like a novice. On top of that, our expectations are often distorted by time; and, we forget how long it took us to amass the understanding that we have today. This can lead to unrealistic expectations when it comes to learning new things. Not to mention that our strategies for learning might change in relation to our experience. On today's show, we share our respective approaches to learning from the ground up, including reading the manual, building applications from scratch, and everything in between... read more →

Does The Order Of Hash Inputs Matter In Terms Of Uniqueness And Distribution?

By Ben Nadel on
Tags: ColdFusion

My initial implementation of the CUID2 algorithm for ColdFusion tried to stay as close as possible to the JavaScript version. As part of this algorithm, I hash together various sources of entropy in order to create a unique, collision-resistant value. Once I completed my initial implementation, I got to thinking: since the goal isn't to create a specific value but rather a random, unique value, does the order of the inputs to the hash actually have any bearing on the characteristics of the output? In other words, does the order of hash inputs make the hash more unique? Or, give it a more even distribution in a given space?.. read more →

Comparing Java's MessageDigest To ColdFusion's hash() Function In Lucee CFML

By Ben Nadel on
Tags: ColdFusion

Last week, I implemented a ColdFusion port of the CUID2 library. My version seems to work correctly; however, it has some performance problems when compared to the Java version. When I instrumented the ColdFusion component methods, nothing really jumped out at me. But, I have a hunch that I could make the SHA hashing more performant. Only, I don't have a great mental model for hashing. As such, I wanted to perform a small comparison of Java's MessageDigest class with ColdFusion's native hash() function for hashing a compound input... read more →

Using "continue" To Short-Circuit .each() Iteration In ColdFusion

By Ben Nadel on
Tags: ColdFusion

CAUTION: This is likely a bug in the CFML language; but, it's kind of neat in that it expresses loop iteration intent slightly differently... read more →

Working Code Podcast - Episode 110: Measuring Impact At Work

By Ben Nadel on
Tags: Podcast

Not all days are created equal. Some days, you show up and just crush it non-stop. Other days, it can feel challenging to even type good. On today's show, we look at what goes into making those good days "good" and those bad days "bad". Getting into the zone, meetings, switching modes, interfacing with customers, responding to incidents (and other interruptions)—every little thing has the power to push the needle one way or the other... read more →

Dynamically Instrumenting ColdFusion Component Methods With GetTickCount() To Locate Performance Bottlenecks

By Ben Nadel on
Tags: ColdFusion

ColdFusion is a highly dynamic language. Which means, we can perform all manner of runtime mutations and reflections on our data structures and components. In fact, I've talked about this concept many times before, from applying StatsD metrics to creating tracked transactions in FusionReactor to adding retry logic around database access calls. All of these approaches use a variation on the same theme: generating proxy methods that add logic around lower-level component method execution. And today, in an effort to identify the performance bottlenecks in my CUID2 for ColdFusion implementation, I'm doing it again!.. read more →

Overriding Form Submission Properties Using Button Attributes In Native HTML

By Ben Nadel on
Tags: HTML / CSS

For the last few weeks, I've been [very slowly] looking into the Hotwire framework from Basecamp. One of the guiding principles of Hotwire seems to be, "HTML has a bunch of great stuff, let's use it!" Case in point, I was reading through a Thoughtbot article on rendering live previews by Sean Doyle when I saw something that I had never seen before: submit buttons with form "action" and "method" attributes. Apparently, this has been supported by browsers going back to IE 10; but, since I've never seen it before, I wanted to try it out for myself in ColdFusion... read more →

CUID2 For ColdFusion / CFML

By Ben Nadel on
Tags: ColdFusion

A couple of years ago, I built a ColdFusion port of the CUID library which we've been using successfully at InVision. The CUID library provides collision-resistant IDs that are optimized for horizontal scaling and performance. Just recently, however, Eric Elliott released Cuid2 - an updated version of the library intended to address some philosophical security issues. I wanted to create a ColdFusion port of his new Cuid2 library... read more →

Testing Performance Overhead Of Creating Java Classes In Lucee CFML

By Ben Nadel on
Tags: ColdFusion

UPDATE (2023-01-13): Please see the comments thread at the bottom. It seems there are definitely cases in which createObject() calls can become slow, having to do with where the JAR files are being loaded and what settings you are using in your application. The moral of the story is test test test your particular use-case, I suppose (though that feels like a very non-satisfactory answer given how generic the idea of loading Java classes is)... read more →

Working Code Podcast - Episode 109: Best Of 2022

By Ben Nadel on
Tags: Podcast

On today's show, Matt Cavender — the man who turns our incoherent babbling into meaningful thought — is gonna share a selection of his favorite clips from the past year (2022). Adam, Carol, Tim, and I are taking the week off to recover from our families and work off some of those food babies. But, fear not dear listeners, we'll be back next week to ring in 2023 - Working Code style. Here's hoping y'all had a lovely holiday and a happy new year!.. read more →

Hotwire Turbo Drive Requires Failed Form Submissions To Return A non-2xx Status Code

By Ben Nadel on

Over the past few weeks, I've been exploring the use of Hotwire in a ColdFusion application. It's a fascinating framework (from Basecamp) that forces you to think about web fundamentals and how to progressively enhance the user experience (UX). This morning, I ran into an issue trying to get Turbo Drive to work with HTTP Form submissions. It turns out, Turbo Drive requires non-2xx status codes to be returned in response to a failed form submission in ColdFusion... read more →

Code Kata: Recursively Flattening A Deep Array In Lucee CFML

By Ben Nadel on
Tags: ColdFusion

Yesterday, I looked at flattening an array in ColdFusion. That post was more a look at the available syntax options with a variadic function and less a look at the actual Array flattening algorithm. And, it only flattened to a single depth. As a fast-follow, I wanted to look at what it would take to recursively flatten a deep array, with nested array elements, in Lucee CFML... read more →

Iterating Over Function Arguments Using CFLoop In Lucee CFML

By Ben Nadel on
Tags: ColdFusion

In my previous post on flattening arrays in ColdFusion, I mentioned that the arguments scope in a Function body acts as both an Array and a Struct. This is a truly great feature of ColdFusion; but, iterating over such a dynamic data structure can be confusing at times. Luckily, ColdFusion also gives us the highly dynamic CFLoop tag. We can use CFLoop to iterate over the arguments scope using either Array iteration or Struct iteration... read more →

Code Kata: Flattening An Array In Lucee CFML

By Ben Nadel on
Tags: ColdFusion

Yesterday, at InVision, I was writing an algorithm in which I needed to build several one-dimensional arrays. And, in some cases, I was using all simple values; but, in other cases, I was using a mixture of simple values and other arrays. To keep my calling code clean, I abstracted the logic into a flattenArray() method that would take N-arguments and then smoosh all of those arguments down into a single array. The method I created worked fine, but it just didn't look "right". I wasn't vibing it. As such, I wanted to step back and try creating a flatten method with a variety of different syntaxes to see which strikes the right balance between simplicity, elegance, and readability (which is all highly subjective)... read more →

Hotwire Turbo Drive Doesn't Work With .cfm Page Extensions

By Ben Nadel on

Over the holiday break, I had this grand vision of building a ColdFusion site and then adding Hotwire (HTML Over The Wire) to it as a progressive enhancement. Unfortunately, it took me all of break just to get the ColdFusion parts written (I chose a poor problem space). And then, when I finally installed Hotwire and tried to use Turbo Drive, nothing happened. Every link and form submission lead to a full page refresh. After a few hours of Googling, I discovered that Hotwire Turbo Drive doesn't work with .cfm file extensions... read more →

Working Code Podcast - Episode 108: 2022 Year In Review

By Ben Nadel on
Tags: Podcast

Happy New Year! We did it! We survived 2022! This has been a rather hard year in many ways and a decent year in some ways. On this episode, the crew reflects on the past year in terms of fitness, technology, personal growth, and reading goals; and, celebrates some wins and laments some losses... read more →

In Life, Things Suffer More From Disuse Than From Overuse

By Ben Nadel on
Tags: Life

When I was child, we had this old, red pickup truck parked behind the house. My dad never used it, except for on occasion when he had to move wood from a felled tree or something to that effect. I remember once, when I got in the truck with him, he accidentally turned on the wipers and the rubber strip on one of the blades ripped right off. In bewilderment, I asked him how it could possibly break when we hardly ever use the truck - in my young experience, thing broke when we used them too much. He looked at me and said:.. read more →

Showing An Error Message In The OnError() Method In Application.cfc In CFML

By Ben Nadel on
Tags: ColdFusion

One of the many great things about the ColdFusion (CFML) runtime is that it natively provides an event-based framework in the form of Application.cfc. This ColdFusion component allows us to tap into events such as application, session, and request initialization. It also allows us to define a global error handler via the onError() method. This method, however, is tricky to use because it means — by definition — that the error in question was not handled properly (by lower-level code). This makes the state of the request very unpredictable; which means that we need to introspect the request before we attempt to output any error message... read more →

Working Code Podcast - Episode 107: Through The Wormhole

By Ben Nadel on
Tags: Podcast

Happy Festivus, dear readers! Welcome to our last Working Code episode of 2022! Closing out "No Effort December", we truly run the gamut this time: I talk about the crippling attachment I have to my own fingers (and why I won't put my hands anywhere near a spinning saw blade); Adam talks about how excited he is for the v1.0 release of Svelte Kit; and, Tim reflects on the blinding speed with which people seem to be making science and technology breakthroughs - I mean, we're talking some serious Sci-Fi-level stuff here!.. read more →

Considering Nullable Date Columns As A Representation Of State In SQL

By Ben Nadel on
Tags: ColdFusion, SQL

In my post yesterday on clearing NULLable database values in ColdFusion, I was using the concept of "Task Management" as my exploratory context. And, in the task database table that I created for the demo, I included both an isComplete column and a completedAt column. In theory, I could have written the demo using a single column, completedAt, since a non-NULL value within the completedAt column would indicate that the Task in question had been completed. But, I ended up using two columns because I believe they actually answer two different semantic questions... read more →

Setting And Clearing Nullable Values In A Data Access Layer In ColdFusion

By Ben Nadel on
Tags: ColdFusion, SQL

As much as possible, I try to avoid NULL values in my database schema design. But, sometimes, NULL is actually helpful in reducing schema complexity. Unfortunately, ColdFusion only has partial support for null values (by default); which makes it a bit tricky to pass a "required-but-null arguments" into a data access layer (DAL) method. To play nicely with both ColdFusion and SQL, I've been leaning on "magic values" when interacting with the my data gateways... read more →

People Don't Mind Being Used As Long As They Aren't Forgotten

By Ben Nadel on

I've been meaning to write this post for years; but, I never really knew what I wanted to say on the matter. I still don't exactly - I just feel compelled to put something down on paper because this phrase won't get out of my head:.. read more →

Fixing GitHub Gist's Sudden Case Of Line Wrapping

By Ben Nadel on
Tags: HTML / CSS

Yesterday, when I was giving my post on pagination using LIMIT and OFFSET in MySQL a once-over, I noticed that my code samples - which are powered by GitHub Gists - were rendering super wonky. When I inspected the runtime styles of the page, it appears that GitHub made a recent breaking change to the white-space property used within their "line of code" CSS class. To "fix" this (ie, turn off "word wrap" for my code snippets), I had to upload a CSS override to my blog:.. read more →

Working Code Podcast - Episode 106: A Cascading Cataclysmic Christmas

By Ben Nadel on
Tags: Podcast

This week on the show, we continue to lean into "No Effort December", talking about a hodgepodge of both tech and non-tech topics. Since we're heading into Christmas, we start off talking about how challenging it is to buy gifts, especially for the grown-ass adults in our lives. We also share some of our favorite Christmas movies; and, the movies which have absolutely nothing to do with Christmas, but which we love to watch in the winter anyway. We also dig into some modern CSS advances; including my fear that CSS selectors will quickly become more like Regular Expressions: fun to write but impossible to read!.. read more →

Paging Through Data Using LIMIT And OFFSET In MySQL And ColdFusion

By Ben Nadel on
Tags: ColdFusion, SQL

When I render a data-grid for a user, I usually use pagination to allow the user to iterate through some relatively finite amount of records. The other day, however, I had to build an administrative UI (user interface) that surfaced a tremendous amount of data - possibly hundreds-of-thousands of records. With so much data, standard pagination didn't seem like a meaningful solution. Instead, I switched over to using LIMIT and OFFSET in my MySQL, which allows the admin to page through the data one slice at a time. I don't use this technique that often, so I thought a ColdFusion demo would be fun... read more →

Using INSERT INTO SELECT To Duplicate Rows In MySQL And Lucee CFML

By Ben Nadel on
Tags: ColdFusion, SQL

Last week, as part of a duplication workflow, I had to duplicate a bunch of rows in one table while changing one of the column values (think, the conceptual "foreign key" column). To do this, I used MySQL's INSERT INTO SELECT syntax which provides a bulk INSERT API that is powered by a SELECT statement. I'd never actually done this in a production application before; so, I thought it might be worth a quick MySQL and ColdFusion demo... read more →


I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel