Home – 42M

JavaScript is chocolate

It resembles a metaphor from Forrest Gump, but hear me out!

Before I start: I always steered clear of technical topics because I surely don’t want to turn my blog into yet another tech blog. But I do use technology, and I sometimes fiddle with it. It’s a part of my life I may as well write about here.

And despite its topic, this post is not only for tech people. So, if you’re not one of ’em, just know that JavaScript is a language that almost every website uses nowadays – even though it is not strictly required.

Now, on with the article (short as usual).

Let JavaScript = Chocolate

I wish everyone treated JavaScript as if it were chocolate.

You may gently hand out a piece of chocolate to your guests after lunch, but they might as well turn it down.

As incredibly hard to grasp as it may be, there are people who genuinely don’t like chocolate. Crazy, I know.

But some websites say: “You don’t accept my chocolate? No lunch for you. Sorry not sorry” – while others outright exclude you without even a word of notice.

That would be a shitty host, right? I don’t think I’m the only one to find this attitude quite upsetting and vaguely hostile – if not openly discriminating.

Let’s be clear. I don’t expect a Progressive Web App to work without JavaScript. Just as if I didn’t like chocolate (and that’s a big if there), I wouldn’t go to a chocolate fair and complain there’s nothing that suits my (peculiar) taste.

But I do expect to be able to read text on a website. Maybe look at a cat pic. Or watch a video (not embedded from YouTube). I’m afraid this is getting too wild.

In my dream world, websites don’t show people blank pages, broken layouts, or features that don’t work. Even if a web app absolutely needs JavaScript to run, I’d rather they told me something along these lines instead:

Dear visitor,

We noticed JavaScript is turned off in your browser, so our app can’t work.

Here’s some instructions on how to enable JavaScript in your web browser.

If you still can’t or don’t want to turn it on, the very least I can do for you is telling you a joke (laughing is important!):

[random joke here]

Have a nice day! 🍀️

P.S. If you’re a dev (or want to become one)

Progressive Enhancement, Graceful Degradation, Accessibility, Semantic HTML… these are not just big words or empty definitions. They’re really helpful.

Use the bare minimum you need, and then build on top of that. It only makes sense. Yes, it may require a bit of effort. But so does not being absolute jerks.

If you invite people over to lunch, make sure they get the main course first. And then, only if they want, they’ll taste a piece of your lovely 100% dark chocolate.