Pros & cons of beginning with JavaScript as your first programming language

After I started conducting programming sessions and mentoring via VoidCanvas or offline; I met a lot of people who wanted to learn JavaScript and had not learnt any other languages before. Majority of them were interested in JavaScript because it trends in the market. Obviously a beginner can not go in technical terms before he grasp atleast one of the languages. There are some other people, who wants to start with JavaScript, but has a doubt in their mind if this is the best decision cause there are a lot of programmers out there who do not recommend JavaScript as a programming language to start with.

So I thought, let’s write something about this confusion and try to help the readers of VoidCanvas to take decisions. I personally love JavaScript very much; but I didn’t start with JavaScript. It was the 4th language I learnt after C, C++, C#.NET & a bit of PHP. I have also mentored people who stared learning JS as the first language. So I think I am kinda balanced position to judge.

Below are few points favoring and disfavoring JavaScript being the first language in your life.

Favoring JS as first language

JavaScript as a language may have more pros or advantages, but I am just listing the ones which are favorable in case of first time learning.

Easy to start

Everyone is familiar with internet and web browsers these days. That means everyone if familiar with the output of JavaScript program atleast, before they even start with it.
All browsers have JavaScript engine; so it’s as simple as opening the browser console and typing code.

Easy to learn

Simple functional programming syntaxes to start with. Only one thread. Majorly the outputs are graphical and people are already familiar with the outputs as I said. So really helpful for the first timers.

Fast output boosts confidence

Easy starting and learning provides quick output. Quick output boosts self confidence and help to keep the moral high; encourages to learn more and go deep. If someone struggles in his early steps probably he will hesitate to take the next steps and will doubt the path.

One language for everything

Using the same language you can develop both your front and back end. That means a complete application (considering nothing there in database part). This is a great plus to become a complete web developer.

Great opportunities

According to the stats of github and stackoverflow, JavaScript is currently the most popular language. The huge community not only helps you to learn but also produce huge number of jobs in the market.

This is a language

Lot of people used to criticize JavaScript before EcmaScript version 6. But ES6 not only improved the syntaxes, but also provided better way to design. EcmaScript is actively trying to improve JS like anything with a commitment of one major release per year. So those who says JS is not a language, don’t listen to them.

Disfavoring JavaScript as first language

There can be more cons of javascript as a language, but This section focuses on only those which are countable to a new programmer.

No Type

JavaScript is a loosely typed language and all type of values can be stored in the same variable. This will leave the programmer with very poor concepts of data types in programming.

The single thread

It’s easy to start coding in a single threaded language if you are coming from an multi threaded language background. But the reverse is tougher. The concepts of multi threads will not grow properly if you have the knowledge of only JavaScript.

Async by nature

Even experienced programmers from other language background finds it difficult to understand. And the weird thing is few callbacks as synchronous too. So you need to have the knowledge of the apis properly. Well, I consider asynchronous nature is the toughest concept in JavaScript.

Still having issues with OOPS

Though ES6 has covered up many drawbacks of OOPS in JavaScript atleast syntactically, but there are still a lot more to improve. ES people are working hard for them and hope we will get a better implementation of JavaScript in future.

Hack like code

Well, this is not a problem with JavaScript, neither with the beginner. This is something to do with the mentor or instructor who is going to teach you JS. In JavaScript there are multiple shorthands and multiple ways available to a single thing. If the instructor does not have real life coding experience in big projects or has a lack of in depth concept; he may end up teaching you techniques which will not be suitable for production environments.

Conclusion

I believe the answer of the question, “whether starting with JavaScript as your first language is good or not” is not always Yes or always No. It depends on the preference or requirement of the person who is going to learn.
For an example, if someone wants to learn programming to get a job; his focus should be on how quickly he can kickoff and get his first programming job. After getting into the job he will learn many other things while making his hands dirty with real life projects. So JS is probably a great fit for him.
But if there is a student who has joined an university to study computer science for the next few years and sees programming as a long time career investment; should prefer holding the hands on C++ or Java.

At the end of the day, if you are a person who loves & respects programming; trust me it will never matter to you which language you should choose as your first. Cause a true programmer always has a hunger. Hunger to read more, learn more, discover other languages, doing hands-ons and comparisons and lot more. And this habit will never let you stay satisfied and you will eventually fill up all the gaps which your first programming language may create in your mind. 🙂

About This Author

Hello! I am Paul Shan, a JavaScript Expert, Full Stack and DevOps Engineer cum Consultant based out of Bengaluru, India.