- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Obviously, doing it three times would require changing the code in three places if the query were to change. This way, it only changes in two places. That's 33% better!
Admin
If I read it right, this shouldn't even run, because the CFIF tag uses the variable named GetUserDate, instead of GetUserData.
Admin
Well, I commend the developer for implementing retry logic into their code, many of you would just let it continue on if no users were returned. One 1 retry may not be enough, so it should have been done like this in order to be more robust (Note the CFIF is changed to CFWHILE). I would also copy the CFPARAM line and put it in the while loop in case Attributes.UserID changes...
Admin
Actually what would happen is that you would get an error saying that RecordCount is undefined in GetUserDate.
--The Dan
Admin
Anonymous:
I have to assume you're joking, if I'm reading this right, since in the case where no data is found you have created an infinite loop.
Admin
Cool, so you end up having the possiblity of an infinite loop if no data is present or something else gets wrong? Your users will love you! ;)
Admin
Sarcasm guys.... Sarcasm.
Admin
Anonymous: That's why I was hoping your joking. Since so many comments are WTFs in and of themself!
Admin
Wow. ColdFusion is a WTF..
No wonder it died such a quick death. Though, I question the integrity of those who touted its wonders.
Admin
CF was/is only really meant for small site developed by script jockeys.
Admin
Coldfusion is not dead. It gets an unfair treatment. Just because its easy to write doesn't mean it isn't powerful. I'd say for 95% of all website applications CF is more than capable of being used.
--The Dan
Admin
We've all learned OOP, now it's time to learn POP... Persistence Oriented Programming. [H]
Admin
If you take anything out of context, it will seem ridiculous. The DailyWTF posts as of late have all been pretty lame.
Admin
You mean like this:
"you ... will seem ... pretty lame."
Admin
I would say.. just be glad it's not in a loop. haha
<CFxxx> is so dirty.
Admin
What is the point of the rerty logic in the first place? (No, I'm not a ColdFusion programmer) I can see making a case for an error condition but retrying on valid empty data seems redundant.
Can any ColdFusion guru shed some light?
Admin
No this makes no sense at all. The GetUserDate.RecordCount should throw an exception because it's misspelt. And it makes zero sense to try the same exact query again unless you're expecting the user to be added into the system in the nanosecond it took the first query to run. Also, what's so special about user 15 that you would make him the default user? Just weird.....
Jim - Macromedia Certified ColdFusion Developer
Admin
Maybe this piece of code has been shown wayy out of context. For all we know, GetUserDate may be the intended action (all evidence to the contrary[:)] )
Admin
I dunno man.. ColdFusion used to describe Developer sounds like an oxymoron.
Admin
The CFWhile loop idea is correct. It is not an infinite loop at all. It will terminate as soon as a row is added to the Users table whose UserID field contains a value equal to Attributes.UserID.
As Douglas Adams' plane said, "The statistical likelihood is that other civilizations will arise. There will one day be lemon-soaked paper napkins. Please return to your seat."
Admin
IAACFG (I am a ColdFusion Guru) and this is just crappy code in any language, ColdFusion included. I see no rational reason for this code to exist one way or another short of causing an infinite loop until you blow ColdFusion's stack in query tries per request (I've wondered if there's a limit to the number of queries per request, looks like this code could reach the limit).
Of course you think that's bad, I can personally own responsibility to creating an Infinite loop over a CFMAIL tag. Yup you guessed it quite a few people received a few thousand email messages each and were NOT happy.
Admin
ROLF. I've done similar things in the past... [:P]
Admin
And of course I can't type this morning... That should be ROFL.
Admin
I like reading the daily updates here, but the air of superiority in the replies today is a real turn-off. ColdFusion may not be the most versatile tool for site development, but it does the job and its ease of use is its real strength IMHO. Those of you who would take pot-shots at people who know ColdFusion well need to get a fucking life. =)
Admin
Of course you think that's bad, I can personally own responsibility to creating an Infinite loop over a CFMAIL tag. Yup you guessed it quite a few people received a few thousand email messages each and were NOT happy.
+1:
I once created an infinite loop while saving an XSL file from a web service. It was 15GB by the time i could turn off its IIS application.
Admin
People who claim here that Coldfusion is either dead or a "script kiddie" language don't know wtf they are talking about. If anything, it is ASP .NET that's the script kiddie language. Watching our .NET devs creating pages, they all just drag and drop shit into their cute little IDE. Then when something needs to be changed they don't know WTF to do, since they never actually WROTE any code.
Admin
Don't confuse ASP.NET with Visual Studio .NET. It's perfectly possibly for a grizzled, war-scarred veteran to create an enterprise application with nothing more than a text editor and the command-line compiler in .NET. It's just not particularly productive.
I have little sympathy for people who never visit the code and work entirely in the designer, but I am certainly not opposed to doing the bulk of the monkey work in the designer -- any other approach (in production, not instruction) is typing as self-flagellation. Nobody had ever done anything so heinous that they need to code that much as an act of contrition.
Admin
Maurits said: The CFWhile loop idea is correct. It is not an infinite loop at all. It will terminate as soon as a row is added to the Users table whose UserID field contains a value equal to Attributes.UserID.
Are you serious? It's hard to tell who's joking and who isn't lately.
Maybe we're both right.
It IS an infinite loop if no records get added to that table. Anything that loops until data is present will be inifinte if that data never gets added.
YES, if someone does happen to add a row to that table, it wouldn't be infinite.
Perhaps we're splitting hairs here. Fair enough. It isn't ALWAYS infinite in all cases, but has a high probability of being infinite, depending on what code or process is responsible for adding user records.
Admin
Also, don't confuse so-called .NET developers who can't actually write code with actual .NET developers who use the tools as appropriate, AND can handle changing generated code and adding their own. Just because the company you work for hired the former instead of the latter doesn't reflect on anyone other than the HR people at your company.
-David
Admin
I was joking with my infinite loop comment, of course. Guess you're not a fan of the Hitchhiker's Guide to the Galaxy books.
Admin
15GB? lame. a week ago i was doing some server migration, and failed to notice that one particular script did basically this:
and guess what? the file.dat was not present on the new server.
57GB of warnings in the log file by tenth invocation of the script...
lucky we've done this on saturday night, so there was nothing like the usual traffic
Admin
That looks alot like PHP so I assume it is. I don't really know php, so answer me this: why doesn't feof() return true if you pass it a pointer to a non-existing file? Looks like the language is lacking there...
Admin
RE: That looks alot like PHP so I assume it is. I don't really know php, so answer me this: why doesn't feof() return true if you pass it a pointer to a non-existing file? Looks like the language is lacking there...
Yeah, that does seem kind of odd. IMO, I don't think that returning TRUE OR FALSE makes any sense - if you're using an invalid file descriptor, you should get either a runtime error, or the function should use an integer return value with some constants defining yes, no, and error.
On the other hand, if the above code checked the value of $f after the fopen statement for a valid handle, ie "if ($f) { ..do work.. }", then there would be no problem.
Admin
<font face="Arial" size="3">Ok, the GetUserDate is a type-o, people. It's not the wtf.
The wtf is running the query twice. End of story. I'm sorry if you all thought that was lame. I didn't. Or rather, I thought it was lame, which is why I sent it in.
[+o(]
Jason </font>
Admin
I emailed this code in.
And, apparently, when I posted it, I made a type-o. The GetUserDate call is a type-o in the email, not in the code.
Blech.
So that's not the wtf. The wtf is running the damn query twice. On the same data. For no apparent reason.
My personal wtf is not being able to type.
And CF rocks. Big time. It's a really sweet language/platform. Don't diss it cuz it's easy. :)
Admin
Of course, my second WTF was not noticing that there was more than one page of comments, and, not seeing my previous comment, posting it.
At which point I noticed the second page.
Damnit. Need more sleep or more coffee.
Admin
I can say with certainty that cold fusion is not particularly easy, nor is it powerful. I have made a living going in to companies that run cold fusion and ripping it out and replacing it with asp.net and to this day not one of the companies I have done this for has been sorry they switched quite the opposite. The only and I mean only selling point cold fusion had over other script based crap was it could possibly run on other platforms then windows, but guess what? So far every company I have come across running cold fusion have been running it on top of Windows so go figure.
Admin
Ripping out ColdFusion to replace it with ASP.NET? Is that a smart move? If I understood correctly, ColdFusion is a platform-independant development system. You can run the server on both Unix and Windows. By replacing it with ASP.NET you make it harder for companies to move over to Unix. So in a way, you're making life easier for Microsoft by making sure companies cannot migrate to another platform for their servers.
But okay, if the only companies that you've encountered use ColdFusion on Windows then I wonder what would be a smarter move... Replacing ColdFusion with ASP.NET or replacing Windows with one of the many Unix flavors...[:D]
Admin
Possibly true but irrelevant.
ColdFusion is a proprietary language controled by a single company(Macromedia). It will run on platforms that this company chooses to write interpreters for.
ASP.NET is a proprietary environment, but with an open specification. One company (Microsoft) has provided an implementation for the Windows platform, but other groups have written implementations for other platforms ("Mono" is one for Linux, althought I'm pretty sure there's another one for Linux)
Admin
> ColdFusion is a proprietary language controled by a single
> company(Macromedia). It will run on platforms that this
> company chooses to write interpreters for.
ColdFusion is as open a specification as ASP.NET, and has been implemented by other companies, the most successful being New Atlanta, which has implemented CF for both J2EE and .NET (crazy, but true).
-Joe
Admin
> I can say with certainty that cold fusion is not particularly easy, nor is it powerful.
It is both. I can safely assume you don't know much about it, given that you can't spell it correctly (ColdFusion).
> I have made a living going in to companies that run cold fusion and
> ripping it out and replacing it with asp.net
I get paid to do the opposite - not much of an argument, is it?
> The only and I mean only selling point cold fusion had over other script
> based crap was it could possibly run on other platforms then windows
CF is no longer script-based: there are a lot of people implementing OO applications in CF. Also, now that it's a J2EE application (and a .NET app, thanks to New Atlanta), it's a really fast way to do presentation tiers on top of either.
I do C# (which I absolutely love as a language), Java, and CF development - all three are great, but for both writing a good architecture quickly and for getting a site up and running, you really can't beat having a good grasp of CF. Except maybe with Ruby/Rails.
-Joe
Admin
> I wonder what would be a smarter move... Replacing ColdFusion with
> ASP.NET or replacing Windows with one of the many Unix flavors..
Any Unix flavor would be an improvement!
Admin
love converse all star,love yourself.Just have a look,you will like it.http://www.conversewu.com