DEV Community

AC1556
AC1556

Posted on • Updated on

Entering JavaScript & Overcoming Frustrations

header

Entering JavaScript & Overcoming Frustrations

I’ll like to preface this post with this, my experiences with the topic of this blog are one-sided and therefore the ideas that I am going to present might be biased or straight-up incorrect. Being a computer science student rushing to finish up his seven year-long trek to his bachelors degree has also vastly limited my time available to do research. That being said, these are my ideas and if they are wrong they should be corrected so that I may learn. And please remember that in the end, we as students, engineers all spend time crawling through the depths of Stack Overflow grasping for hints without considering the underlying details. Let’s begin!

JavaScript. Beginner's entry into the confusing world of asynchronous programming.

JavaScript. The name alone is confusing; as many young developers may not know it has no relation to Java. If you dig around you can find the taxonomy of the early days of the now ECMA standardized languages, but I like to think of it like this:

Some brothers over at Netscape (RIP) had a dare to create a scripting language in about a week. Unbeknownst to them, their language would fill a gap that was forming in the web development space, but there was one caveat, their homunculus was trash. It was garbage, no one wanted to use it. So they through “java” into its name to confuse people into thinking that it had something to do with the all powerful Java. People would think, “Well Java’s pretty hot, maybe its cousin is pretty cool too..” and then use it.

This worked, JavaScript is literally everywhere!

Jokes and bad names aside, JavaScript (and other ECMA derivatives) came about during a time when a solution was needed for advanced web technologies. I, unfortunately, was two preoccupied with learning to walk when JavaScript came onto the scene, but I think it is safe to say that while it was a solution it was not an ideal solution.

As I mentioned in the PSA at the beginning of this post, my experience with JavaScript is limited. I began teaching myself JavaScript a few years ago when I joined my internship as test engineer a local software company. At the time my job was to develop and maintain a preparatory automated test system using the popular node.js testing framework, Mocha. My company’s main product is a node-based web application, so using a node-based testing framework seemed natural.

Before this internship my language experience consisted of: BASIC, Visual Basic, C/++, and Java. When I applied for the job I had no idea that JavaScript was the primary language that I would be using, and I am not really sure how, but it never came up in the interview process. I remember my first day my test-lead gave me assignment to watch videos on “callback hell and their promise based solutions”, and not understanding any of it. However overtime, with much persistence, practice, and failure I learned to really hate JavaScript.

Scoping, syntax, asynchronous programming? How is this language the number one language on GitHub when these three things are literally garbage. Of course, my opinions were a symptom of my inexperience, but it wasn’t until the summer after I started my internship where I actually learned to appreciate the complete mess that is JavaScript.

Like, seriously. There are three ways to declare a function in JavaScript, but each one has its own quirks that are clear up front.

function doThingMakesSense () {
// The classical C-Style function declaration
}

const doThingWhatIsThis = () => {
// This is an anonymous function that's doing a bad job at being anonymous
}

const doThingOkayThisIsRedundant = function () {
// At this point it seems redundant
}
Enter fullscreen mode Exit fullscreen mode

During that summer I had some free time to play around with some pet projects. I wanted to make a bot for a Discord server that my friends and I use share all our dank memes. There are a few different frameworks that can be used to hook into Discord’s API, these are all written in different languages (Java, C#, Rust, etc..). Initially I used one of the Java based framework, and after a whole weekend of trying to get the Mavin configuration up and running, I decided to look towards my new “friend” JavaScript.

I settled on an amazing API called Discord.js (seriously even the API is a joy to read). What blew me away was how quickly it was to get a project up and running with NPM. It took me minutes not hours or days to get the node modules installed. Within a matter of hours I had already created a bot that was responding to my messages in Discord. No messing around with IntelliJ projects. No trying to integrate Mavin to ensure that my Java libraries are updated. Just a simple, npm install --save discord.js and my project is up and running.

Discord.js Logo

The whole experience shed light on the the main reason JavaScript has become so ubiquitous in recent years; it’s flexible. Seeing how just how it quickly I could get a project up and running using a language that I am pretty familiar with, just by finding a specific node module.

This whole thing can pretty much be attributed to Node’s amazing contributors, but still if the foundation was not there attempts at trying to use JavaScript outside of its normal environment would end up like trying to use Java to drive a web UI.

This semester, my final semester, I am finally dipping my toes into the world of web development. Once again I get to witness another application of this brilliant language. In this lecture we are not permitted to use any frameworks. Everything must be done from scratch using a limited toolset: PHP, HTML, JavaScript (strictly jQuery). This is so that we, as beginner web developers, learn how the numerous frameworks that have been developed over the years came to be, and frankly the reason that they were developed. Being that JavaScript was forged out of the need to make webpages more “interactive” this class has taught me, in limited capacity, to understand where JavaScript came from.

Overcoming frustrations

Initially, my lack of inexperience with JavaScript caused me to feel extremely negative. I would have anxiety about asking my seniors at work questions because usually all my problems had very simple solutions. However as I learned more I still grew to love the language, even will all its faults. The only difference now is that learning about things that I don’t understand excites me.

As I scroll through the #javascript tag here on Dev and read about all the exciting different applications that people are using JavaScript inspires me. While this attitude might just be a product of me maturing as a student and a developer I feel as if JavaScript was a catalyst for me to realizes something: rather than being frustrated from inexperience you should be excited to learn something new (unless you’re learning Scheme. In that case just give up).

Frustration from inexperience is stupid...

By in large, frustration from inexperience is stupid, and you should be excited to learn new things. As we are all taught in school, and as we experience everyday at work - the computer science industry is changing everyday. Twenty years ago, privacy was never considered an issue and today people are dragged in before congress to testify about issues over privacy. We are in this industry to learn about new things everyday and if that doesn’t excite you then I don’t know what will.

JavaScript was one of the first real things that I had to teach myself, and reflecting on this has made me so excited to finally finish off my schooling and truly begin my venture into this difficult yet instructing field.

Here are some of the sources that I used for this post. Some of them are quite interesting!

Top comments (0)