Skip to main content
2023-05-2212 min read
Web Development

JavaScript: The Pandemic That Escaped the Browser Quarantine

JavaScript: The Pandemic That Escaped the Browser Quarantine

Gather 'round, children, and let me tell you the horror story of how we let a language designed in 10 days by one sleep-deprived guy become the foundation of our entire technological civilization.

The Original Sin

1995: "We need Java in the browser!" Netscape: "But Java is too heavy. Make something lighter." Brendan Eich: "I wanted to do Scheme..." Netscape: "Make it look like Java. You have 10 days." Brendan Eich: "So... Java syntax?" Netscape: "Yes, but make it work nothing like Java. Marketing says it needs to look like Java so people think it's related." Brendan Eich: "That makes no sense. I can't do shit in 10 days!" Netscape: "Not with that attitude." Brendan Eich: "No seriously, a properly designed language takes months of careful—" Netscape: "Did I stutter? Ten. Days."
Narrator: Everything. Everything could go wrong.
JavaScript was supposed to be the coding equivalent of a sticky note. A little scripting here, a little DOM manipulation there. Maybe validate a form. Show an alert box. Simple stuff for simple times.
It was NEVER meant to:
  • Run servers
  • Build desktop applications
  • Power databases
  • Control robots
  • Run machine learning models
  • Compile operating systems
  • Replace every other programming language in existence
But here we are, in 2023, where "JavaScript Developer" could mean literally anything from "I make buttons change color" to "I build distributed systems that process millions of requests per second."
WHAT THE FUCK HAPPENED?
1995Browser Scripting"Just for forms andalerts"2005AJAX Revolution"Dynamic webpages!"2009Node.js Released"Escaped thebrowser!"2010npm Created"Package all thethings!"2012Desktop Apps(Electron)"VS Code, Slack,Discord"2015Mobile Apps"React Native, Ionic"2016Databases"MongoDB,CouchDB"2018Machine Learning"TensorFlow.js"2020IoT & Robotics"Johnny-Five,Espruino"2023Everything"There is no escape"JavaScript's Pandemic Spread

The Node.js Disaster of 2009

Ryan Dahl, 2009: "What if we took V8 out of the browser?"
The Industry: "Why would we do that?"
Ryan: "We could write servers in JavaScript!"
The Industry: "But... why? We have good server languages. Languages designed for servers. Languages with threads. Languages with types. Languages that make sense."
Ryan: "JAVASCRIPT EVERYWHERE!"
And like lemmings off a cliff, we followed.
⚠️
Fun Fact: Node.js was created because Ryan Dahl wanted to see upload progress bars. That's it. That's the origin story of our backend JavaScript nightmare. Progress bars.

The Async Nightmare

JavaScript: "I'm asynchronous by default!"
Also JavaScript: "Here's callbacks!"
Also also JavaScript: "Callbacks are bad, here's promises!"
Also also also JavaScript: "Promises are confusing, here's async/await!"
MAKE UP YOUR FUCKING MIND!
We took a language that's ALREADY ASYNCHRONOUS and added SYNCHRONOUS-LOOKING SYNTAX to make it EASIER TO THINK ABOUT. We've come full circle! We're writing synchronous-looking code in an async language to do synchronous things because THAT'S WHAT BACKEND CODE WANTS TO DO!
javascript
1// What we write
2async function getUser() {
3 const user = await db.query('SELECT * FROM users');
4 return user;
5}
6
7// What we mean
8function getUser() {
9 return db.query('SELECT * FROM users');
10}
11
12// What actually happens
13function getUser() {
14 return new Promise((resolve, reject) => {
15 db.query('SELECT * FROM users', (err, result) => {
16 if (err) reject(err);
17 else resolve(result);
18 });
19 });
20}
We're writing COBOL with extra steps!

What We Actually Want

The Async Evolution Nightmare

Callback Hell

Promise chains are confusing

Still callbacks underneath

Pretending to be

Callbacks
(The Dark Ages)

Promises
(The Renaissance)

Async/Await
(The Modern Era)

Callback Hell
🔥🔥🔥

Promise Chains
.then().then().then()

Looks Synchronous
(But isn't)

result = doThing()
(Just give me the data!)

The TypeScript Cope

"JavaScript doesn't have types!"
Microsoft: "Don't worry, we'll fix it with TypeScript!"
The Industry: "Oh good, types!"
Microsoft: "Yeah! You just need:"
  • A compiler
  • A config file with 200 options
  • Type definition files for every library
  • To understand generics, union types, intersection types, mapped types, conditional types, template literal types...
  • To debug why string | undefined isn't assignable to string | null | undefined
  • To realize the types are A LIE and disappear at runtime
TypeScript is like putting a tuxedo on a garbage fire. Sure, it looks nicer, but it's STILL A GARBAGE FIRE UNDERNEATH.
typescript
1// Your beautiful TypeScript
2function add(a: number, b: number): number {
3 return a + b;
4}
5
6// What actually runs
7function add(a, b) {
8 return a + b; // Hope those are numbers! 🤞
9}
The abstraction doesn't just leak—it's a fucking sieve!

NPM: The Dependency Hellscape

"Let's build a package manager!"
NPM: "Every project needs 47,000 dependencies!"
Developer: "I just wanted to pad a string..."
NPM: "Here's left-pad, and also its 12 dependencies, and their 200 dependencies, and their 5,000 dependencies..."
🚨
True Story: In 2016, an 11-line package called left-pad was removed from npm, breaking thousands of projects including React and Babel. An 11-line function. That pads strings. Broke the internet.
node_modules is a black hole that consumes disk space, sanity, and the will to live. It's the only folder that has its own gravitational pull.

Final Result

npm install

npm install

Your App
(10 files, 2KB)

left-pad
(11 lines)

express
(~50KB)

is-number

is-string

body-parser

cookie

debug

...47 more

bytes

raw-body

...12 more

ms

...5 more

...200 deps

...150 deps

...75 deps

...1000 deps

...800 deps

...400 deps

node_modules/
47,000 files
250MB
🕳️ Black Hole

The "Everything Is JavaScript" Cult

Atwood's Law: "Any application that can be written in JavaScript, will eventually be written in JavaScript."
This wasn't a prediction. IT WAS A THREAT.
  • Operating Systems? Node OS!
  • Databases? CouchDB, MongoDB!
  • Desktop apps? Electron! (aka Chrome in a trenchcoat)
  • Mobile apps? React Native! Ionic!
  • Machine Learning? TensorFlow.js!
  • Game engines? Three.js!
  • IoT? Johnny-Five!
  • Blockchain? Of course!
We're like addicts. "I can quit anytime!" we say, while rewriting perfectly functional C++ applications in JavaScript because "it's more accessible."
Accessible to WHO? The demons we're summoning?

The Framework Churn Apocalypse

2010: "jQuery is the future!" 2011: "Backbone.js is the future!" 2012: "Angular is the future!" 2013: "React is the future!" 2014: "Vue is the future!" 2015-2023: [UNINTELLIGIBLE SCREAMING]
Every six months, a new framework promises to solve problems the last framework created. It's like treating gunshot wounds by shooting yourself somewhere else.
The JavaScript ecosystem moves so fast that by the time you finish reading this sentence, three new frameworks have been created, two have been deprecated, and one has already been rewritten in Rust.

The JavaScript Framework Lifecycle

🎉 New Framework Born
'This changes everything!'

📈 Hype Phase
- 500 Medium articles
- 'X is dead!'
- Conference talks

🏃 Mass Migration
- Rewrite everything
- 'So much cleaner!'
- Delete old code

😰 Reality Sets In
- 'Wait, how do I...'
- GitHub issues explode
- Stack Overflow confusion

💔 Fatal Flaws Discovered
- Performance issues
- Missing features
- 'It doesn't scale'

✨ New Framework Born
To fix old framework's issues

⚰️ Framework Graveyard
jQuery, Backbone, Angular.js,
Knockout, Ember, Polymer,
Mithril, Aurelia, Alpine...

🚨
Current Status: We're at Stage 3 with React (Reality Setting In), Stage 2 with Vue (Mass Migration), and Stage 1 with at least 47 other frameworks you haven't heard of yet but will be forced to learn next year.

The Backend Abomination

JavaScript on the backend is like using a chainsaw as a butter knife. Sure, it WORKS, but at what cost?
What backends need:
  • Predictable performance
  • Strong typing
  • Proper threading
  • Sane error handling
  • Memory efficiency
What JavaScript offers:
  • "Performance depends on the phase of the moon"
  • "Types are a social construct"
  • "Single threaded but don't worry we have workers now!"
  • "Just try/catch everything bro"
  • "What's a memory leak?" leaks memory

The "Isomorphic" Delusion

"Write once, run everywhere!"
Reality: Write once, debug everywhere, work nowhere.
Your "isomorphic" code:
javascript
1if (typeof window !== 'undefined') {
2 // Browser code
3} else {
4 // Node code
5}
Congratulations! You've invented the worst of both worlds!

The Real Tragedy

The worst part isn't that JavaScript escaped the browser. It's that we LET it. We had choices:
  • Python: Clean, readable, huge ecosystem
  • Ruby: Expressive, developer-friendly
  • Go: Fast, simple, built for servers
  • Rust: Safe, fast, modern
  • Hell, even PHP: Designed for the web!
But no. We chose the language that:
  • Has == and === because equality is complicated
  • Thinks [] + [] = ""
  • Believes {} + {} = NaN
  • Contains the unholy trinity of null, undefined, and NaN
  • Has 'this' that changes based on how you call a function
  • Coerces types like a drunk magician

The Event Loop Excuse

"But the event loop makes it fast!"
No. The event loop makes it CONCURRENT, not FAST. There's a difference:
Other languages: "I'll use threads to handle multiple requests" JavaScript: "I'll use one thread and pretend really hard"
It's like saying a juggler is faster than multiple people because they can keep several balls in the air. They're not faster—they're just really good at context switching!

We Did This To Ourselves

The saddest part? Nobody forced us. No government mandate. No alien overlords. We collectively looked at JavaScript and said, "Yes, this language that was hacked together in less time than it takes to binge a Netflix series should run our entire infrastructure."
We took a language designed for making monkeys dance on websites and said, "This. This should power our banks, our hospitals, our nuclear reactors."
Future historians will study our civilization and ask, "What catastrophic event caused them to build everything in JavaScript?" And the answer will be: "Nothing. They just... did it."

In Conclusion

JavaScript escaping the browser is like minimum security prison inmate escaping and somehow becoming president. We all know it shouldn't have happened, but here we are, and now we have to live with the consequences.
Every time I write await in backend JavaScript code, a part of my soul dies. Not because async/await is bad—it's GREAT in languages that are synchronous by default! When Python adds async def, when C# adds async Task, when Rust adds async fn—that makes sense! They're saying "this specific operation needs to be async in our otherwise synchronous world."
But JavaScript? IT'S ALREADY ASYNC! We're using await to make async code LOOK SYNCHRONOUS because that's what we actually wanted all along! We've come full circle! We took an async language and added sync-looking syntax because backends want to think synchronously!
javascript
1// What we write in Node.js
2const user = await getUser();
3const profile = await getProfile(user.id);
4const posts = await getPosts(profile.id);
5
6// What we actually want (and what other languages give us)
7user = getUser()
8profile = getProfile(user.id)
9posts = getPosts(profile.id)
We're literally fighting against the language's nature with every line of backend code we write!
Every time I see a job posting for "Node.js Senior Backend Engineer," I weep for our industry. Every time someone suggests rewriting a working system in JavaScript, I add another bottle to my liquor cabinet.
We had ONE JOB: Keep JavaScript in the browser where it belongs. We failed. And now we're paying the price in:
  • Gigabyte-sized node_modules
  • TypeScript configuration hell
  • Async/await spaghetti
  • Framework churn fatigue
  • The heat death of software quality
But hey, at least we can use the same language on the frontend and backend!
Shoots self in foot with the same gun twice
"See? Efficiency!"
🚨
Update 2023: npm now has over 2 million packages. That's 2 million ways to left-pad a string, check if a number is odd, or determine if today is Wednesday. We have reached peak JavaScript. There is nowhere left to go but down.
Update: 47 npm packages need updating because one of them has a security vulnerability that allows remote code execution through a maliciously crafted emoji. This is fine. Everything is fine.