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...

Building Contents of Watson Chatbots

In today’s world Chatbots are tremendously transforming the way we interact with software by providing a great business opportunity for almost every company. Chatbots are seen in almost all the websites and also in applications. The first question I ask to myself, what is Chatbot? Chatbots are known by different names some call it “conversational gents”, some “Chatter Robot”. Chatbots are basically a computer program that mimics written or spoken human speech in its natural format using Artificial Intelligence techniques such as Natural Language Processing (NLP) which is used for conversation purpose. In today’s era Chatbots are most commonly used in customer service space, acts as a human face of the brand for support operatives and customer satisfaction reps. We all know virtual assistants like Apple Siri or Amazon Alexa, are two most popular chatbots interacting via voice rather than text. Chatbots engages their customers in the right place, at the right time, with right ...