Javascript: JSDoc-Comments

Created on 3 Jul 2015  路  12Comments  路  Source: airbnb/javascript

Point 17.1 shows JSDoc comments, but it is not actively mentioned somewhere. I think that you should mention to document functions using JSDoc.

question

Most helpful comment

Somewhat - comments should never answer "what" - only "why", providing history/motivation. Anything beyond that serves to lure you into a false sense of confidence that your code is clear enough by itself - clear code doesn't require documentation to explain what it's doing.

All 12 comments

+1

Do you actually use JSDoc or just comments similarly to JSDoc spec? (question for airbnb devs)

As far as I know, we do not use JSDoc. -1 from me.

I use JSDoc-like comments but don't actually generate documentation from it, or validate my JSDoc type annotations in any way. I would like to add JSDoc to our styleguide, but it's a large topic, and one with its own style considerations

Personnaly i use it with jsdoced.js. It generate type checking during my test. if the jsdoc isnt respected at runtime, it will throw an error to notify me. http://jsdocedjs.org

+1 to push for jsdoc :)

How many times are you going to vote, @jeromeetienne? :stuck_out_tongue_winking_eye:

-1 from me for adding JSDoc (or any structured doc format).

@bmorearty oops sorry, bad memory :)

I'm going to close this for now, as we pretty consistently do _not_ use JSDoc internally at Airbnb.

If an internal consensus forms around using it, then we can revisit it here.

@ljharb just out of interest, what direction has Airbnb gone with for documentation of javascript?

Manually documenting APIs; if an API is too complex to easily document manually, the API is too complex, and that needs to be fixed.

Whoa - that was unbelievably fast! Thanks for your comments!

Just for clarification, Airbnb doesn't go down the path of inline documentation?

Somewhat - comments should never answer "what" - only "why", providing history/motivation. Anything beyond that serves to lure you into a false sense of confidence that your code is clear enough by itself - clear code doesn't require documentation to explain what it's doing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stephenkingsley picture stephenkingsley  路  3Comments

tpiros picture tpiros  路  3Comments

ar
mbifulco picture mbifulco  路  3Comments

progre picture progre  路  3Comments

mismith picture mismith  路  3Comments