Showing posts with label Coding. Show all posts
Showing posts with label Coding. Show all posts

How To Become A Successful Programmer?

Photo by Samuel Zeller on Unsplash

How To Become A Successful Programmer?

I have heard many novice programmers saying I want to get better at programming but there is hardly a slight improvement in their skills. I have observed that most of them say they want to get better but that is just a wish. They do not really mean it. They mere wish to improve their skills. They do not work for it. Your wish does not guarantee that you will become a successful programmer.
Many other people who have developed an interest in computer programming do not know how to reach to a point where they will be called successful programmers. They either keep wandering in the middle of nowhere or just give up. The same response is for them too as it was for the wishers.
Your interest does not guarantee that you will succeed.
Programming is a field which requires intensive work to master. Along with improving your technical knowledge of programming, you need to work on your interest. You need to develop a habit of not giving up. You need to make your brain believe that it is capable of the things it thinks it is not. You need to know how to move forward and how to keep moving forward. You need to convince your inner self that one day you will become the person who they call a successful programmer.
I am not saying that technical knowledge is not necessary at all and you concentrate all your efforts on the non-technical things. What I am trying to say is that in order to get better at programming, a non-technical parallel process will help you. I am calling it a non-technical process for no good reason. You can call it whatever you want just go with the flow.
So what is that non-technical process? It is nothing but a few habits and characteristics. The process is not specific to programming. It can be used for anything you want to achieve. It can be used to make more money, to get a sound health or make your relationships better. The reason I am calling it a process is that you need to keep practicing it. It never ends. Being a successful programmer is your goal and this is the process you need to repeat until you reach your goal.
The process has four key elements which are given below in the order it works for me. If you have a good reason to change the order, please let us know too. There is a comment section at the end of the page. Interact with us, we don't bite.

Four elements of the process:

  1. Burning Desire
  2. Faith
  3. Imagination
  4. Persistence

1. Burning Desire

Desire is defined in oxford dictionary as a strong feeling of wanting to have something or wishing for something to happen. Desire is the first reason why we do anything. It give us a direction to move on. It is desire which motivates us to do something. 
But the desire itself it not enough for success. Desires are often replaced by other desires. In order to achieve what you desire for, you must have a burning desire not just a desire. Such a burning desire which leads to take decision and get up instead of to a state of indecision. You must feel the urge to get whatever you want to. You must develop extreme interest, an interest which could not be diminished by procrastination.

How to cultivate a burning desire to become a successful programmer?

First of all, convince your mind that there is no backing out. Promise yourself that you will never quite. Close all the doors that will help you to escape.
Try to connect with people somehow who are already better than you in programming. Dan Peña, a successful businessman and a multimillionaire says:
Show me your friends and I'll show you your future.
People you surround yourself with always have an influence on your personality. Surround yourself with people better than you to get inspiration and also with the people who are not as good as you. People below you in your circle will help you see your progress and will learn from you. Make new connections on LinkedIn and join programming communities on Facebook, Reddit, etc but keep a balance in your friend zone. Not only surround yourself with only successful people and not only add people who want to learn from you.

Next, reinforce your mind to believe that you are serious with programming, it is not a joke. Surround your self with things which motivates you like print quotes and image of brilliant programming gurus and put them up around your house. Changing desktop and mobile backgrounds to motivating wallpapers really boost the desire.
There is nothing better than reading if you want to get good at something. Of course practice is necessary but reading is the first step. Practice comes next. Read books related to your topic, attend seminars, listen to pod casts etc. Most importantly, do read how did successful programmers get there and what are they doing now. Read their success stories. It will help you not to lose your interest.
There are a lot of ways to keep your desire alive. Search for them and follow them or be creative and create your own ways. There is no wrong or right way. What matters the most is which works for you.

2. Faith

Faith is complete trust or confidence in someone or something. I am talking a religious faith or something. I am talking about faith in your abilities to succeed, self-confidence. You will never ever get the things that you believe you cannot.
The Power of Your Subconscious Mind is a wonderful book by Dr. Joseph Murphy who describe in details how thoughts and believes are imprinted on subconscious mind and how these thoughts gain physical shape in the real world.
Confident people do not hesitate to ask questions. The more you ask, the more you learn. It gives you the ability to say yes to right things and no to wrong and inappropriate things. Confidence makes you able to overcome any sort of fear, fear of failure, fear of success, fear of misfortune, fear of what others think, fear of loss of love and relationship. It is self-confidence and faith in yourself which can make you set your goals high. If you believe that you will succeed, you will.

3. Imagination

If you can imagine yourself where you want to be, you will be there one day. Imagination is considered one of keys to success. All successful people are dreamers. If you can imagine something in your possession, you will have it. Either it is a skill, fortune, good relationship or anything else. Just believe in yourself, work for it and chase you dreams.
Let's make it more related to programming. Powerful imagination helps a lot in logic building. I have told you each concept of programming is a piece of puzzle. If you want to solve a problem, you need to combine these pieces. While you learn the basic concepts of programming, give each concept a unique shape in your imagination. For example, if statement would have one shape and a loop would have another shape. Recall these shapes when you need to solve a problem.
To make the process more interesting, add sounds to it. As the two magnets make a sound when they come together, you imagine similar sounds when you combine two pieces of puzzle successfully.
Programming is not a rocket science. Any combination that might sound perfect might not work in real. Don't give up. Keep trying. Try different combinations. The imagination faculty of mind gets better with practice. The more you practice, the more powerful your imagination becomes. One day you will reach to a point where you will make more than half of the logic to solve a problem while reading or listening to a problem statement.
I would recommend you to read the power of your subconscious mind by Dr. Joseph Murphy. It presents sound proofs the the imagination works and teaches you how to think.

4. Persistence

Persistence something that if you don't have, you will never succeed. It does not matter how good you are at logic building, it does not matter how powerful your imagination is, it does not matter you have a burning desire or not. If you are not persistent, you will never succeed.
Jack of all trades, master of none...
In consistency is like a parasite. It eats all your efforts and all your hard work you done. I have listed inconsistency as first in 5 Mistakes That I Have Made. I know how inconsistency pushes one backward. How it downgrades the progress and how it vanish most of the efforts one make. It is like an income tax. You work to make money for yourself and family and the govt takes it share for no reason. There is nobody who is happy to pay taxes.
If you want to be a good programmer, stick to programming. Never change your field. Learning how to code is a tedious task. Take your time to decide one programming language to learn and stick to it. Once you think you know how to code, then start learning other languages.
Remember, each and every concept is like a piece of puzzle. It does not matter what kind of color it has, if it fits somewhere, it will work. Same is the case with different programming languages. All basic concepts work the same in all languages, just the syntax is different. Once you become a master of a programming language, then learning a new language becomes a matter of time. You just need to get familiar with its syntax.

Recommended Readings:

How To Code? Function Overloading

function overloading in programming -img

If you are thinking how does this image relates to the topic, don't think. Keep calm and keep reading.

What is function overloading?

Function overloading is a concept in programming where there are multiple functions with the same name having different parameters. Different parameters mean either the number of parameter is different or the data type or the order of input parameters is different.
If the names of multiple functions are the same then how does a compiler/interpreter recognize which function has been called?
Recall function signature from the previous post. Compiler recognizes each function by its signature and function signature includes function name, number of parameters passed to it, their data type and the order in which they are provided. Each version of an overloaded function is almost same for us but entirely a different function for compiler. It just executes the function to which a call has been made irrespective of it is an overloaded function or not provided that the function call is a legal statement. When a compiler encounters a function call, it decides which function to execute from overloaded candidates on the basis of function signature.

Where to use function overloading?

Let me tell you now how the above image is relative to function overloading. Every screw wrench is used for the same purpose. They all do the same work but with a slight difference. Not every wrench fit for all screw sizes. A certain size of wrench can work only on that size of screw. You know, an overloaded function is like a wrench. For a set of alike problems, different versions of the same functions are more useful.
Whenever there is a group of tasks which are similar to each other but have a slight difference, function overloading come in handy. For example, you have some integer numbers and some floating point number and you are required to write a function which accepts a number and return its cube. Now you have a group of two similar tasks, calculating cube and a slight difference, different types of data. Function overloading in this scenario is considered the best practice.

Why to use function overloading?

Function overloading is considered one of the best practices of programming and programmers are encourage to use it because:
  1. it improves code readability and reduces the effort to remember function names
  2. it is used to implement polymorphism
  3. it makes code maintenance easy
Personally, I love the concept of function overloading when I work with a library. Believe me it saves a lot of time and effort.

Things to remember:

To overload a function:
  1. the name of the functions must be the same
  2. the number of parameters could be different
  3. types of parameters could be different 
  4. or both the number and types of parameters could be different

Next: How To Become A Successful Programmer? 5 Step Process

How To Code? Types Of Functions In Programming

how to code: types of function in programing - img

Types Of Functions In Programming:

In previous post we briefly discussed what are functions in programming and how to use them  in a generic way. Here, you will learn what are different types of functions.
Functions are divided into two categories based on where their definition exists.
  1. Built in functions
  2. User define functions

1. Built-in Functions

Built-in functions are those which are already defined in a library. All you need to do is to import the library and call the function. There is no need to define and declare the required function.

Steps to use Built-in function:

Each and every language has a rich set of libraries developed for specific purposes. It is really hard to remember all of these libraries and functions and there is no need to remember at all. Here are listed some steps that I would suggest you to find a library and its functions for certain task.
  1. Understand both the problem and your solution
  2. Search a library suitable for your need
  3. Find your required function and read its documentation
  4. Use

2. User define functions

As the name suggests, user define functions are those which are defined by the user. 
A user define function is declared by the user (the developer) and the definition is written before a function call is made to it.

Types of Functions:

Recall the input/parameter and output/return from previous post. Based on these 2 features, functions are of 4 types:
  1. Functions with no input no output
  2. Functions with only input
  3. Functions with only output
  4. Functions with both input and output
types of functions in programming
Functions are like puzzle pieces. You can use it the way you want.

1. Functions with no input no output 

As far as I know, this type of function is used in very rare cases. It does not accept any input parameter and does not return any output value. But it does not mean it is useless. It depends upon your creativity how you use it.

How to use?

I use this type only when I need to display fix information for user or for debugging. It could also be used in combination with global variables which is considered the worst practice or with constants.

2. Functions with only input

Function with only input is declared and defined with a certain number of input parameters but no return value. It takes values from other scopes in the code but does not transfer the result to any other scope.

How to use?

The output value could be directly printed on screen, written to a file, stored in a reference parameter or passed to another function as input.
Again, it is your creativity how you use it.

3. Functions with only output

Functions with only output have only return value type and no input parameters. 

How to use? 

The input for this type of functions does not come from another scope. Either the global values or constant values are used (not recommended) or input is created by internal processing. For example input could be read from a file or any other function with a return value.

4. Functions with both input and output

It allows us to pass the parameters to the function while calling the function. This type of functions will return some value when it is called. Data Type of the return value depends on the return type of function declaration.

How to use?

This type of functions are fully dynamic functions which provide maximum control to the developer. It is most widely used type of function. Decoupling, one of the best programming practices is easily achieved using functions with both input and output.

Next: Function Overloading

How To Code? Functions in Programming

what is a function in programming
unsplash-logoFabian Grohs

What is a function in programming?

A function in computer programming is just a block of related and reusable code which performs a single task or activity.
Function is also called method, procedure, sub-routine etc. I will try to cover each and every aspect of functions here. I have divided this post into two sections. One section explains the structural components and the other explains non-structural components. I am categorizing these things because I think it will help you better understand functions. These categories are not official. Tell me in the comments whether you liked the categorization or not. Based on your response, I will update this post.

Structural Components: 

There are four structural components of a function:
  1. Name
  2. Body
  3. Input
  4. Output

1. Name:

Function name is the same as a variable name. It follows the same conventions a variable name follows. Special characters and spaces are not allowed in function name. Name of a function is used latter in the code to call/execute the function. Name of a function should reflect the type of task it is performing. That's it. There is no rocket science. Just follow naming conventions.

2. Body

Body of a function consists of the lines of code which you want to execute whenever the function is called. It could be of any size, depends on your problem and your logic. But the body must contain only those lines which are related to each other and solve a single, independent sub-problem of your problem. Read the definition again, the block of code must be reusable. For example, you have to write code for some kind of mathematical equation like
c = a2 + b3
    Here, calculating square is one sub-problem while cube is another sub-problem. There will be two separate functions for each.

    3. Input

    The code in function body performs some operation and it might need data to operate on. In above example, you will need to specify the number you want to take square of. Same is the case with the cube function. The best approach to give input to a function is to use parameters. Parameters are also called arguments and are given during function call. For now, just remember that input to any function is given via parameters. I am going to explain it latter in this post.

    4. Output

    The output of a function is the result that we get after execution of the function. It could be in the form of a value or set of values, screen prints, files or combination of any of these or any other format. If the output value of a function is needed at the point where the function is called, then return is used. Although, it is not necessary for a function to return some value but in order to transfer data from one scope to another, return is used. An opening and closing brackets make a scope. Variables declared inside a scope are accessible only in that scope and its sub-scopes. It is often called lifespan of data/variables.

    Non-Structural Components:

    1. Function Definition
    2. Function Call
    3. Function Declaration (it is optional in many programming languages that's why it is on 3rd

    1. Function Definition

    Function definition contains two things: 
    • function signature
    • function body
    • Function Signature 
    Function signature consists of function name, types and numbers of parameters (input) and type of return value (output). These three things as a whole are called function signature because compiler or interpreter differentiate between functions using their signatures. If you are complete beginner and can't fully understand what I am trying to say, just believe me and remember that function signature contains function name, number of parameters and type of each parameter and return/output value type and it is used by compiler to recognize the function. These information will help you in function overloading.

    In order to define a function, you have to give it a name (should be meaningful) first. You need to specify the number and type of parameters if there are any. Parameters are placeholders for the input values which the function expects from function call. A parameter is defined the same way a variable is defined. It has a type and a name. The value then comes from function call.
    In mathematical equation example above, the square function could take float value or integer value but not a character value. Type and number of parameters are specified during function definition.
    •  Function Body
    Function body is just a block of code which performs the actual task you want it to do. Make sure, each function you define is an independent unit. What is meant by independent unit? It means that you can move each function to another project and it works there with no or little modifications. Try not to use any global variables inside a function. Provide all the input data using parameters and get the result using return value or reference parameters.

    2. Function Call

    Function call is a statement which specifies the name of the function to execute and values for input parameters defined in function definition. It also gives you the value which is returned by a function. You can store that value in a variable or use is directly as you use variables. For example a function which returns integer value can be used anywhere where integer variable could be used.
    Values that you mention in function call are copied to parameters in the function definition. Note that the sequence and type of values must the same as it is in the function definition.

    3. Function Declaration

    Function declaration is only one statement which specifies the function signature. It is function definition without a body. It is optional in many languages but still you should have an idea what it is. You might need it at some point.

    why do we use functions in programming?

     Functions are used because functions:
    1. are reusable units
    2. reduces code size
    3. makes debugging easier
    4. helps to make the code more modular
    5. makes the code easier to maintain
    Next: Types Of Functions In Programming

    Subscribe to our YouTube channel:

    How to Code? Learn These 5 Basic Concepts of Programming

    How to code: 5 basic concepts of programming
    unsplash-logoLewis Ngugi
    If you are intrigued by the title and you are reading this, it means that you are interested to learn how to code. You might have heard people saying that programming is a God gifted skill and not everybody is blessed with it or programming is not for people like you or me or whatever. Believe me, that's bullshit. Computer programming is the most interesting and the easiest skill to acquire in computer sciences. At least, I think so. It is said that one can do almost everything with programming and its true. If you can do everything with something, it then definitely worths a lot of your time.
    A question arises here that how much time one should dedicate daily to learn how to code fast and effect? I would say 8 hrs if you are on your own. To reduce the time and effort you need to learn programming, you should benefit from those who have experience and are good at it.
    As far as I think, you can boost up your learning process if you learn the basics well. Different authors have a different opinion about what are the basic concepts of computer programming. They are also right. Everyone has own perspective. Here I have listed 5 of the basic concepts of computer programming. I am sure it will save you pretty much time and effort.
    I am not saying that you will become an expert in programming after reading this post. I am just helping you to get started, to give you a push. You will get an idea of what are the basics of programming and how these basic concepts work. In order, to get a full understanding of how to code I would recommend you to read 3-5 books of programming fundamentals.

    Programming Fundamentals

    1. Variables, Constants, and Arrays

    Anything that you write in your code is stored in computer memory slots. Each slot has a unique address. To read from and write to a memory location, its address is used. But it is hard to work with numbers like 0x19a823f2... this is how memory addresses look like. Naturally, humans are good at working with names than numbers. That's why a genius (idk who but God bliss him/her) thought that why not to use real world names to deal with computer memory. Variables, constants and Arrays and other similar things are named memory locations. Each offers a different approach to handle memory read/write operations.
    You need to remember only 3 things about variables and related terms.
    1. It is a memory location.
    2. It has a name.
    3. It has some data.
    Remember, a variable is always a variable. Irrespective of the language that you are using, every variable will have the above-mentioned properties. Once you declare a variable with a name suppose x, a constant or an array the operating system selects one or more memory slots (depends on the type of variable) and attach your given name to these slots. Anywhere you use that x in your code, the mighty Operating System resolves it into the memory address it is attached to. Hope it makes sense.

    Where to use?

    Use them wherever you have to read/write some data to/from memory again and again in your code.

    Constants are the same as variables but you cannot change its value once it is initialized.

    Where to use?

    Use constants when you have to write data only once and read many times.

    An array is just a sequence of memory addresses. It has a name, data type and data. The only difference is that it is just a sequence of memory slots. To use a specific slot in this sequence, indexes are used.
    It has also been observed that human remember the things which they see more than the things that they hear. For your convince, a video is included below which further explains the concept.

    Where to use?

    Use arrays whenever you have a sequence of the same kind of data.

    2. Conditional Statements

    Conditional statements (the decision is taken based on some condition(s)), also called control statements (control the flow of execution of your code) or if statements (have if keyword in syntax). We will use the term if statement onward.
    If statements come to the game when there are multiple choices available and one is to be selected based on a given condition. When there are multiple paths of execution if statements are used to direct the execution flow to one of the paths. It decides whether to execute a block of code or not.
    The easiest way to know where to use if statements are to look at your problem statement and identify if word. Any condition following the if word will be your if condition. Real world conditions are depicted in code by using variables and expressions. e.g if a person is at least 18 years old, show him the content (some age-restricted content).
    There are different varieties of conditional statements suitable for different scenarios.
    • if statement:

    Single if with one conditional expression and a single block of code. Decides whether to execute a piece of code or not.

    Example: if something happens to do something.
    • if-else statement:

    single if with one else. Has two blocks of code to choose from for execution based on only one conditional expression.

    Example: if something happens then do something otherwise do something else.
    • if-else-if statement:

    It is the same as if-else but with multiple conditions. Each condition following the first condition is written with the keyword else if. It has more than 2 blocks of code to choose from for execution.

    Example: if something happens then do something if something else happens, do something else and keep it going.

    Yes, I know, the examples are extremely dumb. Just tried to be more generic. If you have better examples, write in comments. I will include it.if-else-if statement : imgif and if-else statements : img

    3. Loops

    A loop is something which starts from one point, goes around and ends back on starting point. If there is a block of code which you see is consecutively used several times, add it to a loop. Note the word consecutively here. We will refer to it in the next section.
    When a block of code is written inside a loop body, it executes again and again. The execution control starts from the first statement of the loop body and progress until it reaches the end. In the end, it returns back to the start of the body. But wait, when will stop executing? Never?
    A loop is similar to if statement with an extra feature. The body of a loop is executed again and again based on a conditional expression. If the condition is true, the body is executed, otherwise not. The control returns back to check the condition every time it finishes executing the block of code until the conditional expression evaluates to false. That's why a dynamic conditional statement (not officially called dynamic) is required in loops.
    There are 4 widely used variations of loops in popular programming languages like JavaScript, Python, C++, Java. All the variations do the same thing, execute code repeatedly. However, each variation comes with a slight modification suitable for different scenarios.
    1. For Loop

      For loop is mostly used as a counter. Like if you want to execute a block of code several times, for loop is the best choice.

      Keyword: for


      1. initialization
      2. conditional expression
      3. condition update statement
      4. body
        the conditional expression is mandatory and the other two are optional.
    2. While Loop

      If you want to run a block of code repeatedly while a condition remains true, go for while loop. You make for loop work like a while loop by ignoring its 1st and 3rd component.

      Keyword: while


      1. conditional expression
      2. body
      Both of the components are mandatory.

    3. Do-While Loop

      The do-while loop comes in handy if you need a block of code at least once whether the condition is true or false. After the first iteration, it works like a while loop. However, in while loop, the condition is evaluated first before its body is executed and in do-while, the condition is evaluated at the end of iteration. Unlike while and for loops, two keywords are used in do-while.

      keywords: do, while


      1. body
      2. condition
        both components are required.
    4. For-Each Loop

      For-each loop is more suitable for situations when you have a list of elements and you want to execute some code for each element of the list. For example, you have a list of some sort of geometrical shapes and want to change the color of each object, use for-each instead of for and while.

      keywords: for-each has a syntax similar to for loop in almost all languages. Some languages use each keyword in combination with for and some use : operator.


      1. condition
      2. body
      both of the components are mandatory.
    types of loops in programming

    4. Functions / Methods:

    an activity that is natural to or the purpose of a person or thing.
    Here, we are not talking about the function of a person or things but a function of a block of code. The reason to include the above definition is to present an analogy between functions in the real world and functions in programming.
    You know what is the function of a printer, don't you? It prints electronic information on a paper. Printing is a sequence of related events. A printer pulls a paper from its tray, prints the queued information on it and pushes it smoothly. Similar to this, a function in programming is a block of code which performs a sequence of related operations. That's it.


    1. Function Name
    2. Parameters
    3. Return type
    4. Body
    5. Function Call
    All the 5 components are mandatory except parameters. A function must have a name which is used to call it, a body which is executed on each call, and a return type which is the type of data a function produces as a result. Parameters are optional. The same naming conventions are followed which are used for variables. 
    If a function needs input data from another scope then it is given either as a parameter or globally. There are many ways to exchange data between the function body and the rest of the code. Function call necessary for function execution. If there is no call to a function, it will never execute.

    When to use functions?

    If you have a piece of code for something and you need it more than in one places in your program, enclose it in a function and call it everywhere you need it.
    Functions and the upcoming topic deserves more of our time. I will write separate posts for each in detail.

    5. Class and Objects:

    You might have heard that class is a blueprint and an object is an instance of a class. I have read it like a lot time in books and blogs and it was the most confusing statement for me ever. Class and Object are the base concepts of Object Oriented Programming. If you a beginner (most probably you are if you are reading this), it will take you some time and some effort to understand what actually class and objects are and how to better use them. You will get some help from here and a lot more in the coming posts.

    What is a Class?

    In real-world problems we have several physical and non-physical objects like if you are working on a game, your main character is an object, a weapon is another object, enemies are separate objects. All have some features and functions. Based on their functions, we can categorize these objects. We can put all the similar objects in one category. For example, Weapons are similar to each other while different from humanoid characters.
    In OOP, such categories become classes. In the above example, the weapon is one class while the enemy is another class.
    In functions, a number of operations which belong to a single event are combined and used again and again with just one function call. Same is the case with classes. Functions which perform operations related to a single category or type of objects are combined into a single class. Obviously, these functions need some data to operate on, so the related data is also encapsulated with these function within the class.

    What is an Object?

    Can you sleep inside a blueprint of your house? Never. The map/blueprint must first be brought into a physical shape. You have to bring it into existence. It will occupy some space on earth. Yes, don't shout. I know people are trying to live on Mars but it may never happen. But there are crazy inventors are still alive. who knows. Anyhow, same is the case with classes. Once you create a class, it does not occupy any space in computer memory (RAM). So you cannot use it. Sorry.
    Unless and until at least one object of that class is created. 
    The object is used to access methods and data of a class. An object is created almost the same way a variable is created. It has a type (class name) and a name. The same naming conventions are followed to create an object of a class which is followed for functions and variable.

    Machine Learning Libraries for JavaScript - 2019

    Photo by Franck V. on Unsplash
    Machine learning has seen enormous growth in recent years. It is actively transforming every industry all around us. From autonomous vehicles to chess players, a simple path following robots to Sophia and from recognizing horrible handwritten text to extremely intelligent new Google Assistant, Machine Learning is everywhere. Thanks to Big Data, high power CPUs, giant GPUs and of course to researchers who brought ML from something to everything. For raising reality straight out of a fantasy (sounds filmic. Doesn't it?). Thanks for saving us from the thing that most of the real human being hate. I'm talking about the holy MATHS. Ok, enough.

    The blessed and the noble human (researchers and innovators) are working hard to come up with more accurate and efficient techniques which work in a constrained environment. One of the major efforts of ML & JS communities is to let us implement ML in JavaScript using JavaScript machine learning libraries. If you are a JavaScript Ninja and want to dive into machine learning or you are a machine learning expert and have a strong desire to try out JavaScript, we present here some JavaScript libraries which you may find interesting. The libraries are listed irrespective of any rating or importance or anything. Choose on your personal preference.


    Brain.js is an open source library developed for Neural Networks. Creating neural nets and training them is a math-intensive job which requires a lot of work even if you are a math genius. Brain.js simplifies the entire process by limiting the API to just a few function calls. All you need is to just install the library and start using it. The library can be used with Node.js as well as in the browser. It can train neural net models asynchronously and also supports streams, Ellman networks and blocked recurrent network devices as well.


    TensorFlow.js is a JavaScript version of papular machine learning library, TensorFlow developed and supported by Google. It provides easy to use API to create, train and implement different machine learning modules. It allows you to train a new neural network or retrain an existing neural net without leaving the browser. If you love Keras and want to try out TensorFlow, try TensorFlow.js Layers API and you will feel comfortable. And above all, it has a comprehensive tutorial set which will help you get started with no or little trouble. Check out the official tutorials here.


    Keras.js is also an open source framework for implementing machine learning models in web browsers. Both Keras.js and TensorFlow.js have many things in common, such as both provide GPU support using WebGL and provide a high-level API which hides abstractions provided by backend frameworks. Keras.js can be used with Node.js too but only in CPU mode. 
    The library officially offers a rich set of demos, written in Vuejs. Check out the following cool list of examples:
    • Basic Convnet for MNIST
    • Convolutional Variational Autoencoder, trained on MNIST
    • Auxiliary Classifier Generative Adversarial Networks (AC-GAN) on MNIST
    • 50-layer Residual Network, trained on ImageNet
    • Inception v3, trained on ImageNet
    • DenseNet-121, trained on ImageNet
    • SqueezeNet v1.1, trained on ImageNet
    • Bidirectional LSTM for IMDB sentiment classification


    STDLib is open source JavaScript libraries which provide a robust set of mathematical and statistical functions which can help you to create high-performance machine learning models and other libraries as well.
    The library is equipped with data visualization tools to help its users to analyze their data and get a better understanding. In order to perceive meaningful insights from data in a more manageable way, the library offers utility functions which are used to group, filter, map and transform data even in browsers as well as on servers. To get a quick review of the library, go to the documentation page here. Although the given list of categories over there has some design issues and looks pretty boring but the detail pages are very user-friendly and informative.


    If you are looking for a complete package of tools for JavaScript/Node.js either for math work or machine learning job, ml.js is for you. It is a set of open-source tools for numerical analysis and machine learning. I would say ml.js is a swiss army knife for The JavaScript developers. It provides you with utility tools for data manipulation and libraries for running different machine learning models on browsers and of course on Node.js environment. The package offers a separate library for neural nets, KNN, K-means clustering, Naive Bayes, and regression and decision tree and random forest and PCA and ... Go to the docs, please.