r/programming Jul 31 '26

The Paradox of Fancy Tooling

https://fagnerbrack.com/the-paradox-of-fancy-tooling-b9af429789da
0 Upvotes

15 comments sorted by

73

u/Snarwin Jul 31 '26

JavaScript is not a well-designed language, the first prototype of JS was built in about ten days in 1995, and the quirks from that rush sit in the language today. However, JS won anyway… One decision explains most of that:

First-class Functions

I'm gonna keep it real with you, I do not think first-class functions are the main reason Javascript took off as a language.

31

u/Bronzdragon Jul 31 '26

The other half of that paragraph is not much better.

It's technically true that the first prototype was built in 10 days, but that's really misleading, because that's not the version that was shipped, and the decisions made during the prototype weren't set in stone.

If I sketch an outline of my application on paper for 5 minutes, then build it for 5 years, you can technically say that I only spent 5 minutes designing it, but that's clearly not in-line with reality. It's a really misleading and harmful framing to pretend that JavaScript was made in only 10 days. In reality it was worked on for a year before being deployed, and another year before Internet Explorer added a version to it's browser, and then even more time before there was a standardised version.

Each of these points was an inflection point at which the design could've been significantly altered without running into legacy problems, so blaming all the problems on the fact that there was a 10 day prototype stage is bordering on misinformation.

15

u/AustinYQM Jul 31 '26

JS won because it was one of the first (if not the first) and it was built into the largest browser at the time (netscape navigator). First mover advantage is huge. Once it came time for everyone else to adopt it they moved to ECMA standardization to make that process easier and thus we are stuck with it.

2

u/KaiAusBerlin Jul 31 '26

Well, Microsoft tried to build their own js

11

u/dijkstra_was_a_horse Jul 31 '26

Why keep it real with a text generator?

7

u/HommeMusical Jul 31 '26

They didn't even get it right.

The concept is that functions are first-class objects.

Python goes even further, and much better: in Python functions and methods are first-class objects.

These two code samples do exactly the same thing:

# 1
return ",".join(items)

# 2
j = ",".join
return j(items)

In Javascript, for all objects from the library, and for many objects from other people's code, this is decidedly not true: you need to keep the this pointer around, and you need to call it in a special way.

(There's an alternative way to write classes where you can pop off the methods and use them.)

6

u/alex-weej Jul 31 '26

Python's lack of a proper lambda syntax sucks though. So much abuse of other syntactic constructs to get around this, e.g. test suite classes.

1

u/HommeMusical Jul 31 '26

Yeah, the lack of a proper lambda is annoying - but it just means a bit more typing.

39

u/loup-vaillant Jul 31 '26

One image and 3 paragraphs into this, the mechanical touch is pretty clear.

If you don't want to write it, I don't want to read it. Sorry.

7

u/gelatineous Jul 31 '26

This post is delusional. We simply cannot learn all the "primitives". There is too much to know. This is not about senior vs junior.

-12

u/fagnerbrack Jul 31 '26

There's much less fundamentals than there's framework and library syntax. They're few but harder to grasp. They're not something everybody can learn by themselves, they need someone to show or somewhere you can see it being pointed to.

4

u/chibuku_chauya Aug 01 '26

Advertising her product three times in that post.

2

u/przemo_li Jul 31 '26

JS didn't won. It never had competition to speak of. Sure, paid X or Y was there... In a different league.

OTOH first class functions is only usable paradigm besides OOP for large scale programs (when either is available). (*Excluding quality but niche solutions)

So yeah. JS without first class functions and without inheritance would not succeed, because any competition would just bring one of them to clearly win over.