• Home
  • More…
  • Archives
  • About…

NUKLEOS weblog

Virtual Memory (Resurrected)

Feeds:
Posts
Comments
« Jigsaw Art By Tim Klein
The R1100S Remains Fascinating »

I Knew It Happened Before…

20/11/2018 by Wouter

I encountered this weird situation last week: while testing ColdFusion code from a previous decade, I would see the output of part of the screen twice. Just like that – I had not changed a thing to the logic of the code, just cleaned up a bit of what I consider to be “bad” formatting in code written by others a long, long time ago (2005 or so).

I spent hours of debugging the code, even invited a few colleagues to help me – and then suddenly it struck me: CFML may look like XML, but it isn’t XML. Some CFML tags do their thing a second time when the tag is explicitly closed. One of those tag is <cfmodule>. I never use it myself – I prefer components and functions. But the code under scrutiny included a <cfmodule template='whatever.cfm >, and to “clean things up” I had added a slash at the end, like this: <cfmodule template='whatever.cfm />. Hence the double execution. So don’t do that, will you? Avoid closing <cfmodule>!

You can imagine my state of mind when I realised my error, don’t you? Yeah… I had seen this problem before, but much too long ago to actively avoid it in practice.

Before lecturing me on the subject: I know, I should be writing cfscript… but I don’t have the luxury to rewrite code that is more than 10 years old. So it will stay as it is.

Also: I consider this to be a bug in Adobe ColdFusion (at least in versions 6, 8 and 11). There’s no logical reason for such behaviour. I don’t know if Lucee or BlueDragon act similarly, but I hope they’re smarter than that!

And for the record: for me, code is “badly” formatted when it is hard to read – by me. I know compilers and computers have no trouble handling things like whole programs on a single line, or lacking coherent indents (unless it’s Python, of course), or unclosed XML tags (elements), to name but a few examples. I want code to easily readable by humans, and certainly by me – especially if I’m responsible for its maintenance…

Share this:

  • Twitter
  • LinkedIn
  • Email

Like this:

Like Loading...

Related

Posted in ColdFusion, Software Development |

  • My Activity

    November 2018
    M T W T F S S
     1234
    567891011
    12131415161718
    19202122232425
    2627282930  
    « Oct   Dec »
  • My Favourites

    • Ars Technica
    • bvlg.blogspot.com
    • ColdFusion Bloggers
    • Digital Photography Review
    • George Monbiot
    • Heise News Ticker
    • Jamie Todd Rubin
    • Jon Udell
    • Planet Python
    • Scripting.com
    • Seth Gottliebs Blog
    • The Electronic Intifada
  • My Sites

    • Innologos
    • My photos (Flickr)
    • N U K L E O S
  • On Probation

    • Artima Weblogs
    • Ruby Inside
    • The Cult Of Mac
    • The Unofficial Apple Weblog
  • My Categories

    Android Apple & Macintosh ColdFusion Content Management Design and Art Internet Java Linkrot! Linux Literature Mobile Computing Motorcycles Music Patents, IP, Privacy and More PDA Personal Photography Privacy and Security Python R1100S Ruby Science Social Media Society Software Software Development Technology Ubuntu Web Development Wiki
  • My Photos on Flickr

    P1020834P1020823P1020479
    More Photos

Blog at WordPress.com.

WPThemes.


loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
%d bloggers like this: