Documenting code

Easy way to document your code.

Usually developer hate to write documentation separately for their code. Mostly we avoid document our code day to day and do it after project get completed. Also developer don’t have extra time for document their code.

In today’s world we see, there is lots of changes happen in requirement everyday or in every sprint. Sometime changes come after sprint get completed. Also there is lots of changes come after one round of test is completed. And because these reason developer get very less time to document their code separately. And once project get completed everyone get crazy for documentation.z

What if document get completed at the same time code or task done ? As a part of code itself?

There is few tools available which help developer to write document while writing code itself. Let’s consider Javascript or Node.js technology.

When we write code, function etc we must write comments for function or code that write. And that’s comment will turn into your document on web page. :)

We can use npm module jsdoc for same. JSDoc 3 is an API documentation generator for JavaScript, similar to Javadoc or phpDocumentor. You add documentation comments directly to your source code, right alongside the code itself. The JSDoc tool will scan your source code and generate an HTML documentation website for you.

JSDoc's purpose is to document the API of your JavaScript application or library. It is assumed that you will want to document things like modules, namespaces, classes, methods, method parameters, and so on.

JSDoc comments should generally be placed immediately before the code being documented. Each comment must start with a /** sequence in order to be recognized by the JSDoc parser. Comments beginning with /*, /***, or more than 3 stars will be ignored. This is a feature to allow you to suppress parsing of comment blocks.

Please refer link : http://usejsdoc.org/


How about writing code that is self explanatory? I agree everything cannot be implicitly understood by reading code..but more often people document things like what and how but never WHY. The WHY should be the only thing documentation should cover as priority 1. Rest can follow by intuitive code. Moreover no documentation is better than misleading or outdated one. Agree?

To view or add a comment, sign in

Others also viewed

Explore content categories