Jason Knight
3 min readMar 27, 2022

--

That's a very different perspective... and one I've heard but still don't grasp. The lack of proper extensibility leaves JavaScript crippled as a programming language requiring MORE complex syntax to accomplish many simple tasks. It often feels to me like we were NEVER supposed to create our own objects in the language in the first place, and someone went "but hey, how do we store associative data?" and decided to treat records/structs as objects.

Admittedly, the two are kissing cousins.

Could be worse though, could be what PHP did for that with their "associative arrays" that REALLY should be an entirely different data type.

But that's like how people call it "prototype" based when that' the OPPOSITE of what I learned prototypes as... because classes ARE a prototype. JavaScript had no prototypes, it had declarations. Every object declaration is live the moment you declare it.

If anything it's declarative, not prototypical... but that's typical of "modern" programming where they abuse words for things they don't mean... typically because some math book from the 1960's abused the word and nobody gave a shit for 50 years until some JS fanboy picked up on it. See "closure". The modern day equivalent of the Commodore "Kernal", or "Oh the humanity".

Classes ARE prototypes, they are the pattern by which the production models are an instance of. They are not nor should be treated as a live instance. That's why "new" exists and why being able to do "new" on a "live" object and abusing standalone functions as constructors is really dumbass.

But I look at these things different from most, since I started out hand assembling RCA 1802 machine language on a Cosmac ELF, moved from there to Z80 ASM in TRS-DOS and CP/M, used Pascal as my first high level programming language, and spent a decade working in ADA. I learned objects in Smalltalk and Object Pascal, and honestly the latter handles the entire concept a billion times better. It's from this perspective that the existing non-class approach to Objects is half-assed, convoluted, code-wasting, and at best a stopgap for a lack of both proper typecasting and records/structs.

Somehow I even managed to spend my first decade and a half working with computers avoiding the parody of 1960's STUPID that is C, *nix, and Posixisms. Seriously circa late '80's early '90's most of us were pointing at the big iron dinosaurs and their painfully cryptic and bug inducing "C Syntax" and laughing at it. Oh did I back the wrong horse. How dare we want clean clear syntax and "the compiler won't let you shoot yourself in the foot".

Thus your mentioning Rust, which to me looks like someone was going through learning the shit-show of cryptic C syntax and shoe-horned garbage object model, and went "what can we do to make this harder to use?"

Kind of like who all the "we need more operators" nutjobs in JS seem to be trying to turn JS into Brainfuck.

And remember, this is someone who can hand assemble machine language -- and enter it on toggle switches one bit at a time -- talking. I program 16 bit x86 machine language for fun.

But what do I know? I'm one of the nutjobs who still doesn't think this was an April fools joke:

https://www.gnu.org/fun/jokes/unix-hoax.html

Since given the cryptic syntax that makes assembly look clear and simple, I still have difficulty figuring out why the hell C ended up being the prototype on which nearly every successful language built after it decided to copy.

And idiocy like Rust just quadruple down on the "what the hell do all these random characters even F***ing mean". But being a Wirth language fan, I don't trust any language creator who thinks the word "function" needs to be abbreviated or replaced by a bunch of symbols.

But as I've discovered, simplicity, functionality, and even what qualifies as a "basic concept" is greatly dependent on one's background. Thus why when people talk about all these shit-show "HTML/CSS frameworks" as being easier, simpler, or "better for collaboration" I genuinely have ZERO huffing clue what the F*** people are talking about. From my background and perspective, such claims are outright delusional. YMMV.

Thus to me, classes added to JS is overdue, and means I can finally write clear, concise, proper objects the way objects are MEANT to be used, instead of a cryptic, convoluted, half-assed implementation that barely works and results in vomiting up MORE code for the simplest of tasks.

Now if only we could have actual pointers, and/or force any variable to be passed by reference.

--

--

Jason Knight
Jason Knight

Written by Jason Knight

Accessibility and Efficiency Consultant, Web Developer, Musician, and just general pain in the arse

Responses (1)