Why Learn JavaScript

Oct. 20, 2020

Introduction: Why learning JavaScript might be the next logical step.


I have always had a love-hate relationship with JavaScript. I like the fact that it is always backward compatible even to the earliest of websites, I like the fact that it has evolved into a full-featured framework including Vue and React, and I like all the fun things it can bring to the website.

But there is one thing that I hate: My brain does not seem to like learning JavaScript. I have tried (and failed) to learn JavaScript so many times that I lost count. I don't know if it is the curly brackets or the many frameworks seemingly coming out every few months, there is something about it that makes me want to stop.

But the bigger question for me might be, "Why do I feel the need to learn JavaScript?" As much as I love Python and wish to stick with Python on everything, there are legitimate reasons why I now feed the need to venture out to JavaScript. If you are in the same boat, perhaps you should consider at least spending some time learning JavaScript.

JavaScript is the standard for Web Frontend

I remember the days when you purchase or download software, they would come with separate management software clients. You need to pop in the CD, pick the software to install based on your operating system, Windows or Mac (mobile wasn't even that popular back then, think of BlackBarry instead of iPads), install the client, then you can point the management software toward the server to manage it. Of course, those days are long gone, almost 100% of the software I use has a web interface as the management portal. Almost all of them needed features that exceed the basic HTML and CSS and have some kind of JavaScript running if you pop in and look at the source.

Indeed, most of the websites nowadays have at least one, possibly multiple JavaScript running for functionalities, UI elements, analytics, cookies, and many more. This is the primary reason for me to learn JavaScript, I maintain a few websites and my basic JavaScript skills is reaching its limitations. Instead of paying somebody else to build simple functions, I feel like it is better to learn enough JavaScript as a long term investment.

JavaScript is a common entry point for kids

There are many excellent online platforms offering kids the ability to learn to code, ranging from pure online platform https://code.org/ to integrated hardware gaming https://arcade.makecode.com/. My kids love them, especially Microsoft MakeCode Arcade. After starting and stopping a few Python learning projects with my kids, there is no doubt that sparking their interest first is the way to go. For most of these web-based programs, after block-based coding, they typically teach JavaScript because that is what they use to run in the background. I can probably hack around enough to work with my kids' JavaScript code, but why not go deeper?

make-code-arcade-javascript

JavaScript can be used for Backend

JavaScript is highly dependent on the host it runs in. For a period of time, it can only access the browser's resources. This is no longer the case, as JavaScript framework Node.js (https://nodejs.org/en/docs/) proves, it can now run on the backend, have access to native resources such as the file systems, storage, networking, and the whole operating system. Using a single language from a client web service request all the way to the server backend is an amazing accomplishment of JavaScript.

I won't pretend I know any more about how JavaScript-based server framework than that it is possible. But just knowing that fact would motivate me enough to learn more about it.

JavaScript can be used for Mobile Development

This is probably in the same category as above. I don't know too much about it, but there are a few JavaScript frameworks that offer the promise of a single code base for web, desktop, and mobile apps. One of them is Meteor (https://www.meteor.com/), another is Vue-Native (https://vue-native.io/). It sounded too good to be true until one of my friends showed me his production-ready, native-looking iOS, and Android mobile app that were written in Vue-Native. For the record, he did mention the two apps share about 80% of the code base, there are still 20% UI-related code that are different between the two platforms. But that certainly beats 100% different code written in Objective-V (iOS) and Java (Android).

JavaScript in Networking is gaining some momentum

Although Python is still the dominant language when a platform starts to offer language-based SDKs, there are platforms that offer JavaScript SDK as well. Cisco Finesse, for example, offers JavaScript SDK (https://developer.cisco.com/docs/finesse/#!javascript-library). Another example would be the Cisco UCS Director, using CloudpiaScript (https://ucs-director-open-automation.readthedocs.io/en/latest/introduction/), is a framework based around JavaScript to interact with managed devices.

Conclusion

For the record, I understand the difficulty of context switching between Python and JavaScript. I also had a few attempts where I'd tell myself to learn JavaScript, only to give up for one reason or another after a few weeks. I am not sure if this time will be different, I sure hope so. If nothing else, learning another language will hopefully make me appreciate and understand Python more.

Let me know what you think by leaving me a comment below.

Happy coding!

Eric

Return to blog