Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
Ben Nadel at InVision In Real Life (IRL) 2019 (Phoenix, AZ) with: Nick Miller
Ben Nadel at InVision In Real Life (IRL) 2019 (Phoenix, AZ) with: Nick Miller

Recent Blog Posts by Ben Nadel

The Magic Of Thinking Small: Embracing Limitations As A Strength

I work on a very small team. It's me and three other full-stack developers. And while we are a cohesive unit, the four of us tend to work on completely separate initiatives. In some ways, the size of our team is very limiting. But, this limitation has also proven to be a tremendous benefit as it p... read more »


Upgrading A Built-In Function To A First-Class Citizen In Lucee 5.3.2.77

For as long as I can remember, ColdFusion has supported the idea of User Defined Functions (UDFs) as First-Class Citizens. Meaning, User Defined Functions can be referenced and passed-around just like any other object in the ColdFusion landscape. The same, however, has never been true of Built-In F... read more »


Installing User Defined Functions (UDF) As An Extension For Built-In Functions (BIF) In Lucee 5.3.2.77

With Adobe ColdFusion, I've always had a fascination with the idea of being able to extend the set of native (or built-in) Functions that are available in the request context. A decade ago , I played around with hacking User Defined Functions (UDFs) into the "hidden scope" of the PageCo... read more »


Playing With The Zip Virtual File System (VFS) In Lucee 5.3.2.77

The other day, I was talking to fellow InVisioneer, Shawn Grigson , about how weirdly excited I am that Lucee has compress() and extract() functions. I don't know why; but, I just love how easy it is to create and consume Zip archive files. In response, Shawn reminded me that Lucee also supp... read more »


Unexpected Variable Assignment Using Function LocalMode Modern With Nested Closures In Lucee 5.3.2.77

Last week, I took a look at how the Function localmode feature in Lucee makes it safer to dynamically render CFML templates . In response to that post, John Pansewicz told me that he ran into an issue using localmode with nested Functions (for which he filed a ticket ). It's one of those si... read more »


Using Function LocalMode To Render Templates During Static Site Generation In Lucee 5.3.2.77

The other day, I took a look at using the Function localmode to more-safely render templates in Lucee . The reason that localmode makes rendering templates more safe is that any unscoped variable assignment , performed during the CFML template evaluation, is applied to the local scope , no... read more »


Using Function LocalMode Modern To More-Safely Render ColdFusion Templates In Lucee 5.3.2.77

Historically, when you set an unscoped, non- var 'ed variable inside a ColdFusion Function, the variable is applied to the variables scope (except for when that assignment is inside a CFThread tag ). In Lucee CFML, however, we can use the Function directive - localmode - to change this behav... read more »


Fixing ImageScaleToFit() Invalid Size Errors In Earlier Versions Of Lucee CFML

In earlier releases of Lucee CFML, calling the imageScaleToFit() function on an oblong image can result in a Java error, invalid size for image . This does not appear to affect the latest release of Lucee CFML (5.3.2.77); however, since people - like myself - may be running on earlier releases o... read more »


CachedWithin Function Memoization Can Be Applied To Closures In Lucee 5.3.2.77

Over the past couple of weeks, I've written a few posts about the cachedWithin Function memoization feature in Lucee 5.3.2.77. I've looked at how it compares complex inputs by value ; and, at how it returns complex outputs by value . But, all of my explorations to date have been on a "pr... read more »


Using Hmac() And An Ordered Struct To Implement A Secure Email Tracking Pixel In Lucee 5.3.2.77

Last week, I looked at using ordered, or linked, structs in Lucee 5.3.2.77 . An ordered struct is one in which the keys will be iterated-over in a consistent, predictable manner. This predictable iteration is perfect for things like creating BSON documents in a MongoDB query . It's also perfect f... read more »


Function Results Are Returned By Value When Using CachedWithin In Lucee 5.3.2.77

A couple of weeks ago, I demonstrated that cachedWithin Function memoization compares arguments by value in Lucee 5.3.2.77. This behavior even includes complex objects like Arrays, Structs, and ColdFusion Components. Upon further testing, it also seems that the return value of a cachedWithin... read more »


CFCatch Can Target Explicit Java Exception Types Even With JavaLoader In Lucee 5.3.2.77

If you've been in the ColdFusion world for a while, there's a good chance that you've come across Mark Mandel's JavaLoader project. The JavaLoader project wraps a URLClassLoader , making it easy to load external Java Classes right from a set of JAR file-paths. However, there's been one long-st... read more »


Using The Safe-Navigation Operator To Safely Clean Up Resources In Lucee 5.3.2.77

I know that the "safe navigation" operator has existed in more recent releases of ColdFusion; however, coming from Adobe ColdFusion 10, I haven't been able to use the operator until my team recently switched to using Lucee CFML. As such, I haven't had time to develop consistent patterns a... read more »


Sanity Checking Closure Invocation Overhead And Performance In Lucee 5.3.2.77

PERFORMANCE CAVEAT: As with all micro load-testing scenarios, the results should be taken with caution. Testing in a local development environment, that is not under production load, is never a perfect representation of real-world performance. One of my favorite use-cases for the Closure cons... read more »


Ordered Structs Are Perfect For Creating MongoDB BSON Documents In Lucee 5.3.2.77

Yesterday, I took a look at using ordered, or linked, structs in Lucee 5.3.2.77 . These are Structs in which the order of the iteration of the keys matches the order of the insertion of the keys. Internally to ColdFusion, having a predictable Struct iteration order is almost always unnecessary; bu... read more »


Exploring Linked / Ordered Structs In Lucee 5.3.2.77

The Struct data-type in ColdFusion is an "unordered" collection of key-value pairs. Anecdotally, if you iterate over the keys in a Struct, they are returned in alphabetical order. However, this ordering is not guaranteed; and, you should not depend upon this ordering in your logic. That s... read more »


Parsing And Serializing Large Datasets Using Newline-Delimited JSON In Lucee 5.3.2.77

A couple of years ago, Adam DiCarlo taught me about the Newline-Delimited JSON format (NDJSON) for data storage. At the time, I took a look at using NDJSON in Node.js ; and, since then, it's a format with which I've become quite enamored. Now that I'm starting to dig into Lucee CFML, I wanted to... read more »


Understanding Struct Key-Casing Using SerializeJson() In Lucee 5.3.2.77

In general, Lucee CFML has really solid JSON (JavaScript Object Notation) support because it stores data using native Types under the hood. Because of this, it never suffered from the random Type conversions that plagued Adobe ColdFusion developers when using serializeJson() (ex, converting "... read more »


Performance Case Study: Parallel Data Access Using Parallel Struct Iteration In Lucee 5.2.9.40

A couple of weeks ago, I was very excited to discover that Lucee 5 supports parallel iteration of data structures . And, given this parallel iteration, I started exploring the developer ergonomics of asynchronous data accesses using parallel iteration . Once I had a pattern that felt easy enough ... read more »


How I Take A "Mental Health Day" At Work

On a recent episode of the JS Party podcast , Suz Hinton , Feross Aboukhadijeh , and Emma Wedekind had an open and honest conversation about workplace burn-out. The workplace is an interesting beast. Sometimes, it can grind me down to a soulless nub ; and, other times, the workplace is so exh... read more »


The CFQueryParam Tag Does Not Require The "CF_SQL_" Prefix On SQL Types In Lucee 5.3.2.77

This is primarily a note to self ; but, one nice thing about moving from Adobe ColdFusion 10 to Lucee CFML 5.3.2.77 is that I can start to omit the cf_sql_ prefix in my cfqueryparam tags. So, instead of using something like cf_sql_longvarchar , I can just use longvarchar . I never understood... read more »


Possible Bug: Variable Assignment Gets Swallowed By Function Invocation In Lucee 5.3.2.77

UPDATE : On Twitter, John Pansewicz pointed out why this doesn't work. And, boy do I feel foolish . This "assignment" syntax that I'm trying to use in the context of a Function call is actually the named parameters invocation of that Function. So, I'm not assigning the variable, I'm i... read more »


Immediately Invoked Function Expressions (IIFE) Work In Lucee 5.3.2.77

Yesterday, at the end of day, I tweeted about something exciting that I had found in Lucee . It was the fact that the Immediately Invoked Function Expression construct - or IIFE (pronounced "iffy") - is supported in Lucee 5.3.2.77. More than anything, this is just a demonstration of h... read more »


CFThread Attributes Are Passed By Reference - Not By Deep Copy - In Lucee 5.3.2.77

When Adobe ColdFusion first introduced the cfthread tag, a lot of us stumbled over the fact that attributes are passed by deep-copy into the cfthread body . This was done by design in order to help prevent developers from having to worry about accessing and mutating shared state . Which, to b... read more »


Deeply Nested CFThread Tags Are Permitted In Lucee 5.3.2.77

When Adobe ColdFusion introduced the CFThread tag for asynchronous processing, they decided to prevent developers from nested it. That is, they explicitly prevent one CFThread tag from spawning a child CFThread tag . The rationale (as best I can remember) being that a developer could acciden... read more »


The CFQuery Tag Supports Silent Asynchronous Query Execution In Lucee 5.3.2.77

As I've been digging through the Lucee CFML 5.3.2.77 documentation, one feature that I came across was the ability to execute SQL queries asynchronously with the async attribute of the cfquery tag (and the corresponding queryExecute() function). The Lucee documentation doesn't really tell you... read more »


I Can Finally Embed An Assignment Operation Inside Of Other Expressions In Lucee 5.3.2.77

CAUTION : This feature is actually buggy in Lucee. It works within the the return context of this post; but, it seems to break everywhere else. See Comments section below for more information. Having recently switched from Adobe ColdFusion 10 to Lucee CFML 5.2, I've been digging through al... read more »


The CachedWithin Function Memoization Feature Appears To Compare Complex Objects By Value In Lucee 5.3.2.77

Earlier today, I demonstrated that the cachedWithin Function memoization feature caches the output buffer in Lucee 5.3 . While this was an unexpected behavior, I think it makes perfect sense. And, as a quick follow-up post, I wanted to share yet another cachedWithin behavior that wasn't immedi... read more »


Caching Function Outcomes With CachedWithin Caches Both The Return Value And The Output Buffer In Lucee 5.3.2.77

One of the cool features of the Lucee CFML engine is that you can have it memoize the outcome of a Function if you define a cachedWithin directive in the Function's meta-data. The cachedWithin directive caches the outcome of the Function; and then, if the Function is invoked again with the same... read more »


Returning CFQuery / Query Results As Arrays In Lucee 5.3.2.77

Anyone who has used ColdFusion is very familiar with the Query object that is returned from the cfquery tag. But, if you are using Lucee 5+, the cfquery tag has a fun little efficiency built into it: the returnType attribute. The returnType attribute accepts the values, query (the defau... read more »