Re: [Jsdoc-user] documenting a class?
Status: Inactive
Brought to you by:
mmathews
From: <bru...@wa...> - 2007-04-03 18:13:27
|
Please don't throw out the baby with the bath water with regard to Classes... While it is laudable to document the use of JavaScript programmed in the spirit of JavaScript, don't forget that many of us ARE simply trying to parallel Java language features (like Classes) and that is why we started using JsDoc in the first place! Don't take away our illusion that we really are using Java classes. ;-) thanks, Bruce see.. http://www.developer.com/lang/jscript/article.php/3657486 http://www.polyglotinc.com/AJAXscratch/ >The original design for JSDoc wasn't all that clever -- I just copied >"how Javadoc does it." Easy for Java programmers to understand but >slightly problematic for the rest of us because it abuses the idea of >the JavaScript language a bit. > >As you rightly ask, what is a "class" in JavaScript? JavaScript is a >prototype-based language without classes. However, you can think of >constructor functions as behaving like classes -- mostly. So >essentially any function you intend to invoke with the "new" keyword >would be called a "class" by JSDoc. > >To atone for this sin (it really has been bothering me), I've >deprecated the "@class" tag in JSDoc-2 in favor of the "@constructor" >tag, which hopefully will better reflect what JavaScript is actually doing. |