Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at the jQuery Conference 2010 (Boston, MA) with:

Barney

Member since Dec 11, 2008

Recent Blog Comments By Barney

  • Calling ColdFusion Components And Methods From Groovy

    Posted on Dec 2, 2009 at 10:24 AM

    Nice Ben. There is already a 'pageContext' binding provided for you by CFGroovy, so you don't need an explicit reference the variables scope. Though now that I think about it, it's the PageContext for the g:script tag, not the calling template, so maybe it does matter.... read more »

  • Running Javascript In ColdFusion With CFGroovy And Rhino

    Posted on Nov 30, 2009 at 11:58 AM

    Nice article, Ben. It's worth mentioning that you can run the non-DOM pieces of standard JS frameworks on the server-side without any fuss. I was doing this with the Prototype core back in the CFRhino days. So you can very easily use some of the tooling you use client side on the server. Also, t... read more »

  • Parsing Invalid HTML Into XML Using ColdFusion, Groovy, And TagSoup

    Posted on Sep 30, 2009 at 5:29 PM

    That's slick, Ben. I haven't played with XmlSlurper much because I never have valid HTML, but wrapping it around TagSoup is hella clever.... read more »

  • Groovy Operator Overloading Does Not Work In The ColdFusion Context

    Posted on Sep 18, 2009 at 1:45 PM

    Yeah, it'd be awesome if it worked, but oh well. Groovy does stuff at both compile time and runtime, and it's not always obvious where a given feature is implemented until it fails in the CFML context (and therefore is a compile-time feature).... read more »

  • Groovy Operator Overloading Does Not Work In The ColdFusion Context

    Posted on Sep 18, 2009 at 1:28 PM

    I don't actually know this for fact, but my suspicion is that the method overloading in Groovy is implemented as compiler trickery, much the same way varargs are implemented in both Groovy and Java. Since your CFML doesn't run through the Groovy compiler, it doesn't get that syntactic sugar. Howev... read more »

  • Instantiating Groovy Classes In The ColdFusion Context

    Posted on Sep 17, 2009 at 12:49 PM

    Don't forget that you don't need getters/setters in Groovy unless you want custom behaviour (like setters returning 'this'). So you can strip all the getters from your code and just use the properties. And you don't have to call them either, you can create a person like this: [cfset person = ... ... read more »

  • Assigning Variables Within A CFLoop Condition In ColdFusion

    Posted on Aug 4, 2009 at 2:15 PM

    Apparently Adobe dropped the ball with "everything you can do with tags you can do with script", eh? Of course, I'd probably "fix" that code by adding the second equals sign (to make an equality instead of an assignment) if I saw it. Here's a better way with CFSCRIPT: while (true) { targetIndex... read more »

  • Learning ColdFusion 9: Delete Array Elements With ArrayDelete()

    Posted on Aug 4, 2009 at 2:04 PM

    arrayDelete(myArray, "Sarah") functionality has been available since the Java conversion via myArray.remove("Sarah"). And be careful with the array->Set->array conversion - that removes any ordering in the array. If you care about ordering you'll need to use the Set manually (in psuedo-code)... read more »

  • Ability To Leverage ColdFusion Bug Will Mean Errors Later

    Posted on Apr 17, 2009 at 1:49 PM

    Wow alan, it's like you're psychic or something. How ever did you know? Akismet, Ben?... read more »

  • Ability To Leverage ColdFusion Bug Will Mean Errors Later

    Posted on Apr 7, 2009 at 12:08 PM

    Oh, I know. But people aren't very discriminating when they see stuff on line. The tongue-in-cheek just doesn't come across. Do you remember that URL "shortening" service I made? The first one, I mean, where it was deliberately coded to ensure you only got a shorter URL if your starting URL was ... read more »

  • Ability To Leverage ColdFusion Bug Will Mean Errors Later

    Posted on Apr 7, 2009 at 11:35 AM

    Oh my god. That is perhaps the most horrible CFML ever, despite the fact that it works perfectly on ColdFusion. No offense, Ben, but dear god. If I ever see code like that in real life, I will beat the author senseless. Even if you live in Australia and it takes $2k and 30 hours to fly down ther... read more »

  • ColdFusion Bug: Arrays, ArrayLen(), And Implicit Structs

    Posted on Mar 26, 2009 at 4:43 PM

    Yeah, though I'm sure I'm not the only one. Everyone seems to run into it at some point. Here's the link to one of the posts. Neglected to put it in there the first time. http://www.barneyb.com/barneyblog/2008/07/14/coldfusion-struct-literals-fail-again/... read more »

  • ColdFusion Bug: Arrays, ArrayLen(), And Implicit Structs

    Posted on Mar 26, 2009 at 4:19 PM

    This is the same bug that I've blogged about several times. ColdFusion compiles this code: <cfset a[arrayLen(a) + 1] = { foo = 2 } /> into this: <cfset a[arrayLen(a) + 1] = structNew() /> <cfset a[arrayLen(a) + 1].foo = 2 /> This is a bug in ColdFusion's processing of struct l... read more »

  • Not Commenting And The Tipping Point Of Poor Programming

    Posted on Jun 5, 2008 at 11:02 AM

    Commenting code and writing readable code are one and the same, in my view, just the latter is more concise. If you don't have readable code, comments are needed, but they bring with them a maintenance burden because you're double representing. It's far easier to write your code in a readable way ... read more »

  • Compiling Several Linked Files Into One File

    Posted on Apr 8, 2008 at 4:16 PM

    You could repackage the aggregator as a Servlet filter, I suppose. Or fix CF's AJAX stuff. The former would probably be easier. ;)... read more »

  • Compiling Several Linked Files Into One File

    Posted on Apr 8, 2008 at 12:49 PM

    Here's how we do it, complete with code samples: http://www.barneyb.com/barneyblog/2008/04/08/build-time-aggregation-of-jscss-assets/ Figured that'd be easier than trying to communicate that in a comments discussion, though it probably robs Ben of some traffic. ;)... read more »

  • Compiling Several Linked Files Into One File

    Posted on Apr 8, 2008 at 12:10 PM

    Rather than doing it at runtime, why not do it at deploy time? We use a Ant script to aggregate all our JS/CSS files at build time, and then run the JS through the YUI Compressor. The result is nice modular JS/CSS at develop time and a compressed single file in production.... read more »

  • Using BitAnd() To Determine Odd / Even Rows (Thanks Tony Petruzzi)

    Posted on Mar 12, 2008 at 5:57 PM

    Since MOD and bit operations are so low-level, the overhead of the loop is going to completely drown out any performance differences between the actual test subject. Instead, I'd recommend manually copy and pasting your N iterations into a flat file. With compounding copy and paste, you can get a ... read more »

  • GetPageContext() Is Template Specific, Not Request Specific

    Posted on Aug 22, 2007 at 11:48 AM

    Ben, There's a difference between a PageContext and Request. A Request corresponds to an HTTP Request that CF (really, it's underlying JEE server) has been sent. There is a corresponding Response object that contains headers, the outputted content, etc. The PageContext object, on the other hand... read more »

  • Mom! Ben Broke My CFInterface!

    Posted on Jul 9, 2007 at 5:35 PM

    Interfaces are more useful for typechecks, not implementation validation. For example, passing an CFC instance of type IDog into a method that requires an IDog. Doesn't matter if it ultimately descends from AbstractCanine or if it's from FrankenDog, as long as it implements IDog, you've got what y... read more »