THE I-HATE-COLDFUSION CLUB?



  • cfscript != cftags != java errrr != c++ cfx ?



  • Waste of time. EVERYBODY hates coldfusion. I stumble upon a cfm page once every two thousand years.



  • @sadmac said:

    Waste of time. EVERYBODY hates coldfusion. I stumble upon a cfm page once every two thousand years.

     

    Thats not true... While I don't LOVE Coldfusion, I use it everyday, so I don't hate it. 



  • @sadmac said:

    Waste of time. EVERYBODY hates coldfusion. I stumble upon a cfm page once every two thousand years.

    MySpace seems to use it, *shudder*, just another reason to hate MySpace 



  • Me too! I just joined up 'cause of this thread so I could share some of my experiences. I'm forced to use Coldfusion at work for an old legacy website, and I hate, hate working with it. Here's some highlights for those who aren't familiar with it (Coldfusion version 4 BTW, It's not even a recent version of it, ugh):

    Basically every command, function, or tag starts with the letters "cf" so <cfif> <cfelse> </cfif>. It makes looking up commands in any sort of indexed manner ridiculous (there's an old manual, and the "C" page of the index is about 10 pages long and the entire rest of the index is less than that).

    Coldfusion sucks at whitespace management, because it's written in-line with the HTML. If you have a restriction on whitespace output (due to browser issues, script issues, etc), you have to put everything on one line with no spaces inbetween the tags. Go-go code readability.
    If you finally want to output one of your variables to the page, you have to explicitly declare an output portion of the page:
    <cfoutput>
    #allvariablesstartandendwithpoundbutnotalways#
    </cfoutput>
    However, even in sections of non-cfoutput tags, the whitespace is still output, so if you have all of your script at the top of a page, then you view the page on a browser and view the source, you end up with miles of whitespace before you arrive at any html. Additionally: the whitespace in loops is duplicated, wheeee.

    Passing conditional statements to things like loops is done via interpreted strings, IE:
    <cfloop condition = "CountVar LESS THAN OR EQUAL TO 5">
    (straight from the online manual). Yes, that's right, the conditions are written out in string form and passed to the loop. Also, you always need the name of the string passed to be "condition" if you have <cfloop dostuff="things to do"> it won't work.

    Here's another fun code example illustrating some of the above strong points of coldfusion:
    <cfif NOT isDefined("form.username")>
        <cfset form.username = "">
    </cfif>

    It's fun to share some of these WTFs that are just a part of the language itself, aside from the fact that the code I have to work with is written by people who specifically picked Coldfusion on purpose. You should see some of the mangling done to this already-horrible language. Admittedly, I believe that the newer versions of CF are infact "better" but there's only so much one can polish a turd.

    -EJ
     



  • @EJ_ said:


    However, even in sections of non-cfoutput tags, the whitespace is still
    output, so if you have all of your script at the top of a page, then
    you view the page on a browser and view the source, you end up with miles of
    whitespace before you arrive at any html.

    That explains a lot, always wondered why that used to seem to happen every now and then on myspace when I checked the html source for whatever reason.



  • Coldfusion is a bit like PHP, and having done a lot of both, I just want to say that ColdFusion is lightyears better in terms of readability, maintenance, etc. - if you put the tiniest bit of thought into it.  As you probably know, a lazy programmer can make anything look bad.  Coldfusion is also a lot better than Perl through CGI in my opinion.

    Basically every command, function, or tag starts with the letters "cf"


    Of course.  It' couldn't possibly be any other way.  If you're new to programming, try using macros.  I never actually type any of those tags.  I either have a macro or use a good editor like Eclipse that has tag completion.  I thought that everyone did that.

    It makes looking up commands in any sort of indexed manner ridiculous


    You use manuals?  Wow.  I think your problems are bigger than coldfusion.  Eclipse has context help you know.  There are also web references:  http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-pt0.htm#wp2425949

    Coldfusion sucks at whitespace management,


    Again, the problem here is your inexperience (and I mean that in a nice way).  Your business logic is supposed to be in objects, where the whitespace is restricted.  Here is a site that I did in coldfusion.  Note that I didn't have any issues with whitespace management.

    you have to put everything on one line


    lol.  I'm sorry dude, but no.

    If you finally want to output one of your variables to the page, you have to explicitly declare an output portion of the page:


    Just like in PHP.  That's pretty standard stuff.

    What most people do is "enablecfoutputonly" then they put queries and such at the top of the file, then they have one cfoutput, all of the page stuff, and then end cfoutput.  If your legacy code has more than one cfoutput per page that's just bad programming practice.

    even in sections of non-cfoutput tags, the whitespace is still output


    Only if you want it to.  I'm sorry that you don't know about coldfusion, but that's your problem, not a coldfusion problem.

    you end up with miles of whitespace


    I don't.

    Passing conditional statements to things like loops is done via interpreted strings,


    Clue: all text is strings.

    <cfloop condition = "CountVar LESS THAN OR EQUAL TO 5">


    You're intentionally misrepresenting things here. Making it seem like cobol.  For anyone who's actually interested, this would also work:

    condition="CountVar lte 5"

    or something like this:
        while (CountVar lte 5) {
            writeoutput("#CountVar#<br/>");
            CountVar = CountVar + 1;
        }


    <cfloop dostuff="things to do"> it won't work.


    I'm not sure what your complaint here is.





  • My original post (as I said) was about ColdFusion 4, which does not offer mechanisms to suppress the whitespace as you indicated :) I know it's an older version, but that's why I mentioned it. So, in one instance, I have had to put everything on one line, to suppress the whitespace, because of the requirements for input to another website.

    I also don't think it's unusual to have/use a manual for a language. I'm talking both online and offline manuals. Not everybody uses eclipse or an IDE at all. And yes, having everything start with "cf" does make looking things up in an indexed sort of way (say you can't remember the name of the function but you know the jist of it) online or offline quite difficult. I would also say that PHP (if you're going to compare the two) is quite a different style of language, with the only similarities to ColdFusion being that they're both often used for web scripting. I find ColdFusion much more difficult to use, read, and maintain than PHP, which is what the business I work for uses primarily now. I don't know of any other language than ColdFusion where every command starts with "cf". It is possible to write PHP in a similar manner as ColdFusion I suppose (every line starts and ends with <?php ?> etc) but I've never done that.

    That cfloop I posted about came directly from the ColdFusion manual (online). I'm not misrepresenting anything, that's how they lay it all out :) 
    http://livedocs.adobe.com/coldfusion/5.0/CFML_Reference/Tags61.htm#1101126

    I'm not trying to fan the flames or anything, and bear in mind this is for CF4. I'm sure the later versions are better at doing things, but I much prefer the likes of PHP for scripting.

    -EJ
     



  • Some followup thoughts:

    A lot of my anguish comes from the WTFery that this old version of a language (the old version being not-very-good) was used to write. Everything is written out in a way that just makes me remember back to my beginning days of Basic on the C64. There are no includes, no classes, no shared/common files whatsoever. There is the occasional incorrect use of an application.cfm, but that's all I can hope for. I've attempted a few times to revamp things and do it "the right way" but my attempts to fix and requests for embettering are always met with apathy by the high-ups. I'm not a programmer or even a webdev by training, I've just sort of fallen into that role. I went to school (and my interests lie) in Electrical Engineering, so I do have a programming background (assembly and C) but it's not oriented towards a software sort of ideal. It's similar enough that I can accomplish what I need to, though I'm sure compared to a "good" programmer I make my own fair share of WTFs. But, even I can tell that the old legacy code I've had dumped into my lap is complete poo, written in an old version of a language that makes it so much worse. That's what I wanted to share :) sorry if you took offense to me insulting a language you like.

    -EJ
     



  • @EJ_ said:

    My original post (as I said) was about ColdFusion 4

     

    oops.  Sorry.  Just poor reading comprehension on my part.  I can see how it would suck to maintain old, poorly written code like that.
     



  • ahhh can't believe somebody replied after 2 years i posted this !
    coldfusion should not be called a language or script. there should be a new name for it, and COMPLETELY seperated from other programming language.
    It is higher than high level language. I'd rather use COBOL.NET



  • @zzzxtreme said:

    ahhh can't believe somebody replied after 2 years i posted this !
    coldfusion should not be called a language or script. there should be a new name for it, and COMPLETELY seperated from other programming language.
    It is higher than high level language. I'd rather use COBOL.NET

    That's the WWW for you.  I've found fascinating usenet discussions a few years old and wanted to reply...then i notice the posting date.  I guess the moderator is not closing threads here! 



  • @ogilmor said:

    That's the WWW for you.  I've found fascinating usenet discussions a few years old and wanted to reply...then i notice the posting date.  I guess the moderator is not closing threads here! 

     

    And now that it's been bumped, it will attract yet more people to post to it now.

    Oh, the ColdFusion horror stories I can tell ya'll as soon as I can get around to anonymizing them.
     



  • I've been developing in CF at my current job for about 5 months now.  I've warmed up to it, but it still feels akward.  I don't get the impression that it's a platform on its deathbed as an article suggested a few months back.


    Most of my problems with it have come from shoddy, insecure code that I've inherited, and it's hard to blame the language for that.  It's the typical crap that you see in all too many web-based apps (not sanitizing input, relying on hidden form fields for information that should be retrieved from the server).  That, and the fact that nobody here scopes their variables to "local" scope like any sane language (in CF you have to explicitly define a variable with the var keyword to do this).  Too much spaghetti code....depressing. :(



  • i understand how u feel :-(
    CFIF and cohort is just terrible. I had to put everything in CFSCRIPT, write some shared functions to make other programmer's morale a bit better. But now i have another job, using all .net.



  • @EJ_ said:

    Coldfusion sucks at whitespace management, because it's written in-line with the HTML. If you have a restriction on whitespace output (due to browser issues, script issues, etc), you have to put everything on one line with no spaces inbetween the tags. Go-go code readability.
    If you finally want to output one of your variables to the page, you have to explicitly declare an output portion of the page:
    <cfoutput>
    #allvariablesstartandendwithpoundbutnotalways#
    </cfoutput>
    However, even in sections of non-cfoutput tags, the whitespace is still output, so if you have all of your script at the top of a page, then you view the page on a browser and view the source, you end up with miles of whitespace before you arrive at any html. Additionally: the whitespace in loops is duplicated, wheeee.

    I often find the same problem when JSP/JSTL - so much white-space in the rendered html! What I've done (when I can be bothered) is write an additional build target to remove the additional white-space (eg: no more than one space between characters unless in <pre> blocks etc) from the jsps, so your original source is all nicely indented but the deployed code has the gumph taken out - and it often produces substantially smaller html output. Not sure if you can apply the same thing to Coldfusion, but it might help.



  • Licky Lindsay, love the avatar, i always liked fussball girl more than beanbag girl(just for the record i think fussball girl would hate cold fusion too)



  • @element[0] said:

    Licky Lindsay, love the avatar, i always liked fussball girl more than beanbag girl(just for the record i think fussball girl would hate cold fusion too)

    I live in constant fear of the day when the people who created FBG send me a cease-and-desist.

    Have you noticed how CF apps tend to go nuts with the octothorpes? It's like once people learn that you need them for output:

     <cfloop query="3atm3">
          #fooz#
     </cfloop>

    .. they want to use them everywhere. Eventually you see things like this:

     <cfif #a# eq #b#>
         <cfset #c# = #d# + #e#>
     </cfif>

    None of the pound signs in that second example are needed, but people use them anyway because they never bothered to learn when you need them and when you don't. The fact that the language allows them all is kind of a WTF.



  • @zzzxtreme said:

    cfscript != cftags != java errrr != c++ cfx ?

    I cant believe that no one mentioned this in this thread :

    When you work with components (and if you want a half decent OO design you have to), you will soon stumble on this rather annoying fact :

    In coldfusion ALL VARIABLES ARE GLOBAL !!!

    That means if you do this in one method

    <cffunction name="FRIST" returntype="void" ....>
        <cfset var idiot = "coldfusion designer"> 

        <cfinvoke method="second">

    </cffunction> 

     and in the second method you do this :

    <cffunction name="SECOND" returntype="void" ....>

        <cfoutput>#idiot#</cfoutput> <!--- This shows you really who the idiot is --->

    </cffunction> 

     
    And I'm just getting started:

    - No debugging possibilities (heard that in CF8 they did some Eclipse thing, did no try it yet)

    - When we are talking about Eclipse - no ide (tried cf_eclipse, aaaaargh, makes me close every <cfinvoke />, that I could swallow, but has MAJOR problems with UTF-8, I had customers calling every day)

    - Has anyone succeeded in using cfcache on a server configured for any timeformat other than american ? I gave up, wrote my own, (works like a charm by the way)

    - The Java Interface #!@!"#!$&&#$#. "Whenever possible, ColdFusion automatically matches Java types to ColdFusion types." Yeah right. Why do we need JavaCast then.

    -  Big queries. The bigger the query, bigger the problems. And I'm not talking about hundreds of thousands of rows, a 1000 rows is enough when you have over 100 columns. It can kill the CF server.

    - cfhttp and SSL ... --- ... --- ... --- ... --- ... Save my soul

     
    and the sad thing is, I still love CF :)

    - I can drop down to java when ever I want and write nice underlying classes and call them (almost) transparently.

    - cfquery and query objects are great (even though they have problems with big queries)

    - cfchart, enough said

    - great string manipulation functions

    - SOAP Webservices out of the box

    - cflogin, isUserInRole, entire user management framework nicely implemented and easy to use

    - Flex/Flash Remoting

    and I have heard that Mach II is really good.

     



  • @Nelle said:

    I cant believe that no one mentioned this in this thread :

    When you work with components...

    Because if you find yourself maintaining an app with CFCs then you're lucky. My experience with "code reuse" in CF was more like:

         <cfset partid = 42>

         <cfinclude template="c:\inetpub\wwwroot\blub\getparts.cfm">

         <cfoutput>#parts.name#<cfoutput>

    And getparts.cfm:

        <cfquery name="parts" datasource="partsdb">
            select * from parts where partid = #partid#
        </cfquery>

     Then again I hung up the CF hat quite a while back, so maybe the situation has improved. But note that when the code was written, they might not have had CFCs but they did have CFMODULE and custom tags, and they didn't use those... so why would the same idiots be expected to use components now?

     


     

     



     



  • @Licky Lindsay said:

    @Nelle said:

    I cant believe that no one mentioned this in this thread :

    When you work with components...

    Because if you find yourself maintaining an app with CFCs then you're lucky. My experience with "code reuse" in CF was more like:

         <cfset partid = 42>

         <cfinclude template="c:\inetpub\wwwroot\blub\getparts.cfm">

         <cfoutput>#parts.name#<cfoutput>

    And getparts.cfm:

        <cfquery name="parts" datasource="partsdb">
            select * from parts where partid = #partid#
        </cfquery>

     


    OMG, and using absolute paths !!

     @Licky Lindsay said:

     Then again I hung up the CF hat quite a while back, so maybe the situation has improved. But note that when the code was written, they might not have had CFCs but they did have CFMODULE and custom tags, and they didn't use those... so why would the same idiots be expected to use components now?

     

    Because components are sooooo enterprisey :) You can even use SOAP to access them :)
     


     

     



     




  • @Nelle said:

    OMG, and using absolute paths !!

     Well, to be fair, it was usually more like this:

          <cfinclude template="globals.cfm">
         <cfset partid = 42>
         <cfinclude template="#blubdir#\getparts.cfm">
         <cfoutput>#parts.name#<cfoutput>

    And getparts.cfm:

        <cfquery name="parts" datasource="#dbname#">
            select * from parts where partid = #partid#
        </cfquery>

    And in globals.cfm:

        <cfset blubdir = "c:\inetpub\wwwroot\blub">
        <cfset dbname="partsdb">
     



  • @Licky Lindsay said:

    @Nelle said:

    OMG, and using absolute paths !!

     Well, to be fair, it was usually more like this:

          <cfinclude template="globals.cfm">
         <cfset partid = 42>
         <cfinclude template="#blubdir#\getparts.cfm">
         <cfoutput>#parts.name#<cfoutput>

    And getparts.cfm:

        <cfquery name="parts" datasource="#dbname#">
            select * from parts where partid = #partid#
        </cfquery>

    And in globals.cfm:

        <cfset blubdir = "c:\inetpub\wwwroot\blub">
        <cfset dbname="partsdb">
     

    Ask to rewrite it ... Asap ...
    It will be less stressful and quicker than maintaining such a nightmare ...

     



  • @Nelle said:

    Ask to rewrite it ... Asap ...
    It will be less stressful and quicker than maintaining such a nightmare ...

    Well, too late for that, for me at least. I switched to Java years ago. Not that Java doesn't have problems of its own but at least they're different ones than these.

    But I believe the application in question is still merrily running with its global variables causing people to pull their hair out every day.

     



  • ok. a little late, but i'll tell you a little bit about coldfusion :

     variables used in a function will be automatically declared in your objects (already mentioned above)

    the hashing on the structures is really bad, but it can be replaced with a java hashmap and as an added bonus it gets case sensitive. (see http://cfdumped.blogspot.com/2006/09/bad-hash-function-causes-problems-with.html for more info, especially about performance)

     coldfusion arrays are around 4 times slower than java arraylists, i have no clue why.

    the whitespace in your objects is outputted to the resulting page on construction of it, unless you specifically disable this. and for functions too.

     the "type" you specify for a function can be a primitive or object (not that the check really matters since for example "0A" is a date and "0e" is numeric).

     metadata about queries (table stuctures and such) are cached by the application server per query, so when you do an alter table you must restart the coldfusion server (or rename the datasource, or flush it some other way. 

    array's are passed by value to functions (yes, try it...)

    "06A" eq "0.25" because 6:00AM is a quarter of a day (yes, all your string compares will be fucked up and not trustable, and there are many more cases like this)

    oh man, did i mention the annoying  and unreadable syntax? very likely i missed a lot, but this should give a good indication about the quirks i found out. soon i switch to java programming, and i'm even happy about that. 

     

     

     



  • @Licky Lindsay said:

    @Nelle said:

    I cant believe that no one mentioned this in this thread :

    When you work with components...

    Because if you find yourself maintaining an app with CFCs then you're lucky. My experience with "code reuse" in CF was more like:

         <cfset partid = 42>

         <cfinclude template="c:\inetpub\wwwroot\blub\getparts.cfm">

         <cfoutput>#parts.name#<cfoutput>

    And getparts.cfm:

        <cfquery name="parts" datasource="partsdb">
            select * from parts where partid = #partid#
        </cfquery>

     Then again I hung up the CF hat quite a while back, so maybe the situation has improved. But note that when the code was written, they might not have had CFCs but they did have CFMODULE and custom tags, and they didn't use those... so why would the same idiots be expected to use components now?

     


     

     



     

     

    Oh somebody's god, no word of a lie that could be copied word-for word, verbatim, from the code at my work. Even down to the idiot naming of include pages that are so generic they could be anything. On top of that, we'll have "getpart.cfm", "getparts.cfm", "getnewparts.cfm", "getparts_new.cfm", etc... I know you haven't worked where I do, I've been the only CF dev for a number of years, but damn... It's spooky.

     -EJ
     



  • Bump. The example I gave in this WTF discussion happens to be CFML: 

     

    Although it would be just as much of a WTF in any language. 



  •  Back long not after Y2K I was working with ColdFusion + AbleCommerce. What a nightmare! Luckilly we had the full source version of AbleCommerce. There was the problem that in all their code where they would do something along the lines of "if product name = variable" or something to that effect (not the exact code obviously) that they never put quotes around the variable and CF would expand the variable THEN compute the result - with the disaster of anything with a space or other delimiter in the value (name, or whatever) would break it. I had to go through and fix the entire damn package! How AbleCommerce never caught that bug all over the place I'll never know. The fact that it IS a problem AND NOT (at the time anyways) DOCUMENTED was just crazy! That and the other generaly WTFery of the ColdFusion of the time led me to hate it ever since. I hear its not so bad now, but I'll never touch it again if I can help it.



  • @BioSehnsucht said:

    RISE FROM YOUR GRAVE!!!
    Finally, some necromancy I can get behind!



  • @bstorer said:

    Finally, some necromancy I can get behind!
     

    You are so erotic sometimes!



  • @BioSehnsucht said:

    Back long not after Y2K I was working with ColdFusion + AbleCommerce. What a nightmare!
     

    Worked with that package myself, full source thankfully too.

    One thing that was really messed up that I found, is the 'image browser' for the shops (we had a 'mall' setup with tons of stores, each able to create admin accounts for say, some joe uploading product images) had the image path hidden in the URL of a frame... not only could you override that path to ANYTHING on the server, but you could overwrite CF files (not just images).  I actually was able to upload and execute any cfm I wanted.  Could have even replaced the Cybercash crap with something that forwarded on the CCs for all customers visiting ANY store on the site.

    Was working with CF 4/4.5 back then, and if you ever want to hate a package, try writing a recursive function without being able to define...functions - only cfincludes.  Each plain old variable had to be an array and the recursive iternations stepped in and out and values set etc to mimic the ability of a simple easy recursive function...very painful.

     
    Another WTF I've found, is nested cfloops with queries get completely jacked - even using the correct query namespace does no good, you have to set atitle=querya.title before you loop and output queryb.title or you'll loose the correct value - querya.title will no longer contain the original value.  That's in CF 8...not 4.  Had similar issues with recursive cfdirectory returns.  Gets exceptionally annoying.

    It is the most 'designer friendly' language that I've run across though.  The application.cfc does make it easy to seperate persistant application state data, from session and request data etc.  It has a lot of strengths as a framework, but gets frustrating when the framework throws those sorts of bugs at you.

    Oh, while its moved towards OOP with the components, its still a mess of "arrayLen, arrayAppend..." etc global functions.  ListContains will actually take an item "ab" and find it in a list "dd,aabc,ee" etc.  Annoying if you want to see if a list actually contains a value.



  • @BeenThere said:

    Another WTF I've found, is nested cfloops with queries get completely jacked - even using the correct query namespace does no good, you have to set atitle=querya.title before you loop and output queryb.title or you'll loose the correct value - querya.title will no longer contain the original value.  That's in CF 8...not 4.  Had similar issues with recursive cfdirectory returns.  Gets exceptionally annoying.

    It drives me crazy, I even started using index, from, to for all nested query loops ...

    @BeenThere said:

    ListContains will actually take an item "ab" and find it in a list "dd,aabc,ee" etc.  Annoying if you want to see if a list actually contains a value.

    Not to mention that listLen(",,,,,,") eq 0 ...



  •  I@BeenThere said:

    Another WTF I've found, is nested cfloops with queries get completely jacked - even using the correct query namespace does no good, you have to set atitle=querya.title before you loop and output queryb.title or you'll loose the correct value - querya.title will no longer contain the original value.  That's in CF 8...not 4.  Had similar issues with recursive cfdirectory returns.  Gets exceptionally annoying.

     

    I ran into this problem for the first time a few weeks ago and it seriously pissed me off.  There is no excuse for this to be happening in a language as old as ColdFusion.  That's probably the most blatant bug I've ever seen in a programming language.  I don't remember how I got around it...I think I used an indexed cfloop or something.   



  • Not sure if this should be an "I hate mysql", "I hate ColdFusion", or "I hate the fact that we haven't upgraded to ColdFusion 8" Club post, but here goes:

    We have some page-level and directory-level rules that need to be checked before displaying content on certain pages.  The rules are stored in the database by their URL, so I need to execute a query with the current URL as one of the parameters.  I realize that we should be using stored procedures instead of ad-hoc queries, but they just aren't used at this place (in fairness, they are a relatively recent addition to mysql).  This isn't a huge deal since ColdFusion has a <cfqueryparam> tag that allows you to write a parameterized query that is not vulnerable to injection.  However, as of CF7, <cfqueryparam> will not work if you want to cache your query, and I am required to cache this query.


    This still shouldn't be a problem because ColdFusion should automatically escape single quotes in a <cfquery></cfquery> tag.  However, this doesn't seem to work properly in all cases.  We have a couple "links" to java-script functions scattered through the site.  If somebody doesn't have js enabled or a bot/spider is crawling the links, it will attempt to access something like http://www.example.com/\"javascript:js_function(\'blah\',\'blah,blah\');\".  Of course, this goes to our standard "404 page not found" page, but my query logic still needs to be executed on those pages.  That ugly URL is enough to mess up the query, because ColdFusion doesn't escape it properly.

    Until we upgrade to ColdFusion 8, all I can really do is try/catch and basically ignore any errors that occur.  *SIGH*

     



  • @bighusker said:

    "I hate the fact that we haven't upgraded to ColdFusion 8" Club post
     

    we did. a couple of months ago. and with the help of the new shiny flex "server monitor" found out there were couple of requests slower than 3 seconds. actually slower than 3 minutes ...

    couple of minutes later, found a cfhttp request to a foreign server in one of the scheduled tasks that runs every 15 minutes. the foreign server in question was down. we knew that the server is often unavailable, so as we implemented the app, we decided to implement 5000 msec timeout. it was pretty easy, just standard <cfhttp timeout="5000" .....>, wrapped it in try-catch, logged the message in the DB when it times out and everyone was happy until we upgraded to cf8.

    couple of hours later i discover that the timeout parameter for cfhttp was changed from msec to sec in the cf8.

    thank you adobe for pointing that out in release notes.

     

     

     



  • @Nelle said:

    couple of hours later i discover that the timeout parameter for cfhttp was changed from msec to sec in the cf8.
     

    Here's the documentation for version 7.  According to this, the timeout was always seconds: http://livedocs.adobe.com/coldfusion/7/

    And here's the documentation for version 6.  It also says seconds: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/Tags-pt154.htm#1632966

     

     



  • @bighusker said:

    as of CF7, <cfqueryparam> will not work if you want to cache your query

     Just to be clear, cfqueryparam automagically caches the execution plan for the query.  That's what most people want.  It sounds like what you're wanting to do is to cache the output of the query.  In that case, I suggest that you dump the output into an application or session scope variable.  Option 2: you can do what cfqueryparam does but you do it manually.  Meaning, replace this: <cfquery>select lastname from person where age > <cfqueryparam value="9000"/> </cfquery> with this: <cfquery>declare @param int = 9000 select lastname from person where age > @param</cfquery>

     That should result in a query that caches its execution plan and lets you use coldfusion's built in output caching.  Of course, you have to guard against sql injection on your own now.

    Full disclosure: I don't know for sure if that will work in mysql.  With MS sql server though, I've found that caching the execution plan has always been good enough, and I didn't actually gain anything by caching the output.  YMMV



  • @BeenThere said:

    ListContains will actually take an item "ab" and find it in a list "dd,aabc,ee" etc.  Annoying if you want to see if a list actually contains a value.
     

    RTFM. The documentation for the listContains() function makes it very clear that it finds an item in a list that contains the SUBSTRING you pass as input.

    From your complaint, it sounds like you're unaware of the listFind() function.  listFind("dd,aabc,ee","ab") returns 0.  That's what you wanted, right? 



  •  @tofu said:

    According to this, the timeout was always seconds:

    i stand corrected ...

    actually i stand as a complete idiot ...




  •  @tofu said:

    @bighusker said:

    as of CF7, <cfqueryparam> will not work if you want to cache your query

     Just to be clear, cfqueryparam automagically caches the execution plan for the query.  That's what most people want.  It sounds like what you're wanting to do is to cache the output of the query.  In that case, I suggest that you dump the output into an application or session scope variable.  Option 2: you can do what cfqueryparam does but you do it manually.  Meaning, replace this: <cfquery>select lastname from person where age > <cfqueryparam value="9000"/> </cfquery> with this: <cfquery>declare @param int = 9000 select lastname from person where age > @param</cfquery>

     That should result in a query that caches its execution plan and lets you use coldfusion's built in output caching.  Of course, you have to guard against sql injection on your own now.

    Full disclosure: I don't know for sure if that will work in mysql.  With MS sql server though, I've found that caching the execution plan has always been good enough, and I didn't actually gain anything by caching the output.  YMMV

     

    I saw another website that suggested storing the output of the query in an application variable to emulate caching, but I'd need to store these results in a struct/associative array since the query parameters are dynamic and won't always result in the same SQL being executed.  The cachedwithin attribute of <cfquery> only uses a cached query if the SQL is exactly the same in the cached version.  Basically, I'd have to keep track of which "cached' query belongs to which SQL code.  That's a reasonable suggestion, but I'm not sure if having that many application variables would affect performance.

    I'm not sure option #2 would do much good because I'd still have to place the value of the ColdFusion variable into the SQL statement somewhere (i.e. declare @param varchar(255) = '#URL#' )....and that still has the original problem of strings not getting escaped properly. 

     

    And yea, I'm not sure that caching the query is gaining anything in this case because the table will always be relatively small and the query should only ever return 1 record....but my boss is convinced that query-caching is the ultimate God-send.  Come to think of it, I'm beginning to wonder if this is something buggy with our configuration.



  •  Cold Fusion Sucks

     But maybe I have a biased opinion from the piss poor job the last programmer did at writing well organized, well documented code...

     But, I did manage to get the company to switch to PHP/(Whatever Database We Use) back end, and I try to keep my code well organized, maybe not commented, but well organized.

     So my nightmare with coldfusion is basically the lack of {} and the lack of arrays.

     Sometimes, you just want to grab all the results from a query and toss them into an array (especially when you're trying to optimize to avoid repeating the same query a billion times) Something that ColdFusion did not seem to have.

     Then there was the fact that the former programmer set up a hybrid flatfile/database system for storing data (:: shudders ::) fracking nightmare.

     In short, at the end of dealing with the poorly organized code, and the poorly thought out storage, I wont go near plain cold fusion again.

     Now, Cold Fusion Script on the other hand, I can deal with, it's a C#/C++/PHP/Perl like construct that is 10x better than the tags.



  • @Drakhelm said:

     Sometimes, you just want to grab all the results from a query and toss them into an array (especially when you're trying to optimize to avoid repeating the same query a billion times) Something that ColdFusion did not seem to have.

     

     Sorry, every Coldfusion structure is available as an associative array by default.  This includes queries.  

    If you don't want to repeat a query "a billion times" you could always just cache it.  Or store it in a shared scope. 


Log in to reply