JavaScript is eating the software development world. You name it and it can probably be written in JavaScipt. Websites. Mobile Apps. Desktop Apps. TV Apps. Virtual reality apps. Games. Drones. The list is endless. There are so many libraries and frameworks in the JavaScript world. How do you know what to learn? This discussion is for the beginners who haven’t done anything with JS but want to get into this world and explore what it has to offer.
What is JavaScript?
JavaScript is a programming language that allows us to communicate and tell the browser (computer, mobile, devices, etc) what activities occur following a user event. Prior to 2008/2009 JavaScript was primarily used as a client-side scripting language. That basically means it was used to tell the browser to do certain things when the user interacted with the web page after it was done loading.
Today JavaScript is a “cross-platform, object-orientated programming language”. That’s just a fancy way of saying that JavaScript can be used on any platform whether it’s browsers or desktops/laptops or mobile devices or other devices. It’s also a programming language just like C#, Python, Java, and others. It supports the fundamental principles of programming and supports the standard foundations of a programming language like variables, loops, arrays, etc.
In order to learn JavaScript, one has to have a basic level of understanding of HTML (Hyper Text Markup Language). HTML is the basic building block of a webpage. It doesn’t hurt to have some level of coding experience but it’s not required. You can learn JavaScript as your first programming language.
A Brief History of JavaScript
Brendan Eich created JavaScript in 1995 while working for Netscape. How many of you remember Netscape Navigator? If you do then congratulations you are an old person! (Jk) Yeah so Netscape invented JavaScript. It was then pitched to the ECMA group to be a standard across all browsers. ECMA stands for European Computer Manufacturer Association. They are under what is known as ISO or International Organization of Standardization. ECMA created a JavaScript that was standard for all browsers to use. (Note: Sometimes you will see the name “ECMAScript” which is basically JavaScript, but there was a copyright issue on the word “JavaScript” so ECMA went with “ECMAScript”.)
Around the years 2006/2007 AJAX became popular. AJAX stands for Asynchronous JavaScript and XML. Basically the server provided the front end XML. JavaScript was then used to load the XML data on the web page. This gave birth to varies libraries and frameworks like jQuery, Prototype, Mootools and others. This allowed developers to write JavaScript that was compatible across various browsers and easier to write and handle XML (later JSON) content. jQuery was by far the most popular and widely used library. It was the first library I used out of school and it is where I started my JavaScript journey.
Around the years 2010/2011 JavaScript frameworks began to come about like Backbone JS, Angular JS, Ember JS and others. The reason for their birth was very simple: spaghetti code. JavaScript on the front end began getting complex and hard to maintain. Many developers had their own way of structuring and organizing their JS but many others just poured it all into one file that were thousands of lines of code (I know because I was one of them).
What these JavaScript frameworks brought was order to the chaos. They brought structure to disorganization through MVC patterns. What you found in CakePHP, Zend, Ruby on Rails. ASP.NET MVC, Django, and others was now coming to the front end via Backbone, Angular, Ember and others. During this same time Google Chrome’s V8 Engine was released and this gave birth to Node.js. Node.js’s rise forever changed the landscape of JavaScript. What Node offers was a way to write JavaScript on the server side.
Current State of JavaScript
JavaScript is currently the most popular language on GitHub and Stack Overflow. In the 2016 Stack Overflow developer survey, JavaScript ranked #1 under technology used. According to GitHut, which is a site that tracks GitHub stats, JavaScript is the most popular language used in repositories. What does this tell us? It tells us that many developers are using JavaScript for their projects. Remember the rise of JavaScript frameworks? Well now there are hundreds of them. The most popular ones are Angular JS and React JS (although React JS isn’t really a framework I’ll lump it in as one since this is JavaScript 101 after all and I don’t want to complicate things).
Universal JavaScript is big too. What this means is the entire tech stack of the application is in JavaScript. Some examples are MEAN (MongoDB, Express JS, Angular JS, and Node JS), MERN (MongoDb, Express JS, React JS and Node JS), Meteor JS, Firebase + Angular JS and others. I actually wrote an article about why Universal JavaScript might benefit your company. Several large companies use universal JavaScript tech stacks like Netflix, PayPal, Google, Facebook and others.
The Future of JavaScript: Beyond the Browser
JavaScript is no longer just in the browser. JavaScript can be used to create mobile applications with frameworks such as Ionic, PhoneGap, Appcelerator, and others. It can also be used to create desktop applications for Windows, Mac and Linux with frameworks like Electron or Ionic (Windows only for now). You can even use Node.js to program drones. Using the Unity framework and writing UnityScript which is very similar to JavaScript one can create games including VR ones.
JavaScript is the most popular programming language and it is growing. Will it take over? Probably not. I believe there still will be .NET applications, Python applications, Ruby on Rails applications, etc. JavaScript will just be the most popular but not the only one. There will be better mobile and desktop frameworks for JavaScript to build applications for those platforms. As well as for VR/AR programming too. I also believe that Internet of Things will use JavaScript more to integrate with the web. So I see JavaScript being used to program wearable tech and other IoT hardware. There will be more Universal JavaScript tech stacks and frameworks. The ones in current use will be more stable and popular in use. All in all, JavaScript has a bright future and I am looking forward to it.
Conclusion
I hope you learned something reading this. I wrote it with the intention of someone who has no idea what JavaScript is but wants to learn about the language and start programming with it.
This blog post is a summary of what was discussed at a NoVa.js meetup entitled “JavaScript 101”. 🙂