Learn JavaScript by Louie Bacaj

Yes you read that title right, All software engineers should learn JavaScript.

As Software engineers, we often use JavaScript. But let's face it, JavaScript is like that thing you have had to use to show someone how to consume your API, use your RESTful Service, or to put a front end on your beautiful algorithm. Being primarily a client side tool, with a browser and UI focus, we can't be fully faulted for not really knowing it that well, after all we are busy writing algorithms, services and such. Also, JavaScript hasn’t exactly seemed very stable with a new framework popping up every week; who can keep up? A while back I decided to challenge that thinking and made serious effort to not just use JavaScript in passing, but to learn it properly, while using JavaScript all the time. If you’re reading this, it’s probably because you’re trying to make a change and learn JavaScript yourself.

The case for learning JavaScript

JavaScript is increasingly becoming an indispensable tool, not just for UI work or for us to pretty up the views in our MVC application. JavaScript has become a back end and front end powerhouse that Software Engineers can no longer ignore. It is becoming a huge source of jobs, not just at startups but also at large enterprises. It has solidified its place as the language of new age technologies and software development, much more so than any other language. The way backend software engineers are used to using JavaScript is outdated. Being a back end kind of guy or gal is no longer a valid excuse for not knowing JavaScript.

This isn't your daddy’s JavaScript.

JavaScript today is not the JavaScript of the nineties that we may have used to spruce up our web page. JavaScript now offers a powerful and intuitive set of frameworks and features. Features that, when compared to native UI frameworks, such as WPF, make them look like toys and not like the powerful building blocks they were once considered to be. Through NodeJS JavaScript has features that make building server side APIs extremely easy and fast. Then there are full-blown MVC frameworks, such as AngularJS, EmberJS, and BackboneJS, that are increasingly becoming the default way of building applications. The default way of building, not just web applications but also mobile apps through Cordova and Phonegap. More importantly, JavaScript, through these frameworks and others, is increasingly creeping up on the desktop space and the enterprise through WinJS and other libraries that give native access. All of this is happening at large corporations and not just small startups; just take a look at the massive spike in demand for Angular engineers and the large salaries they seem to command.


Where to Start?

As back end engineers though, especially those of us with Java, C#, and C++ backgrounds, it is a daunting task to get started with JavaScript. We are used to strongly typed compiled code that gives us feedback on a button press. Where do you get started with JavaScript? What frameworks should you pick to learn? What's fastest way to learn it when you already know how to program well? Obviously, the answers to all of this will vary from person to person, but I have some useful resources below that may be able to help guide you. At least the resources below will help reduce the time wasted while getting started. JavaScript commands so many resources online but much of that stuff we can easily skip.

I will share some of my ideas on the best way to learn JavaScript for software engineers. The way that worked best for me and this way you can avoid wasting time digging around and see fast results. Keep in mind these tips assume you have somewhat in depth knowledge of at least one object-oriented language.

  • Tip 1: Most of us are already fairly familiar with JavaScript, have used it in passing or used it for some of our views when working with MVC frameworks on the server side. The best way is to quickly refresh yourself with the syntax, the command structure. A quick resource to do this, not just for JavaScript but for many other programming languages, is “Learn X in Y minutes”. If you are not that familiar with JavaScript, however, and want something more in depth, the Mozilla foundation has an awesome guide that will show you all of the fundamentals of JavaScript and that can be found here. Once you have familiarized yourself with the syntax your ready for tip number two.

  • Tip 2: As back end guys and gals, we should start with what we know best, the back end! The way we do that is to start learning NodeJS. Node is perfect because it’s the same kind of work you do every day in Java, C# or any other OO-Language your familiar with. Node is also perfect because it has some amazing learning material to start with and all of this can be found at Node School. You can solidify the syntax of the language and some of the more advanced features, such as modules and callbacks etc. The beauty of starting with Node is that we can initially focus on building simple APIs and maybe some RESTful services. Node’s npm package management system is easy to use and will have you building useful back end tools in no time and really committing the syntax to your brain. You may disagree with some of the design choices of Node, such as the all-asynchronous IO system and basically it’s asynchronous approach to everything, but remember the point is to learn JavaScript.

    • NodeJS - Quick double click installer and provides all the docs!
    • Node School - Awesome follow along tutorials (All langugaes and frameworks should have this!).

  • Tip 3: Then you need to start to ease yourself into some of the more useful frameworks for the front end and app development. After all, the front end and app development is where JavaScript really shines. Regardless of your disagreements on the merits of Node on the backend, it will be hard to disagree with the power of JavaScript on the front end. One of the easier frameworks, I have found, to grasp has been KnockoutJS. Knockout allows for two-way data binding and observables. You can bind knockout to your back end API and see the results immediately. This is powerful and allows you to build most small web apps with ease. For maximum results try consuming the APIs you build with node! Knockout has some good learning material right on their main site and more importantly it is a good way to ease yourself into some of the more powerful full-fledged frameworks, which we will talk about in the next tip.

  • Tip 4: For modern web apps, and to really leverage the full power of JavaScript, you'll want to learn about some of the full-fledged application frameworks. Much like the MVC frameworks we use with Java and C# things such as ASP.NET MVC or the Apache Struts; JavaScript has full blown MVC frameworks but the crazy part is everything is done in JavaScript, the models, controllers and yes obviously the views all in JavaScript and all on the client side. This is totally diffrent say from ASP.NET MVC where our models and controllers sit on the server and only our views sit on the client. These frameworks allow you to build the entire application in just JavaScript and right on the client side. That may sound silly to us enterprise developers but these frameworks are highly evolved, extremely popular, active and loaded with features. The three major single page application frameworks are Angular, Ember, and Backbone. You can read more about them here and many other places on the web and evaluate them for yourself.

  • Tip 5: Pick a framework and build an app. More importantly everything you build on the backend force yourself to build a client on the front end and leverage one of these application frameworks while doing it. I chose to really focus on Angular simply because of its shear popularity and the fact that it has the backing of Google but any should work. Build apps with your framework of choice and consume your back end APIs. Becoming an expert with one of these frameworks will really help you understand the true power of JavaScript. The good news is that this isn't that different than building an MVC app with the server side languages we are so used to. All of those principals still apply; the difference of course is that you will become a JavaScript expert.

    • Learn Angular - If you happen to chose to learn Angular as I did then I suggest Learn Angular as it is a great step by step guide.

JavaScript is here to stay!

JavaScript, whether we like it or not, has become the assembly of the Internet. It is very much the backbone of Internet applications and is encroaching into many other territories. We can close our eyes and try to ignore it, but it is increasingly becoming the language of new age applications. It commands a massive amount of open source projects and many users. This language also is increasingly commanding some of the best jobs in our industry.

The skill set of people who “know” JavaScript varies significantly because of its low barrier to entry. The good news is it seems to me that back end software engineers make excellent JavaScript and new age engineers if they chose to take the time to learn this language and some of its more powerful frameworks.

So what are you waiting for go start learning JavaScript!

(Don't forget to subscribe to the e-mail list if you found this useful.)