ColdFusion Contest - Final Entries

So, this contest has taken way longer than I thought it would, but that just speaks to how many responses I got, which I think is a good thing. If you haven't looked at the previous entries, I suggest that you do so. I'm going to quickly link to and point out the final two entries, and tonight I will pick a winner. (Along with releasing Starfish Version 0 hopefully.)

The first entry works pretty well, and has an interesting feature. If it catches you fibbing about your number, it will call you a lier. Nice. One thing I noticed about this sample is an odd use of "this" in the code. Here is a sample that I've mashed together:

<cfset request.this.title = "Guess The Number"> <cfset session.this.guessrange = 100>

I've pinged the writer to see why he uses scope.this.var and hopefully he will respond. That being said, I do have a problem with this. ColdFusion will let you automatically create a structure without using structNew(). Consider this code block:

<cfset z.y = "foo"> <cfdump var="#z#">

This works, but is dangerous. If for some reason you added <cfset z = 1> before the cfset above, the code will not work and will throw this error: You have attempted to dereference a scalar variable of type class java.lang.String as a structure with members. Simply adding the structNew() fixes the problem:

<cfset z = 1> <cfset z = structNew()> <cfset z.y = "foo"> <cfdump var="#z#">

So in general, I'd probably always recommend against relying on ColdFusion to automatically create a structure for you as the author did above.

The last entry gets bonus points for providing both a CFC version as well as a basic version. I didn't have much to say about this one so for now I'm just providing the links so folks can play with it.

So that's it! Tonight I will announce a winner (which I'm sure no one will disagree with, ahem) so check back again.

Archived Comments

Comment 1 by vishy posted on 10/25/2005 at 6:47 PM

where is my entry ray? I sent it to ray@camdenfamily.com on Fri, 30 Sep 2005 07:51:35-0700(PDT)

thanks
vishy

Comment 2 by Raymond Camden posted on 10/25/2005 at 6:53 PM

Hmm, I'm not seeing it. It is too late now, but if you resend, I'll be happy to look it over. Sorry about that.

Comment 3 by vishy posted on 10/25/2005 at 6:57 PM

just hit send button again....

thanks
vishy

Comment 4 by vishy posted on 10/25/2005 at 7:03 PM

Also, I posted a question last week to you regarding "Developing Swing like client/server applications in coldfusion", but didnt got any reply. here its again

Can we develop swing like client/server applications using flash and coldfusionmx? is it possible? if so, can you throw some ideas? Basically, I want to create a swing like applications with look and feel from flash and functionality using coldfusion.

thanks
vishy

Comment 5 by Raymond Camden posted on 10/25/2005 at 7:21 PM

Vishy - the Ask a Jedi pod has been very successful, so I've not had the time to respond to each and every question. I urge you to use the forums I set up (see link on the right) for immidiate help.