This post is more than three years old so may contain incorrect information, or opinions I no longer hold.

Is JavaScript Bad? Well, Only If You Are Using It Wrong

26 Feb 2021 | ~3 minute read

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.

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.

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.

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 and I use it for things like Lazy Loading and the great privacy respecting analytics service, Plausible. 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

I don't ♥ JS, but I don't hate it either.
I don't ♥ JS, but I don't hate it either.

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.

← The one before
Upgrading My Desktop PC

Up next →
How To Remove The HTML Extension From A URL

Get in touch!

Receiving emails from my readers is my favourite thing, so if you have something to say, feel free to drop me an email or sign my guestbook.

Want more content?

Say no more, dear reader. Here's three random posts from this blog for you to peruse:

De-Googling My Life – 6 Months On
06 May 2018

Coming Full Circle - From Grav To WordPress
19 Nov 2019

Welcome to My New Site
19 Jan 2013

Want to be informed when I post new articles? Simply enter your email address below and you will get an email whenever new posts are published.

Alternatively, you can subscribe via RSS instead.

Enjoyed this post?

I put a lot of work into maintaining this site and I really enjoy interacting with my readers.

My fuel of choice is coffee, so if you did enjoy this post, or found it in any way useful, I'd appreciate more fuel to keep me going. ❤️

Buy me a coffee