Is JavaScript Bad? Well, Only If You’re Using It Wrong
Tags: opinion, web, javascript
Published: 2021-06-23 22:33:38

---
title: Is JavaScript Bad? Well, Only If You’re Using It Wrong
published: true
date: 2021-02-26 14:48:40 UTC
tags: Opinion,Web,JavaScript
canonical_url: https://kevq.uk/is-javascript-bad-well-only-if-youre-using-it-wrong/
---

Many people think that JavaScript is bad, and using it on a website means you’re somehow bad. Personally, I don’t think that’s often the case.

Let me start by explaining why JavaScript has a bad reputation. You see, it’s a programming language that can be used to do all kinds of things on websites. These can range from benign uses, like formatting a hamburger menu on mobile devices, to more nefarious uses like [browser fingerprinting](https://kevq.uk/how-browser-fingerprinting-works/).

The problem comes when web developers try bundle megabytes upon megabytes of JS into their websites. This can make websites extremely heavy and slow to load, which doesn’t sit well with me as I’m all about [optimised websites](https://512kb.club).

## Why is JavaScript bad

Let me just get one thing out there before we go any further – **JavaScript is NOT inherently bad. The misuse of JavaScript is, however.**

Anything can be misused badly. For example, a chainsaw is useful for all kinds of things – cutting back hedges, trimming trees, chopping fire wood. But ask the bloke below to tell you about his chainsaw antics and I’m sure you would have a very different opinion as to whether chainsaws are bad or not.

![Leatherface - Texas chainsaw massacre](https://kevq.uk/wp-content/uploads/2021/02/leatherface.jpg)

Woah. From JavaScript to the Texas Chainsaw Massacre. That escalated quickly, didn’t it! 😲

I use _some_ JS on this website. It’s required for [my guestbook](https://kevq.uk/guestbook/) and I use it for things like Lazy Loading and the great privacy respecting analytics service, [Plausible](https://plausible.io). But if you were to disable JS and visit this site, the core functionality wouldn’t break.

Sure, you wouldn’t be able to post to my guestbook, but you would still be able to read all my content and my nav menu would continue working on all devices just fine. On the other hand, there are lots of sites out there that introduce bundles of JS into their code. To the point where their site is utterly dependant on JS, and in some cases useless without it.

If you were to disable JS on these sites, core functionality like the navigation menu may stop working. On other sites you wouldn’t even be able to see its content!

That’s where JavaScript becomes bad, folks.

## JavaScript isn’t all bad

![Kev loves JavaScript cartoon](https://kevq.uk/wp-content/uploads/2020/11/kev-loves-js.png)<figcaption>I don’t ♥ JS, but I don’t hate it either.</figcaption>

Personally, I don’t see the harm in using JS on your site in order to improve the user’s experience. But if your site is so reliant on JS that it wouldn’t function without it, that’s a problem.

Just so I make myself abundantly clear here – if you’re one of those people/companies that touts their intrusive tracking and fingerprinting as “improving our users experience,” you’re full of 💩.

**What do you think? Has the world gone JaveScript mad, or is a little sprinkling of JS a good thing sometimes? Let me know your thoughts.**

[Is JavaScript Bad? Well, Only If You’re Using It Wrong](https://kevq.uk/is-javascript-bad-well-only-if-youre-using-it-wrong/) is original content by [Kev Quirk](https://kevq.uk).