Skip to main content

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 »

  • 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 »

  • 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 »

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

    Posted on Apr 30, 2007 at 3:53 PM

    I don't know about anyone else, but interpreting the bitwise operator is a lot less obvious to me compared with a simple MOD operation. When you're programming at the level (with respect to the CPU) of ColdFusion, shaving a few processor instructions is completely folly. First, the language is inh... read more »

  • ColdFusion Custom Tags And High Coupling

    Posted on Nov 7, 2006 at 4:07 PM

    As I see it, there are two main types of custom tags: One is library tags which are application neutral and do some task. For example, I have a 'tovar' tag that acts like CFSAVECONTENT but with the ability to append or override, as well as accept a VALUE attribute. I use it all over the place. S... 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