> Personally, I think comment-based annotations suck. In fact, 
> I would say
> Java 1.5's annotations suck. However, the cfproperty idea 
> seems to have
> merit to me.

I'd agree, as long as you can roll the "CFSET var name" into the CFPROPERTY
tag.  Having to declare variables at the head of functions is enough of a
pain, having to use two separate tags to do it would be intolerable.  Not to
say that predeclared variables are necessarily bad.  However you don't HAVE
to predeclare (i.e. the compiler doesn't check) with CF, which can lead to a
method getting out of sync internally (declare a variable, use it, later
change the implementation, forget to change the declaration).

This kind of internal desyncronization also applies to CFPROPERTY in CFCs.
Because its strictly metadata, and the CFSET is strictly implementation,
there's a good chance that they'll desync as well.  Since CF doesn't check,
there's no way to catch it explicitly.

Bottom line, separately stored metadata sucks, IMHO.  I'd much rather have
reflection, since it's based on the code itself.

Cheers,
barneyb

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Matt Liotta
> Sent: Tuesday, July 20, 2004 3:15 PM
> To: [EMAIL PROTECTED]
> Subject: strict annotation (was RE: [CFCDev] Making 
> Persistant CFCs thread safe)
> 
> It seems in the end the thread is really about whether CFML 
> declarations
> should imply their type. Obviously, CFML is loosely typed so 
> a declaration
> of a certain type means nothing. On the plus side, declaring 
> the type to be
> the same as the expected type does provide documentation 
> benefits. On the
> negative side, it does add overhead and can't lead to 
> incorrect assumptions
> about the actual type of the variable.
> 
> With the above out there, let me just add a bit more. 
> Providing tooling for
> a loosely typed language is tough since you have to almost build an
> interpreter just to figure out what a variable's type is. If 
> the tool could
> have something to make a guess with then a good portion of 
> the time it might
> be right.
> 
> All of this leads me to think that some form of strict 
> annotation is in
> order. In other words, the developer should indicate in 
> source what type the
> variable is supposed to be. Possibly this could be done with 
> declarations as
> suggested already. Another possibility is using the 
> cfproperty tag, which
> effectively annotations fields for web services. Finally, one 
> could use a
> CFML comment of a certain form to provide the annotation.
> 
> Personally, I think comment-based annotations suck. In fact, 
> I would say
> Java 1.5's annotations suck. However, the cfproperty idea 
> seems to have
> merit to me.
> 
> -Matt

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to