I recently came across a problem that I thought was a bug and it was dealing with the new scripting features. I was trying to set some attributes in cfscript using the new javadoc syntax. What I thought was that ColdFusion was reading the information from the comments and I was always a little confused on how it would know that this was an attribute deceleration versus a plain old comment. The problem I was having with the code below is that it was not actually extending my abstract service like I intended. You don't actually need the script tags but for code coloring purposes I am using them. Can you spot the problem below?
If you said that I was using comment syntax instead of the javadoc syntax you are correct. I was not even aware there was a difference until someone pointed it out to me on one of the forums. The javadoc syntax starts with /** not /*. So if we update our code it should look like this.
This brings up another good question though. I actually prefer this method. I have gone back and forth but I thinks when I am working in script this just feels right to me. Mixing attribute into script like the code below just does not. What does everyone else think? Do you have a preference and if so why?

#1 by Nathan Mische on 8/24/09 - 9:42 AM
There should be some other syntax for this. Java or ActionScript annotation syntax would seem to make sense to me.
#2 by Nathan Mische on 8/24/09 - 9:57 AM
#3 by Terrence Ryan on 8/24/09 - 10:48 AM
#4 by Jason Fisher on 8/24/09 - 1:13 PM
component extends="AbstractService" output="false" {}
The option Terrence points out is cleaner:
component {
extends="AbstractService";
output="false" ;
}
That still feels a bit odd, though, putting the 'extends' info after the declaration of the component itself, but I like it better than the inline.
#5 by Dan Vega on 8/24/09 - 1:15 PM
#6 by Dan Vega on 8/24/09 - 1:19 PM
#7 by Jason Fisher on 8/24/09 - 2:22 PM
@output false;
component {
@output false;
@returntype "WEB-INF.cftags.Component";
}
It's a bit like SQL Server variable declarations ...
#8 by Adam Cameron on 8/24/09 - 3:22 PM
Comments are comments plain and simple, and have not relevance outside of source code and documentation engines (in the case of Javadocs), and are ignored by the compiler. This is a precedent set by every other language I know.
CF's approach is just wrong, and should be removed before CF9's release.
--
Adam
#9 by Raymond Camden on 8/24/09 - 5:03 PM
#10 by Sami Hoda on 8/24/09 - 6:52 PM
#11 by Raymond Camden on 8/25/09 - 8:51 AM
#12 by Nathan Mische on 8/25/09 - 9:38 AM
#13 by Jason Fisher on 8/25/09 - 9:42 AM
#14 by Dan Vega on 8/25/09 - 9:46 AM