Skip to main content
Ben Nadel at Scotch On The Rock (SOTR) 2010 (London) with: Justin Carter
Ben Nadel at Scotch On The Rock (SOTR) 2010 (London) with: Justin Carter@justincarter )

Recent Blog Posts by Ben Nadel

ColdFusion Alive, Episode 117: Adobe ColdFusion And Lucee CFML Roundtable, Part III

By Ben Nadel on
Tags: ColdFusion

Ask me what I love about ColdFusion and I won't be able stop myself - there's too dang much to discuss! But, thankfully, I'm not the only one afflicted with such a luxurious problem. Which is why Michaela Light, Charlie Arehart, Gert Franz, Mark Drew, and I got together - yet again - to have a round table discussion about ColdFusion (Episode 117) on the ColdFusion Alive podcast... read more →

Working Code Podcast - Episode 86: The Working Code Test

By Ben Nadel on
Tags: Podcast

Twenty-two years ago, Joel Spolsky wrote an article titled, The Joel Test, which outlines 12-steps for evaluating the quality of a software team. At the time, Joel was working with Microsoft, building products that were delivered on CD-ROM. As such, his day-to-day workflow was somewhat different than the kind of work that I do. That said, much of what he had in his 12-point litmus test still holds true! Which I believe is a testament to how fundamental his insights were. This week on the show, we review Joel's list, give each item our personal Yay or Nay, and then add a few requirements of our own... read more →

Working Code Podcast - Episode 85: Shipping Complexity

By Ben Nadel on
Tags: Podcast

The less code you write, the easier it is for people to review, the less likely it is to contain bugs, and the more likely it is to merge cleanly into your main integration branch. The converse of this tends to also be true: the more code you write - particularly within a long-lived feature branch - the harder it is to review and the more likely it is to contain bugs that cause production issues. We all basically hold this to be true; however, that doesn't mean that we can simply choose to do the former. Shipping less complexity is a byproduct of both team and technology constraints. This week on the show, the crew talks about how we try to reduce the complexity of our code-shipping process... read more →

Pretty-Printing JSON Using GSON In Lucee CFML 5.3.9.141

By Ben Nadel on
Tags: ColdFusion

I'm currently working on a proof-of-concept (POC) for a feature flag system in Lucee CFML. And, for my POC data persistence layer, I've been using a simple, flat JSON (JavaScript Object Notation) text file. This works great; but, I found myself wishing that the JSON file was pretty-printed so that I could more easily debug my data persistence algorithms. ColdFusion's native serializeJson() function doesn't have a pretty-print feature; but, I was able to use Google's GSON library to generate pretty-printed JSON output in Lucee CFML 5.3.9.141... read more →

Using Multiple Break Statements In A Single Case Clause In ColdFusion

By Ben Nadel on
Tags: ColdFusion

For the last few weeks, I've been quasi-heads-down, noodling on a workflow that builds-up complex objects using form POSTs in ColdFusion; and, as part of that workflow, I have a switch statement that defines some mutations on the pending-object in question. The other day, my logic was getting a bit complicated and I went to see if I could use multiple break statements within a single case clause. Turn out, this totally works in ColdFusion... read more →

Working Code Podcast - Episode 84: Interview With Jason Henriksen

By Ben Nadel on
Tags: Podcast

This week on the show, we interview Jason Henriksen who works alongside Carol as a Software Architect at Clear Capital. According to Jason, every engineer does some degree of architecture, whether they know it or not. In fact, there's a lot of overlap between what Jason does and what your average web developer does. Which is why he calls his team the "Architecture Support" team. Their goal isn't to hand down edicts and pass out proclamations. Instead, Jason's goal is to build bridges between teams, help identify common pain points, propagate best practices, and lovingly guide the company in the right technical direction... read more →

Using Strict Type Decision Methods In ColdFusion

By Ben Nadel on
Tags: ColdFusion

Historically, one the nicest features of ColdFusion is the fact that it is loosely typed. And, that the language will - in most cases - happily and transparently cast one data type to another in order to get the job done. As the language has continued to modernize, however, some of its loose behaviors can cause unexpected errors. As such, I was proposing yesterday, on the Lucee CFML developer forums, that the language might introduce some Strict decision functions... read more →

Validating Complex, Nested, Dynamic Data Structures In ColdFusion

By Ben Nadel on
Tags: ColdFusion

Last week, I looked at building-up complex objects using form POSTs in ColdFusion. I then took that same technique and used it to create a multi-step form wizard that doesn't require any data persistence. All of that was in service of creating a feature flag system for my blog (see my Tweet). But, building-up a complex object is one thing - validating and persisting that complex object is whole other beast. And, to be honest, I don't have a go-to method for validating complex, nested structures in ColdFusion. As such, I've spent the last week playing around with an approach that I would like to share... read more →

Working Code Podcast - Episode 83: What If You Weren't A Coder?

By Ben Nadel on
Tags: Podcast

We all love writing code. Honestly, here on the show, it's hard for us to imagine doing anything other than building beautiful digital products for our beloved customers. But, as a thought experiment - in these post-pandemic times - the crew wanted to share some of the other professions that could have been. From ice cream truck driver to organic chef to movie theater entrepreneur, we dive into the untapped world of alternate realities... read more →

Building-Up A Complex Objects Using A Multi-Step Form Workflow In ColdFusion

By Ben Nadel on
Tags: ColdFusion

Earlier this week, I looked at using form POST-backs to build up complex objects in ColdFusion. That technique allowed for deeply-nested data to be seamlessly updated using dot-delimited "object paths". My previous demo used a single page to render the form. As a fast-follow, I wanted to break the demo up into a multi-step form workflow in which each step manages only a portion of the complex object... read more →

Working Code Podcast - Episode 82: GitHub Charging For Copilot

By Ben Nadel on
Tags: Podcast

This week on the show, the crew talks about GitHub Copilot. After being in private beta for several months, this "AI pair programmer" is now generally available as a paid product for $10/month or $100/year. But is this something people want to pay for? Will a price put the kibosh on grassroots adoption? Are there pros-and-cons to different pricing models? And, is there ever going to be a world in which I can get past my own fanatical formatting tendencies?.. read more →

Building-Up A Complex Objects Using Form POST-Backs In ColdFusion

By Ben Nadel on
Tags: ColdFusion

Normally, when building forms in ColdFusion, I have simple key-value pairs that map neatly onto individual form fields. Recently, however, I've been working on a form workflow that needs to both construct and populate a complex object before the data can be persisted. To manage this workflow, I'm borrowing an idea from ASP.net wherein the "state" of the page is posted back to the server on each form submission. This "state" can then be acted upon by the ColdFusion server in order to maintain complex data structures across page loads... read more →

Working Code Podcast - Episode 81: Total Randos

By Ben Nadel on
Tags: Podcast

This week on the show, the crew shares some of the random stuff that we've been dealing with at work. Carol is about to submit a PR (Pull Request) that accounts for 8-weeks worth of commits; and, she's already warning her engineers that it's gonna be beefy! I'm wondering if I've been fooling myself into my love of Lucee CFML's "Tag Islands"; or, if there's something fundamentally more enjoyable about the developer ergonomics of the CFQuery tag. And, Tim's been working on remaining PCI (Payment Card Industry) compliant by scrubbing credit card numbers out of his customer's "name" fields; because, as it turns out, customers will jam a credit card number into just about any form field that they find!.. read more →

Using An Array To Power Weighted Distributions In Lucee CFML 5.3.8.201

By Ben Nadel on
Tags: ColdFusion

Lately, I've been working on some code that needs to randomly assign a value to a request. But, the "randomness" isn't entirely random: the set values needs to be assigned using a weighted distribution. Meaning, over a period of time, each value should be "randomly assigned" a limited percentage of the time. I'm sure there are fancy / mathy ways to do this; but, I've found that pre-calculating an array of repeated values makes the value-selection process simple in Lucee CFML 5.3.8.201... read more →

Namespacing Components With Per-Application Mappings In ColdFusion

By Ben Nadel on
Tags: ColdFusion

In my ColdFusion applications, I use a lot of components. But, these components are, for the most part, application-specific and live seamlessly alongside my application's custom mappings. Recently, however, I've been thinking about writing a "module" (ie, a set of related components) that I might want to use in multiple applications. And, it wasn't immediately obvious to me how I might define my ColdFusion per-application mappings in order to avoid conflicts with an application's existing component tree. As such, I wanted to experiment with using per-application mappings to create "namespaces" for shared ColdFusion components... read more →

Looking At The Performance Overhead Of A Read-Only Lock In Lucee CFML 5.3.8.201

By Ben Nadel on
Tags: ColdFusion

In yesterday's post, I demonstrated that iterating over shared Structs and Arrays is thread-safe in ColdFusion; assuming, of course, that the access is read-only. But, what if I need to occasionally mutate the shared data? In that case, I'd have to acquire an exclusive lock some of the time; which, in turn, means that I'd have to acquire a read-only lock most of the time. This got me thinking about the performance overhead of a read-only lock in Lucee CFML 5.3.8.201... read more →

Updating My Mental Model For Shared Array / Struct Iteration In ColdFusion

By Ben Nadel on
Tags: ColdFusion

In the very early days of ColdFusion, it was considered a "Best Practice" to synchronize access to all shared data structures. Meaning, to single-thread the access in order to avoid race conditions. Over time, this practice became much more nuanced; and, more of the native data types within ColdFusion became synchronized by default. Meaning, they were being made thread-safe internally. I believe that my mental model for iteration over shared data structures is outdated. As such, I wanted to run some parallel iterations in Adobe ColdFusion 2021 and Lucee CFML 5.3.8.201... read more →

Working Code Podcast - Episode 80: Other Duties As Assigned

By Ben Nadel on
Tags: Podcast

In each role, there are the responsibilities that get listed on the job board; and then, there's all the random stuff that they ask you do to once you show up. On today's show, the crew discusses the latter: those strange and wondrous "extras" that sometimes get rolled-up into an honest day's work. Topics include: buying nipple cream, picking up cigarette butts, cleaning bathrooms, taking out trash, driving to remote server locations, restocking photocopiers, and - perhaps worst of all - getting pushed into Sales... read more →

Considering A Stale-While-Revalidate Pattern To Caching In ColdFusion

By Ben Nadel on
Tags: ColdFusion

In a recent episode of Syntax.fm, Scott and Wes discussed HTTP caching headers. From their discussion, I learned that there is am experimental value called, stale-while-revalidate. And, while this post isn't about HTTP caching, their discussion got me thinking about different ways in which I might manage a server-side cache of data that needs to be kept in-sync with a remote data source. I wanted to do some noodling of what a "stale while revalidate" workflow might look like in ColdFusion... read more →

Playing With Java Pattern's Named Capture Groups In ColdFusion

By Ben Nadel on
Tags: ColdFusion

In yesterday's post on the new jreExtract() method in JRegEx.cfc, I was aliasing the Regular Expression (RegEx) capture groups with human-friendly labels as part of my demo-output. This reminded me that the Java Pattern class added named capture groups in Java 7 (circa 2010); and, I've yet to ever try them out. As such, I thought it was high-time to give named capture groups a try in ColdFusion... read more →

Adding jreExtract() To Pluck Captured Groups Using Regular Expressions In ColdFusion

By Ben Nadel on
Tags: ColdFusion

I love Regular Expressions. I use them probably every day in some capacity. And, I've loved having my JRegEx.cfc project to simplify many pattern-based interactions. Today, I'm adding one more tool to that toolbox: jreExtract(). The jreExtract() method matches a Java Regular Expression against an input String and returns a Struct of the captured groups. Sometimes, I want to use a single pattern-match to pluck-out parts of a string in ColdFusion... read more →

ColdFusion Alive, Episode 115: Adobe ColdFusion And Lucee CFML Roundtable, Part II

By Ben Nadel on
Tags: ColdFusion

A few weeks ago, I appeared on episode 113 of the ColdFusion Alive podcast with Michaela Light, Charlie Arehart, Gert Franz, and Mark Drew. In that episode, we had so much fun talking about how wonderful modern ColdFusion is that we decided to have ourselves a part II: Episode 115. In this fast-follow, we talk about the strengths and the weakness of the ColdFusion and Support communities at large... read more →

Ask Ben: Extending A ColdFusion Session On A Long-Lived Page

By Ben Nadel on

Hi Ben, I am trying to learn ColdFusion and have a question. I hope you can help me. I have an application where a user logs into a portal. Session variables are set to time out in 30 mins. But, is it possible to extend the session if the user keeps using the page. For the application, even if the user is moving the page up and down and making some interaction with the page, the session still expires. Thank you so much in advance.!.. read more →

Working Code Podcast - Episode 79: Potluck 5

By Ben Nadel on
Tags: Podcast

This week on the show, Adam and I examine a variety of random topics: Adam loves watching conference videos on YouTube; I am feeling terribly insecure about falling behind in the field of web development; neither of us can believe that Elon Musk is forcing his employees back into the office; and, how is it possible that some people seem have so much free time - what the heck is their secret?! I'm constantly struggling to find time to do all the things that I would like to do... read more →

It's OK To Be Super Explicit In Your Data Access Method Names

By Ben Nadel on
Tags: ColdFusion

This post is mostly a note to myself - a sort of "permission slip" to relax the previous constraints of my mind. The other day, I was writing an Update method in a data access object (DAO) within my ColdFusion application. This update method was updating an optional relationship within my domain model. Meaning, the target row wasn't guaranteed to exist. As such, I decided to author the underlying SQL statement as an Upsert method that would use the ON DUPLICATE KEY UPDATE semantics. This would allow me to either update the existing row or create a new row on-the-fly. Technically, this worked like a charm; but, emotionally, I felt deeply conflicted... read more →

A Relational Database Table To Prevent Double Form-Submissions In ColdFusion

By Ben Nadel on
Tags: ColdFusion, SQL

The other day on Episode 78 of the Working Code podcast, Adam Tuttle and I were talking about handling accidental, double form-submissions when there is no "natural key" in the database on which to attach a unique index. Adam suggested submitting a GUID (Globally Unique ID) along with the form POST and then storing that GUID in the target table. I think this is definitely the right direction; but, I didn't like the idea of storing a value in the table simply for the sake of uniqueness. And then it occurred to me: can I have a separate database table that does nothing but prevent double form-submissions in ColdFusion?.. read more →

Working Code Podcast - Episode 78: User Experience (UX) Guard Rails

By Ben Nadel on
Tags: Podcast

This week on the show, Adam and I talk about the "unhappy paths" in software design. An unhappy path - also known as a "sad path" - is anything that can go wrong during the consumption of a product. Some unhappy paths are nothing more than unanticipated edge-cases in the code while other unhappy paths are caused by poorly designed user interfaces (UI) that lack necessary constraints and affordances. But of course, it doesn't much matter why something is breaking, if our customers are unhappy, it's our job to fix it!.. read more →

Disabling Async Attribute On CFMail For At-Least-Once Delivery In Lucee CFML

By Ben Nadel on
Tags: ColdFusion

When I'm sending emails out in a ColdFusion application, not all emails are created equal. Much of the time, if an email is lost here-and-there, it's not the end of the world. For example, a "Forgot My Password" email can always be sent a second time. In critical ColdFusion workflows, however, when losing an email is unacceptable, I track the processing of pending emails in the database; and, I make sure to set the async (Lucee CFML) / spoolEnable (Adobe ColdFusion) attribute on the CFMail tag to false... read more →

Adding New Regular Expression Parsing To My JRegEx Project For ColdFusion

By Ben Nadel on
Tags: ColdFusion

As part of the recent Regular Expression Day celebrations, I was working on some fun and exciting ways to parse strings and lists using RegEx patterns in ColdFusion. As a quick follow-up to those joyous outbursts, I've gone and added those new methods to my JRegEx ColdFusion component. In fact, I've added a new JRegExList.cfc component to this project for list-specific parsing - I didn't want to mix the two genres together... read more →

More Slicing And Dicing Strings Using Java Regular Expressions In ColdFusion

By Ben Nadel on
Tags: ColdFusion

After yesterday's post on parsing lists using a regular expression delimiter in ColdFusion, I was all high on the celebration of RegEx Day 2022; and, I wanted to keep the party going! So, I started to think about how else I might want to slice and dice strings using RegEx patterns. In a previous post on parsing inbound emails from Postmark, I created a user defined function (UDF) called jreBefore(). For this post, I wanted to showcase that method, and a few other methods like it, in ColdFusion... read more →