Urgent.News

What's breaking now, across thousands of outlets.

Tech

Why JavaScript Has Quirks (And Why TC39 Can't Fix Them)

TL;DR: JavaScript has notorious quirks because it was designed in just ten days as a prototype to help Netscape survive the early browser wars. Because the internet relies on absolute backwards compatibility, these rushed design flaws became permanent APIs that we must support forever to avoid breaking the web. I've lost count of the times I've stared at a console, questioning my career choices…

JavaScript's peculiarities stem from its hurried design in 1995 when it was a last-minute prototype to aid Netscape during intense browser battles. Created in just a fortnight by Brendan Eich, the language was never meant to be final, and its rushed construction led to enduring quirks. These flaws became permanent APIs because of the principle of backward compatibility, which is essential for the internet to function.

Even today, with the web under the strict "Don't Break the Web" doctrine, developers cannot delete these legacy behaviors, despite them being crude and counterintuitive. For instance, typeof null returns "object", and an array of numbers sorts alphabetically as [1, 10, 2, 20]. To cope with these quirks, JavaScript's ecosystem has evolved, introducing layered, opt-in APIs that bypass the original quirks.

Standardization bodies use mechanisms like strict mode and transpilers to craft clean, modern code that runs on the original quirky engine. While the modern JavaScript spec is elegant and powerful, it is built atop a prototype designed in just ten days, illustrating an architectural marvel: a temporary fix sustaining the entire digital realm.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

FFmpeg 9.0

Changelog: https://github.com/FFmpeg/FFmpeg/blob/n9.0/Changelog Comments

Redis, Caching, and Queues: The Boring Stuff That Makes Apps Feel Fast

When I started building Footalyzer, I didn't think much about Redis. I had Next.js on the frontend, Express on the backend, MongoDB for data — that felt like enough.

  • Redis is a fast memory-based storage system, quicker than traditional databases
  • Caching stores results of expensive computations, improving response time
  • Job queues process background tasks, allowing immediate user response

More from Tuesday 4 August →