The 10-Day Bet That Broke Java: How Brendan Eich Built JavaScript in a Netscape Conference Room — While Sun Microsystems Tried to Kill It
⚙️Tech, Code & AIJuly 18, 2026 at 8:29 AM·9 min read

The 10-Day Bet That Broke Java: How Brendan Eich Built JavaScript in a Netscape Conference Room — While Sun Microsystems Tried to Kill It

In May 1995, Netscape gave Brendan Eich 10 days to invent a new programming language or watch Java take over the web. He delivered a prototype that looked nothing like Java — and accidentally created the most widely used language on Earth.

JavaScriptTech, Code & AIBrendan EichNetscapeOrigin StoriesProgramming LanguagesJavaSun MicrosystemsMarc AndreessenECMAScriptWeb ArchitectureSchemePrototypal InheritanceFirst-Class FunctionsClosuresDynamic TypingBrowser WarsMicrosoftJScriptType CoercionFunctional ProgrammingSelfNode.jsTypeScript

The Ultimatum

It was April 1995. Brendan Eich sat in a Netscape conference room in Mountain View, California, listening to his boss deliver an impossible deadline.

"We need a scripting language for the browser," Marc Andreessen said. "Something that looks like Java. And we need it in 10 days."

Eich, a 34-year-old programmer who'd joined Netscape just three weeks earlier, stared back in disbelief. Ten days to design and implement an entire programming language from scratch. Ten days to build something that would run in millions of browsers. Ten days to compete with Sun Microsystems' Java — the hottest technology in Silicon Valley.

Oh, and one more thing: it had to look like Java, even though Eich thought Java was a terrible fit for the web.

What happened in those 10 days would reshape the entire internet. But the real story isn't about the code Eich wrote — it's about the code he didn't write, the design decisions he made at 2am, and the political war between Netscape and Sun that forced him to disguise his creation as something it never was.

The Java Trap

To understand why Netscape was in panic mode, you need to understand the browser wars of 1995.

Netscape Navigator owned 80% of the browser market. Microsoft was about to launch Internet Explorer. And Sun Microsystems had just unveiled Java — a "write once, run anywhere" language that promised to make desktop applications obsolete.

Java was the future, everyone said. Java would kill Windows. Java would make the browser the new operating system.

There was just one problem: Java was slow, heavyweight, and required a compiler. It was designed for building serious applications — banking software, enterprise systems, CD-ROM multimedia.

But the web needed something different. Something lightweight. Something you could write directly into HTML. Something a designer could use to make a button change color when you hovered over it.

Netscape's co-founder Marc Andreessen saw the gap. The web needed a "glue language" — something simple that could manipulate the Document Object Model (DOM), validate forms, and respond to user events without requiring a computer science degree.

But Netscape had a problem: they'd just signed a deal with Sun to embed Java in Navigator. The partnership was worth millions. Sun's executives were adamant — Java was the only language the web needed.

So Netscape had to thread an impossible needle: create a new scripting language that was simple enough for non-programmers, but market it as "Java's little brother" to avoid killing the Sun partnership.

That's where Brendan Eich came in.

The 10-Day Sprint

Eich had been hired to put Scheme — a dialect of Lisp — in the browser. He loved functional programming. He dreamed of bringing first-class functions, closures, and elegant minimalism to the web.

But Andreessen and Netscape's management had other plans. They wanted "Java in the browser." Eich pushed back — he thought Java's class-based object-oriented model was wrong for a scripting language. He wanted prototypes, not classes. He wanted dynamic typing, not static typing. He wanted a language that felt like Lisp and Scheme, not like C++.

But the business reality was clear: Sun had marketing power, Java had hype, and Netscape needed both.

So they made a deal with the devil: Eich could design the language however he wanted — as long as it looked like Java from the outside. Curly braces. Java-like syntax. A name that sounded like Java.

"Make it look like Java," Andreessen said, "but make it work like Scheme."

Eich locked himself in his office. It was May 6, 1995.

He had 10 days.

The Code That Changed Everything

What Eich built in those 10 days was a Frankenstein's monster — and a work of genius.

He took the syntax from Java (curly braces, function keyword, C-style operators). He took first-class functions and closures from Scheme. He took prototypes from Self, a little-known object-oriented language from Xerox PARC. And he threw in dynamic typing, automatic type coercion, and a global object model.

The result was a language that looked familiar to Java programmers but behaved completely differently under the hood.

Consider this snippet of early JavaScript (then called "Mocha"):

function makeCounter() {
  var count = 0;
  return function() {
    count++;
    return count;
  };
}

var counter = makeCounter();
counter(); // 1
counter(); // 2

This is Scheme — lexical scoping, closures, functions as first-class values. No Java programmer in 1995 would write code like this.

But Eich also made compromises that would haunt JavaScript for decades:

Type Coercion: To make the language forgiving for beginners, Eich allowed automatic type conversion. "5" + 3 equals "53" (string concatenation), but "5" - 3 equals 2 (numeric subtraction). This made JavaScript friendly but unpredictable.

var Hoisting: Variable declarations were "hoisted" to the top of their scope, leading to bizarre bugs where variables existed before they were declared.

Global Scope Pollution: Everything was global by default. Forget the var keyword, and you'd accidentally create a global variable that could break other scripts.

this Binding: Borrowed from Self, but Eich's implementation made this context-dependent in ways that confused everyone. Call a method as a function, and this becomes the global object.

== vs ===: The equality operator == did type coercion; the strict equality === didn't. This led to insanity like "" == 0 being true.

Were these design flaws? Absolutely. But they were also pragmatic choices made under impossible time pressure. Eich later admitted: "I didn't have time to make it perfect. I had time to make it work."

On May 16, 1995 — 10 days after he started — Eich demonstrated a working prototype to Netscape's management.

It worked.

The Name Game

Netscape's marketing team hated the name "Mocha." They renamed it "LiveScript" for the beta release of Navigator 2.0 in September 1995.

But Sun Microsystems wasn't happy. Java was the hot new thing, and Sun wanted the web's scripting language to be… Java. Not some weird Scheme-like knockoff.

Netscape and Sun struck a deal: Netscape would rename LiveScript to "JavaScript" and market it as Java's companion language. Sun would license the JavaScript trademark to Netscape. And both companies would pretend that JavaScript and Java were related.

They weren't.

JavaScript and Java have almost nothing in common. Different type systems (dynamic vs. static). Different object models (prototypes vs. classes). Different execution models (interpreted vs. compiled). Different use cases (scripting vs. application development).

But the name stuck. And for the next 25 years, confused beginners would ask: "What's the difference between Java and JavaScript?"

The answer: about as much as the difference between "car" and "carpet."

The Standardization War

By 1996, JavaScript was everywhere. Netscape Navigator supported it. Microsoft reverse-engineered it and shipped "JScript" in Internet Explorer 3.0. Developers were building interactive websites, form validation, image rollovers, and annoying pop-up windows.

But there was a problem: Netscape's JavaScript and Microsoft's JScript were incompatible. Same syntax, different behaviors. Code that worked in Navigator broke in IE.

Netscape submitted JavaScript to ECMA International (a standards body) in November 1996. The goal: create a vendor-neutral specification so every browser would implement the same language.

The process was a disaster.

Microsoft sent representatives who argued for IE-specific features. Netscape wanted features that only Navigator supported. Sun kept trying to make JavaScript more like Java. And Eich — the guy who actually invented the language — had to fight to preserve the design decisions he'd made in those original 10 days.

The first edition of ECMAScript (the standardized name for JavaScript) was published in June 1997. It was a compromise. Some of Eich's original vision survived. Some didn't.

But the language was now locked in. Backward compatibility became sacred. Every quirk, every weird type coercion rule, every == vs === gotcha — frozen forever, because breaking existing websites was unacceptable.

The Revenge of the Prototype

For years, JavaScript was dismissed as a "toy language." Real programmers used Java, C++, or C#. JavaScript was for blinking text and image swaps.

But Eich's design decisions — the ones he'd borrowed from Scheme and Self — turned out to be prophetic.

First-class functions enabled callbacks, event handlers, and eventually the entire Node.js ecosystem.

Closures became the foundation for module patterns, React hooks, and functional programming in JS.

Prototypal inheritance influenced the design of modern JavaScript classes (which are just syntactic sugar over prototypes).

Dynamic typing made JavaScript flexible enough to evolve from a scripting language to a full-stack language powering servers (Node.js), mobile apps (React Native), and desktop apps (Electron).

The quirks remained — typeof null still returns "object" due to a bug in the original implementation. 0.1 + 0.2 still doesn't equal 0.3 due to floating-point precision. And this still confuses everyone.

But JavaScript won. Not because it was perfect. Because it was there, it was good enough, and it had first-class functions.

Today, JavaScript is the most widely used programming language on Earth. It runs on 98% of websites. It powers React, Vue, Angular, Node.js, TypeScript, and the entire frontend ecosystem.

And it all started with a 10-day sprint in a Netscape conference room.

The Legacy

Brendan Eich left Netscape in 1998 (it was acquired by AOL). He co-founded Mozilla and created Firefox. He later founded Brave Software and created the Brave browser.

But JavaScript outlived them all.

Java — the language JavaScript was forced to resemble — is now mostly used for Android apps and legacy enterprise systems. Sun Microsystems was acquired by Oracle in 2010. Netscape Navigator died in 2008.

JavaScript evolved. ES6 (2015) added let, const, arrow functions, classes, and modules. ES2020 added optional chaining and nullish coalescing. TypeScript added static typing on top of JavaScript. Babel allowed developers to use future JavaScript features today.

But the core language — the one Eich designed in 10 days — remains. The prototype chain. The closures. The event loop (added later, but following Eich's original vision). The first-class functions.

Eich once said: "I didn't design JavaScript to be a beautiful language. I designed it to be a useful language that could be written in 10 days."

He succeeded beyond anyone's wildest imagination. The web runs on JavaScript. The servers run on JavaScript. The mobile apps run on JavaScript.

All because a programmer in Mountain View had 10 days to build something that looked like Java — and instead built something that changed the world.

✍️
Written by Swayam Mohanty
Untold stories behind the tech giants, legendary moments, and the code that changed the world.

Keep Reading