DEV Community

Cover image for Why You Shouldn’t Learn JavaScript?
Thomas Sentre
Thomas Sentre

Posted on • Updated on

Why You Shouldn’t Learn JavaScript?

"What programming language should I learn?" This is a common question that often leads aspiring developers to encounter a resounding recommendation: JavaScript. It's touted as a language that can be used everywhere, from web development to mobile apps and more. While the appeal of JavaScript's versatility may seem enticing, it's crucial to take a step back and consider whether it is truly the right path for everyone.

JavaScript is complex

JavaScript, the language used to build interactive elements on websites, can be quite complex, especially for those new to programming. This complexity comes from how it handles data and instructions. Unlike some other languages, JavaScript doesn't require you to specify the type of data you're working with upfront. This can lead to unexpected outcomes.

For example, if you add a number and a string together, JavaScript might not give you an error. Instead, it will try to convert one type to another and give you a result that might not make sense. Imagine trying to add "5" + 3 and getting "53" as a result!

This flexibility might seem helpful, but it can also lead to mistakes that are hard to track down. In more structured languages, the computer would catch these mistakes for you before you even run your code.

JavaScript's complexity doesn't stop there. It involves concepts like functions, objects, and closures. These concepts might take time to grasp for someone just starting out. Even experienced programmers sometimes struggle with the intricacies of JavaScript.

JavaScript's complexity is also compounded by concepts that might seem hard to pin down. One of those concepts is the EcmaScript versioning stuff. If you're new and have only familiarized yourself with the latest versions or if you're late in upgrading, trying to understand code that was written with features from a previous version can seem complicated. This can make it challenging to work with codebases that use different versions of JavaScript and its features.

JavaScript: a landscape of diverse frameworks with similar goals

In the world of JavaScript, it's unusual for developers to simply label themselves as "JavaScript Developer". Instead, they often align themselves with specific frameworks or libraries. You might encounter titles like "React Developer," "Vue.js Developer," or "JavaScript Developer specializing in Angular." This pattern highlights a key aspect – the vast array of frameworks and libraries available.

Consider a scenario where your friends or clients seek assistance with a website built using a specific JavaScript framework that you're not familiar with. In such cases, you have a decision to make. You could embark on learning that framework, though it's comparable to adding a new tool to your toolbox. Alternatively, you could entrust someone skilled in that framework to take charge.

The JavaScript landscape is ever-evolving. New tools are introduced constantly, often rendering older ones obsolete. If you're entering this domain anew, brace yourself for this perpetual change, or consider exploring alternative programming languages.

JavaScript is limited

Many developers dive into learning JavaScript with hopes of using it for more than just web development. They dream of employing it in machine learning, mobile apps, desktop software, and beyond. However, reality doesn't always match these aspirations. While JavaScript serves its purposes, it's not a one-size-fits-all solution.

For tasks like crafting robust machine learning algorithms or creating intricate mobile apps with native features, relying solely on JavaScript or some of its libraries might fall short. JavaScript struggles with memory inefficiency and isn't always equipped to meet the demands of resource-intensive tasks.

In essence, JavaScript is powerful within its realm, but it's crucial to recognize its limits. Certain domains might require languages and tools tailored specifically to their needs.

Lack of strong typing and the potential for errors: the need to learn TypeScript

JavaScript's adaptability can sometimes lead to unanticipated errors. In contrast to more rigid languages, JavaScript doesn't impose stringent data type rules. This freedom might lead to misunderstandings and errors in your code. To address this, it's valuable to be ready to explore TypeScript.

TypeScript steps in as a solution. By explicitly defining data types, it adds a layer of stability to your code, reducing the likelihood of unexpected issues. Think of it as adding safeguards to your codebase.

Furthermore, many entry-level job opportunities seek candidates who possess both JavaScript and TypeScript skills. This trend underscores the notion that JavaScript's pure form might not be a complete solution.

Summary

This post highlights certain constraints of JavaScript, a highly popular programming language. However, it's important to clarify that the intent isn't to undermine JavaScript's importance or disregard its widespread usage. Rather, the goal is to offer a comprehensive outlook and stimulate a careful consideration of the choices at hand. Perhaps in my upcoming post, I'll delve into "Why You Should Learn JavaScript", continuing the discussion on its merits.

Connect with me on various platforms

Top comments (6)

Collapse
 
rickdelpo1 profile image
Rick Delpo

Javascript is perceived to be complex because the Frameworks make it so and also the use of Node.js just adds to the complexity. The academic world also requires certain aspects of JS so students really have no choice.

A lot of the fluff in JS is not needed so if we back up and concentrate on just Plain Vanilla Javascript then all is much different and way easier. We don't even need to use Node in Plain JS. Most JS is basic boiler plate stuff that can be done in Plain Vanilla.

I ditched React for Plain JS a few years back and also wrote a Dev article that u can find here. So if u want to minimize and do only necessary JS then choose Plain JS.
dev.to/rickdelpo1/react-vs-plain-j...

Collapse
 
danbailey profile image
Dan Bailey

I don't know that frameworks_ necessarily_ make Javascript more unwieldy. I think poor selection of frameworks makes things more difficult than they have to be. Each framework is merely an abstraction layer atop Vanilla JS that is intended to simplify/streamline things that can be done in Vanilla but not well. Where shit goes sideways is when a framework attempts to be everything to everyone.

I think that in an ideal universe, there'd be an ecosystem of frameworks that could play nice together, were compact, and modular so that you could only install the bits you need to make your JS experience more agile and less of a headache.

Collapse
 
artydev profile image
artydev

Even C++ is not a complete solution in various cases.
Great apps are rarely done with one language only
Python, Lua are embeded in many C++ software.
Javascript can accomplish great things, in experts hands...

Collapse
 
berolich profile image
Berolich

Very right it has a lot of libraries to keep u busy all day long e.g Tensor Flow

Collapse
 
ant_f_dev profile image
Anthony Fung

I'd probably say learning (at least the basics of) vanilla JS is a great idea if your goal is to learn a derivative technology (e.g. TypeScript, etc.). As TypeScript transpiles into JS, it's like learning the basics before the advanced bits.

Once you have a good grasp of the core technology, learning the extras becomes a bit easier.

Collapse
 
future_insight profile image
Future Insight

Solid Point, But if you want a single-codebase application, then JavaScript is not a great option. In that case, I would recommend something else like Dart for Flutter.