Skip to main content
Ben Nadel at Angular 2 Master Class (New York, NY) with: Paul Barrick and Alina Barrick
Ben Nadel at Angular 2 Master Class (New York, NY) with: Paul Barrick ( @peb7268 ) Alina Barrick

Recent Blog Posts by Ben Nadel

Extracting Illegal Tag Names From AntiSamy Error Messages In ColdFusion

By Ben Nadel on
Tags: ColdFusion

Yesterday, I observed a number of errors on my blog in which a reader was attempting to post a comment with unsupported HTML content. Only, the error was not intentional—the reader was making reference to the ColdFusion tags, <cfquery> and <cfqueryparam>; and, my AntiSamy HTML sanitization workflow was interpreting these tokens as "HTML tags". This is an easy markdown error to fix—you wrap the tags in back-ticks to denote them as code. Only, my error reporting offered up zero insight into the underlying problem. As such, I went in and updated my sanitization workflow to extract the illegal tags from the OWASP AntiSamy error messages and report them to the reader... read more →

Creating A ColdFusion-Oriented HashCode With Loose Types

By Ben Nadel on
Tags: ColdFusion

In the companion app for my feature flags book, each user's persisted configuration file has a version number. I want this version number to be incremented when the user updates their feature flags configuration; but, only if something within the configuration has actually changed. To this end, I need a way in ColdFusion to take two data structures and check to see if they are deep-equals. For that, I created the concept of a "FusionCode": a consistent, repeatable value that represents a complex data structure... read more →

Using An Ordered Struct As A Fixed-Size Cache In ColdFusion

By Ben Nadel on
Tags: ColdFusion

In ColdFusion, an ordered struct (or linked struct) is a struct in which the order of the key iteration matches the order of key insertion. Using ordered structs can be somewhat of a contentious topic because the difference between an ordered struct and a regular struct is almost invisible. But, an ordered struct can be hugely useful. For example, ordered structs are essential for MongoDB queries and can greatly simplify HMAC generation. Another use-case for ordered structs is maintaining a very simple, fixed-size cache in ColdFusion... read more →

Encapsulating Serialization Logic In ColdFusion

By Ben Nadel on
Tags: ColdFusion

Most of the time, when I need to serialize data in ColdFusion, I just reach for the built-in serializeJson() function. And, in most cases, this is a perfectly fine approach. But sometimes, I need to massage or manipulate the data as part of the serialization / deserialization workflow. If this is part of my database access layer (DAL), I might put that logic right in my data gateway; but, if I'm just dealing with flat text files, I've been encapsulating this logic inside its own abstraction... read more →

Adobe ColdFusion Parses JSON Into Non-Ordered Structs

By Ben Nadel on
Tags: ColdFusion

In ColdFusion, an ordered struct (aka linked struct) allows keys to be iterated in the same order in which they were defined. This is hugely valuable for workflows that involve MongoDB queries and Hashed Message Authentication Codes (HMAC). But, one quirky behavior that I came across today is that when Adobe ColdFusion parses JSON strings, it parses the object notation into an unordered struct. This means that you lose the "orderedness" through the serialization and deserialization workflow... read more →

Two Spread Operator Bugs In Adobe ColdFusion 2023

By Ben Nadel on
Tags: ColdFusion

I ran into two strange bugs this morning when attempting to use the Spread operator in Adobe ColdFusion (2021 and 2023). One bug prevents the CFML template from compiling; the other bug is just a completely nonsense outcome of the spread operation (at least compared to JavaScript)... read more →

Working Code Podcast - Episode 184: Code Comments For The Win

By Ben Nadel on
Tags: Podcast

On today's show, Adam and I talk about our respective strategies for leaving comments within code. Each of us inhabits a different end of the spectrum, with me erring on the side of viewing comments as an inherent value-add; and, Adam believing that the urge to add a comment is more akin to a "code smell", indicating a need to refactor the underlying code structure. We disagree on a lot in this conversation; but, it turns out, we actually agree on more than you might expect... read more →

Working Code Podcast - Episode 183: Carol's New Project

By Ben Nadel on
Tags: Podcast

On today's show, we talk to Carol about her idea for a small piece of software that will help Army families—like hers—organize their potluck social events. As web developers, the desire to start something new always comes with a mixture of emotions. On one hand, we can imagine a robust, feature-rich future with a solution that does everything we need. And, on the other hand, we can become so overwhelmed by the implementation details that taking even the first step feels near impossible. We strategize with Carol on how to take that first step; and, which questions she can answer early-on in order to unlock a more obvious path forward... read more →

Core Decision Functions Will Accept Null / Undefined Values In ColdFusion

By Ben Nadel on
Tags: ColdFusion

ColdFusion has always had a contentious relationship with null / undefined values. The ColdFusion runtime supports null and undefined values; but, if consumed incorrectly, such values lead to null reference errors. As such, it isn't always clear where you can and can't use undefined values. Today, I want to demonstrate that all of the core decision functions (such as isSimpleValue(), isArray(), and isStruct()) will accept null / undefined values; and, will do pretty much what you hoped they would do... read more →

Bug In Struct.Each() Error Handling In Adobe ColdFusion

By Ben Nadel on
Tags: ColdFusion

This is a bug I just ran into this morning while using the Struct.each() member method. If you throw a custom error inside an .each() iteration, Adobe ColdFusion—in at least 2021 and 2023—won't surface the error properly. Instead, it will surface a "wrapper" error that obfuscates the original type and message... read more →

Exploring Randomness In JavaScript

By Ben Nadel on

In my post yesterday, on building a color palette utility in Alpine.js, randomness played a big part: each swatch was generated as a composite of randomly selected Hue (0..360), Saturation (0..100), and Lightness (0..100) values. As I was putting that demo together, I came across the Web Crypto API. Normally, when generating random values, I use the the Math.random() method; but, the MDN docs mention that Crypto.getRandomValues() is more secure. As such, I ended up trying Crypto out (with a fallback to the Math module as needed). But, this left me wondering if "more secure" actually meant "more random" for my particular use-case... read more →

Color Palette Utility In Apline.js

By Ben Nadel on

A week or so ago, as I was working on my Feature Flags Book companion app, I needed to pick colors that correspond to the different variants available within a given feature flag. I'm not good at colors, so I took to Google; and, in my searches, I came across the utility site, Coolors. Coolors is very cool; but, I could only generate 5 colors for free and I needed about 7 colors for my feature flags. So, in typical "Developer fashion", I wanted to see if I could build something akin to Coolors on my own, using Alpine.js... read more →

Using Both Tab And Arrow Keys For Keyboard Navigation

By Ben Nadel on

I must admit that, historically, when thinking about keyboard-based navigation on a website, I've really only considered the Tab key for moving around and the Space and Enter keys for activation. The other day, however, I noticed something very interesting on the GitHub site: the Tab key was skipping over large swaths of buttons—buttons which, it turns out, can only be accessed using the ArrowLeft and ArrowRight keys. This kind of blew my mind!.. read more →

Generating Fake User And Company Data With ColdFusion

By Ben Nadel on
Tags: ColdFusion

As a companion piece to my Feature Flags Book, I'm creating a small playground app in which readers can explore the feature flags experience, both from a configuration and a consumption standpoint. As part of this process, I had to generate a set of fake users against which a set of configured feature flags could be evaluated. I know there are plenty of existing websites that will generate fake data for you; however, since I needed a predictable set of properties for my feature flag rules engine, I decided to generate my own fake data using ColdFusion... read more →

Working Code Podcast - Episode 181: More The Laws Of Software

By Ben Nadel on
Tags: Podcast

On today's show, we continue our discussion of the entries outlined on the website, the Laws of Software. Topics include McKinley's law on boring technologies, Doerr's law on aligning team vision, and Fitt's law on touchability... read more →

Using Range Offsets To Power Weighted Distributions In ColdFusion

By Ben Nadel on
Tags: ColdFusion

A few years ago, I looked at using arrays to power weighted distributions in ColdFusion. Using arrays is nice because they create a great visualization of the distributed values. But, creating and populating an array is a lot of overhead. As such, I wanted to revisit the idea of a weighted distribution of values; but, instead of populating an array, I'm just using calculated offsets... read more →

The 17th Annual Regular Expression Day - June 1st 2024

By Ben Nadel on
Tags: ColdFusion

Good morning my beautiful, beautiful friends and happy Regular Expression day 2024! Isn't it comforting to know that even with so much uncertainty in the world, you can always depend on the awesome power of pattern matching to help make life a little bit better—a little bit more fulfilling. And, even though there's ample opportunity to use Regular Expressions in every day life, there's always something new and exciting to try. And in celebration of this joyous day, I want to try something new (to me) and exciting in ColdFusion: using a callback operator in Adobe ColdFusion's reReplace() function... read more →

Using Margins With Four-Sided Positioning In CSS

By Ben Nadel on

Thirteen years ago, Ryan Jeffords blew my mind when he introduced me to four-sided positioning of absolute/fixed position elements. Yesterday, Scott Tolinski and Ivor Padilla took that to the next level when they explained to me that margins also work with four-sided positioning. And, to be honest, this kind of broke my brain, especially with regard to, margin:auto. As such, I needed to sit down and try it out for myself... read more →

Parallel Iteration vs. Chunked Parallel Iteration In Lucee CFML

By Ben Nadel on
Tags: ColdFusion

One of the most exciting features in ColdFusion is the ability to iterate over collections using parallel threads. When consuming large amounts of data, parallel threads can have a dramatic impact on performance. But, spawning threads isn't free—and, in some cases, spawning threads is even more expensive than you realize. Because of this cost, one thing that I've always wanted to test is the performance of straight parallel iteration compared chunked parallel iteration in Lucee CFML... read more →

Working Code Podcast - Episode 180: The Laws Of Software

By Ben Nadel on
Tags: Podcast

On today's show, we discuss a few of the entries outlined on the website, the Laws of Software. Topics include Atwood's Law on JavaScript, Cunningham's Law on getting answers, Parkinson's Law on getting things done, Goodhart's Law on taking measurements, Hofstadter's Law on inevitable failure, and the Peter Principle... read more →

Nesting The pointer-events Property In CSS

By Ben Nadel on
Tags: HTML / CSS

The pointer-events CSS property can be used to disable mouse interactions on a given DOM (Document Object Model) element. When an element has pointer-events set to none, it instructs the browser to let the mouse events "fall through" the given DOM element and target / effect whichever next element is stacked below the user's cursor. I've barely ever used this particular CSS property because—for the most part—when I create a UI (User Interface) element, I want the user to have access to it. Yesterday, however, I learned that you can nest the pointer-events property within the DOM tree. This creates an interesting confluence of interaction behaviors... read more →

Working Code Podcast - Episode 179: AI Sells You On AI

By Ben Nadel on
Tags: Podcast

On today's show, Tim gears-up for a farm insurance conference out in Nashville where he's hoping to educate farmers on the pros-and-cons of artificial intelligence (AI). But, ahead of his talk, he'll be using AI voice technology—provided by Bland.AI—to call the conference attendees and convince them to attend his presentation. And then, hopefully, weave statistics and sentiment analysis insights from these automated calls back into his slide deck... read more →

Experimenting With Low-Level SQLite Access In Lucee CFML

By Ben Nadel on
Tags: ColdFusion, SQL

In my first look at accessing SQLite databases in ColdFusion, I was using a Lucee CFML specific feature that allows for creating on-the-fly datasources in the CFQuery tag. As a follow-up experiment, I wanted to see if I could use lower-level Java methods—in the java.sql package—in order to access SQLite without having to rely on Lucee-only features... read more →

Working Code Podcast - Episode 178: Upgrading From Node 0.10

By Ben Nadel on
Tags: Podcast

This week on the podcast, we touch on a variety of topics. I've been incrementally building a data export feature for my customers; and, I've gotten to a point in which I can see a viable light at the end of the tunnel! Carol has discovered that if she doodles circles with her non-dominant hand, it occupies the ADHD portion of her brain and frees her up to focus on reading. Tim is continuing to improve his AI voice-agent, using a listener-suggested approach to loading Spanish language voice models on demand. And, Adam is battling some pretty steamy code rot; and is attempting to upgrade a series of interconnected Node.js Lambda functions from v0.10—released in 2013—to v20... read more →

Creating In-Memory SQLite Databases Using JDBC In Lucee CFML

By Ben Nadel on
Tags: ColdFusion, SQL

In my first look at connecting to SQLite databases using JDBC in Lucee CFML, I was creating physical database files and synchronizing them between my Docker container and my host machine. But, in an experimentation context, there may not be any need to persist the database state across container restarts. In such a context, I could have used SQLite's in-memory database mode to explore the SQLite space without having to worry about persisting data to disk... read more →

Creating On-The-Fly Datasource Connections In Lucee CFML

By Ben Nadel on
Tags: ColdFusion, SQL

In yesterday's post on connecting to SQLite databases using JDBC in Lucee CFML, I was creating and consuming a new, user-specific datasource on every page request. In order to do this, I made use of a technique that I only just learned about from the CommandBox Book written by Ortus Solutions. Apparently, in Lucee CFML, you can provide the CFQuery datasource attribute as a struct instead of a string... read more →

Experimenting With SQLite JDBC Connections In Lucee CFML

By Ben Nadel on
Tags: ColdFusion, SQL

Although SQLite has been around for almost 25-years, it seems to be having a moment. In the past year or two, I've heard many people discuss the power of embedding SQLite databases within an application. I've never looked at SQLite before; and, I don't think it necessarily makes sense in the context of a ColdFusion web application; but, as a fun exploration, I wanted to see if I could get ColdFusion to connect to a SQLite database... read more →

Using Multiple Common Table Expressions In One SQL Query In MySQL

By Ben Nadel on
Tags: SQL

A couple of years ago, I upgraded this blog from MySQL 5.7.10 to MySQL 8.0.28. This gave me access to newer SQL features like Common Table Expressions (CTE) and JSON column types. But, my blog requires little more that CRUD (Create, Read, Update, Delete) operations; so, there's not much of need for me to write advanced SQL statements... read more →

CSS Open Props Exploration

By Ben Nadel on

I've known about the CSS Open Props project for a long time. But, it was only after recently hearing its creator, Adam Argyle, discuss the power of :where() within a design system that my curiosity was sufficiently piqued. I decided to start exploring this project in hopes of building a better sense of how design systems work... read more →

Working Code Podcast - Episode 177: Infinite Invisibility Timeout

By Ben Nadel on
Tags: Podcast

On this week's show, we cover a variety of topics. Adam uses the new CSS color functions for HSL (Hue, Saturation, Lightness) in order to create a heatmap for the number of dollars raised by his platform. I dive into the Algolia search service as a way to provide a search feature on this blog. Carol is trying to alleviate performance concerns around an N+1 SQL query problem using an ORM (Object-Relational Mapper) that has decided to use an N+1 selection strategy as "the way" with no escape hatch. And, Tim is getting some great feedback regarding his AI-powered call system that will alert customers to upcoming renewal dates... 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