tracker issue : CF-3037174

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 74798:Using comments to specify metadata is beginning to look like a bad idea

| View in Tracker

Status/Resolution/Reason: Closed/Deferred/

Reporter/Name(from Bugbase): Jared Rypka-Hauer / Jared Rypka-Hauer (Jared Rypka-Hauer)

Created: 01/06/2009

Components: Language, CFSCRIPT

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Minor / Unknown

Locale/System: English / Platforms All

Vote Count: 20

Problem:

Using comments to specify metadata is beginning to look like a bad idea. Comments should be reserved for documentation. We would like to see the syntax look something like one of these:

@output false;
component {
    @output false;
    @returntype "WEB-INF.cftags.Component";
    function init() {
        return this;
    }
}

[Output false]
component {
    [Hint "this is a hint"]
    [Returntype "component"]
    function init()  {
        return this;
    }
}
Method:


Result:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3037174

External Customer Info:
External Company:  
External Customer Name: Jared Rypka-Hauer
External Customer Email: 08C411A143BC38A7992016B6
External Test Config: 01/06/2009

Attachments:

Comments:

+1 vote. I don't have a strong opinion (for once!) as to which of the suggested alternative syntaxes I prefer.
Vote by External U.
24261 | November 10, 2011 07:11:03 PM GMT
Comments that change code is undeniably Wrong. Anyone who thought this was anything less than a terrible idea needs to be slapped repeatedly until they come to their senses.
Vote by External U.
24262 | November 10, 2011 07:11:04 PM GMT
This bug has been voted..
Vote by External U.
24263 | November 10, 2011 07:11:05 PM GMT
I agree that comments should just be comments. Differentiating between comment syntax an metadata syntax is a good idea.
Vote by External U.
24264 | November 10, 2011 07:11:07 PM GMT
I agree that comments are for documentation while "meta-data", for lack of a better term, should be for custom processing, or hints to engines, much like Java annotations. So, I would prefer to leave such meta-data ouside of multi-line comments. further, it would be nice to associate a component method with a specific annotation ... will make comment in forumns.
Vote by External U.
24265 | November 10, 2011 07:11:08 PM GMT
I agree the syntax using brackets is far more readable and makes a lot more sense than within the documentation metadata. Documentation is for documentation, getMetaData could return an array of documentation metadata as well as anything appearing within brackets.
Vote by External U.
24266 | November 10, 2011 07:11:09 PM GMT
This bug has been voted..
Vote by External U.
24267 | November 10, 2011 07:11:11 PM GMT
This bug has been voted..
Vote by External U.
24268 | November 10, 2011 07:11:12 PM GMT
This bug has been voted..
Vote by External U.
24269 | November 10, 2011 07:11:13 PM GMT
This bug has been voted..
Vote by External U.
24270 | November 10, 2011 07:11:14 PM GMT
This bug has been voted..
Vote by External U.
24271 | November 10, 2011 07:11:16 PM GMT
This bug has been voted..
Vote by External U.
24272 | November 10, 2011 07:11:17 PM GMT
This bug has been voted..
Vote by External U.
24273 | November 10, 2011 07:11:18 PM GMT
This bug has been voted..
Vote by External U.
24274 | November 10, 2011 07:11:19 PM GMT
This bug has been voted..
Vote by External U.
24275 | November 10, 2011 07:11:21 PM GMT
This bug has been voted..
Vote by External U.
24276 | November 10, 2011 07:11:22 PM GMT
This bug has been voted..
Vote by External U.
24277 | November 10, 2011 07:11:23 PM GMT
This bug has been voted..
Vote by External U.
24278 | November 10, 2011 07:11:25 PM GMT
+1 This is pretty bad practice in my opinion.
Vote by External U.
24279 | November 10, 2011 07:11:26 PM GMT
This bug has been voted..
Vote by External U.
24280 | November 10, 2011 07:11:27 PM GMT