Skip to main content

Why API Documentation required on JS?



JavaScript Doc is the de facto standard for documenting JavaScript code. During my development period, I have worked with more than 50’s of JavaScript Libraries; after dealing with so many documentation, I found a lot of issues with JavaScript documentation. As lagging behind Good documentation, development time increases. A good documentation will decrease development time and it makes the developers life easy. It is very simple and easy to integrate with the system. Whatever the reason, not documenting an application is never a good thing, even if it is usually something of a chore.


This documentation will help you to understand the project and its flow, without looking into the actual code in very less time. All the entities described in document will also give link to the code of that particular entity. Let’s have a look for some of the commonly used annotations enlisted below:
Sr. No.
Annotation
Description
               1. 
@constructor
Marks the functions as the constructor.
         2.        
@function
To show a function or method, locally or globally.
         3.        
@param
To show the parameter of a function.
         4.        
@extends/@implements
To indicate the implementing interface or extending class of current class.
         5.        
@returns
Used to enlist return value from a function.
         6.        
@namespace
Shows that an object creating a namespace for its members.
         7.        
@type/@var
To show the member or it’s type.
         8.        
@memberOf
To show the parent of the member.

JSDoc is like an API documentation processor for the JavaScript. As a tool, JSDoc takes JavaScript code with special /** */ comments and produces HTML documentation for it. For example: Given the following code.



                     











The generated HTML looks as follows in a web browser:

                




Documentation is still scarce, but I hope this post help you how to run JavaScript Doc and how its syntax works, also very helpful in decreasing development time.

Comments

Popular posts from this blog

How does a total beginner start to learn machine learning if they have some knowledge of programming languages?

I work with people who write C/C++ programs that generate GBs of data, people who manage TBs of data distributed across giant databases, people who are top notch programmers in SQL, Python, R, and people who have setup an organization wide databases working with Hadoop, Sap, Business Intelligence etc. My inspiration to anyone and everyone would be following: Learn all the basics from Coursera, but if I really have to compare what you would get out of Coursera compared to the vastness of data science, let us say ~ Coursera is as good as eating a burrito at Chipotle Mexican Grill. You certainly can satiate yourself, and you have a few things to eat there. The pathway to value adding data science is really quite deep, and I consider it equivalent to a five star buffet offering 20 cuisines and some 500 different recipes. Coursera is certainly a good starting point, and one should certainly go over these courses, but I personally never paid any money to Coursera, and I could easily ...

Crazy 6 Years with My Software Development Company

Today marks the 6th year since I incorporated my small company. Thanks to all of you for your wishes and for reminding me of this small, yet an important, milestone for numerous reasons. I started working for myself in 2011 (about a decade and a half behind schedule but a start nevertheless) in the pursuit of a more important and lifelong dream. While I am still a long ways from it even now, I believe I have actually made some progress in the last year or so and for that, I am happy. My company and I, and sometimes they mean the exact same thing if you know what I mean!, have been working on building a software product for a little while now and while it certainly doesn’t intend to or is capable of solving world hunger, it still has taken its own sweet time for  a variety of reasons, not the least of it being my inefficiency to manage it better. I shamelessly admit it. I’ve failed many a times over these years and it hasn’t been for the one re...

Why do we need Machine Learning?

  Every time, it is seen that whenever you opens a browser, you will find someone written about machine learning. About applications to self-driving cars, everything is covered in a articles and blogs. So many companies are focusing towards "Machine Learning as the Future" but what does that really mean? Machine learning is the idea that there are generic algorithms that can tell you something interesting about a set of data without you having to write any custom code specific to the problem. Instead of writing code, you feed data to the generic algorithm and it builds its own logic based on the data. Think of machine learning like this. As a human, and as a user of technology, you complete certain tasks that require you to make a decision or classify something. For instance, when you read your inbox in the morning, you decide to mark that ‘Win a Free Cruise if you click here’ email as spam. How would a computer know to do the same thing? Machine learning is comprised ...