Before I convince you that it’s crazy, let’s step back a bit and ask why would JS adherents make a statement like this to begin with? You don’t hear people saying, “Yeah, FORTRAN is basically Icon” or “Sather has a really solid SNOBOL core,” do you? Why this arbitrary pairing? After meticulous scientific research, I’ve discovered two historical reasons and one weird psychological one.
A Creation Myth
Way back in the misty primordial days of the web when “under construction” banners were everywhere and wild
<font> tags roamed free, there was a mighty programmer named Brendan Eich. There is still a mighty programmer named Brendan Eich, but there was one then too.
Given that it didn’t have Java’s semantics, what semantics did it have? Later historiographers started trying to fill in that blank. Since Scheme was Eich’s original BFF, they surmised that’s where it gots its semantics from. The hypothesis was that Eich garbed his creation in a sheepskin of semicolons and curly braces to appease his corporate overlords, but that sexy wolf was inside the whole time.
A Savior to Spread the Gospel
That myth wasn’t created until much later, though. Before then, a funny thing happened. One day, Netscape woke up from a truly epic bender to discover it had jammed a scripting language onto the web and millions of people were using it. Literally none of them liked it. Not one.
It was just this weird thing you had to deal with get that awesome rollover over animation to sort-of work on your 640x480 “works best in Netscape 3.0” Geocities page. That drop-down menu ain’t gonna animate itself, you know.
Around that time, this weird guy came along named Douglas Crockford. Unlike most of the teenage amateur-hour web designers at the time (your humble author included), he was an honest-to-God computer whiz. While the rest of us meatheads were using Dreamweaver and notepad, he was probably using emacs, or ed or, who knows, troff. He’d worked in video, and games, and videogames. To further cement his nerd pedigree, he was a bonafide language geek.
Somehow, probably involving alcohol, hard drugs, and a series of lost bets, he went from that auspicious start to end up coding JS. Unlike almost everyone else using JS at the time, he had seen better languages: Scheme, Smalltalk (I think), even E. (The language, not the drug, though I wouldn’t put either past him.)
He came back from his spirit walk, enscribed his gospels and began proselytizing from the Good Book. He told anyone and everyone, often more than once that:
Crockford has a way about him. Part of this is because his background is legimately impressive. He has and continues to do many great things. He is a figurative and literal graybeard, while also staying on the cutting edge. And he has a delivery that is equal parts insight and cranky-but-lovable curmudgeon. In other words, he’s your Dad, and you damn well listen to your Dad when he’s talking to you.
The Huddled Masses
Put yourself in their shoes (if you aren’t already). Imagine being a construction worker surrounded by big burly dudes, arm hair fluttering in the winds of their swinging hammers. And you’re there pushing in nails using this ragged spit-stained blankey you’ve had since you were a kid. It’s embarrassing, despite the fact that your blanket does actually get those nails in. Somehow.
You feel insecure, a bit of a weakling. You’re a Belieber at a Meshuggah show and what you could really use is some street cred.
In some weird organic process, the pantheon of programming languages have ordered themselves in terms of prestige. It’s as random but undeniable as music and fashion. Radiohead is on one end, and Nickelback is on the other. No one knows precisely how they got there, but there they are.
On the Radiohead end, you’ve got Common Lisp, Scheme, Smalltalk, and a few others. Scheme is even more Lisp than Lisp, so it’s like that weird avant garde band no one’s heard of that Radiohead always claims inspired their latest album. If Lisp is Radiohead, Scheme is Kraftwerk.
Not just that, but it was secretly Scheme. So if you were into JS, not only were you using one of the coolest languages, you were one of the select enlightened few who knew how cool it was. You may be listening to Coldplay, but only because Brian Eno produced it.
This “JS = Scheme” meme was hugely legimitizing to a horde of programmers feeling unsure of themselves in the face of grizzly C programmers who allocated their own damn memory, probably right after building their own computer out of rocks and twigs.
But Is it True?
Well I, armed with an encyclopedic knowledge of programming languages and a not-as-dog-eared-as-I’d-like-to-admit copy of SICP, do. We’re gonna put this myth to bed right now. Here’s the defining characterists of Scheme, the stuff whose gestalt makes Scheme special:
Distaste for mutation.
First-class functions and closures.
But, to be fair, it does have some stuff in common. So maybe it’s a fair comparison? I guess the real way to tell would be to compare Scheme to some other languages. The big feature that everyone harps on is closures. Maybe just having closures means you’re basically Scheme.
This is why the “JS = Scheme” meme drives me crazy: it makes us dumber. It’s a thought-terminating cliché. It carries negative informational content and makes people actually know less about languages than they did before.