Hacker News new | ask | show | jobs
by k__ 1089 days ago
Grunt, Gulp, CoffeeScript, IIFE, overridden undefined, with, closures to create private fields, modified prototypes, variables global by default, call-site-this, automatic conversions for comparisons...

Ah yes, over a decade of JS.

5 comments

Overridden undefined?

Omg, that’s awesome. I think anyone feeling like a corporate mindless drone should sneak that into a code base.

And I thought overriding toString() was naughty.

In my defense, on my personal projects I have started using var instead of let/const, snake_case everything, don’t use semicolons, manage my objects with my own prototypical inheritance, and am fucking around with my own shitty Canvas2D widgets. Turns out ditching the DOM and using a Turing complete language still beats the crap out of wrestling with the DOM even if you have to reinvent things like word wrap and text areas.

Oh! And there’s not a framework in sight.

The funny thing this is, my productivity and error rate have way improved. Prob coincidence but I do actually enjoy it much more.

Take that ChatGPT!

edit: I actually write web assembly by hand too. Binary even. And have my own little shim in wasm to override its type safety, put code in my heap space pure von Neumann style, and have my own program counter so I can jump and goto. Can’t wait to start doing self-mutating code.

I know this sounds like I’m being sarcastic here- I often actually am- but I kid you not my error rate has plummeted and its become a blast to program again.

My internet actually slowed to dialup speeds lately so I’m only going to MDN or Stack Overflow if I really have to as well.

‘Modern javarscript’? Hahahaha.

undefined couldn't be minified. If you assigned it to an undefined variable early on, any minifier could easily convert it to yet another single-character variable name.

undefined became U (for example). An 8-byte or more reduction per reference. What can I say? Size used to matter. (Been doing JS since 1996.)

If you allow it I think most minifiers nowadays use `void 0` for undefined as it’s smaller.

Though I should try this, using a variable alias for undefined and null would maximize minification.

this list feels just a short jump from “we didn’t start the fire”
Inspired by it: We're gonna build a framework

https://www.youtube.com/watch?v=Wm2h0cbvsw8

I am so glad you shared that. I've never seen it before and it made me laugh so hard I cried.
The only change in lyrics is “it’s been burning us since…”
"It's been burning, since IE was turning"
I kinda miss CoffeeScript, to be honest. I also miss ExtJs.
I have done things with Ext JS that now take me forever with React + MUI. I miss it too.
Aren't there commercial ExtJS-like frameworks built on top of React? Kendo UI commes to mind.
It really depends on what you're missing from ExtJS. Yes, there are some frameworks oriented towards more desktop-like UI components. Some of them even do layout, maybe even non-view stuff (Kendo seems to do at least the former).

But there are other degrees of ExtJS nostalgia:

- Being allowed to do everything in a desktop-like manner, and not having to bother too much with either mobile or more stylized web applications, even in enterprise contexts. No technical issue, no technical solution.

- Doing that in a simple manner. Even contemporary (> v4 or even v3) ExtJS might not be "ExtJS" in this regard, as the framework part got a lot more complex. First with their own weird tooling, nowadays with the worst of both worlds.

- Not having to touch HTML and CSS. Early ExtJS allowed you to do most things with heavily nested JS literal objects. With angular/react/etc. it's all separate syntaxes, most of them with angle brackets.

I'm also a bit pissed that in the past 10 (or more) years we still haven't gotten good established components in the browser that do even half of what ExtJS could do (and still does).

We may have some by 2050 thanks to https://open-ui.org

Browsers did pour billions of dollars and hundreds of thousands of man-hours into a lot of bullshit though :(

CoffeScript is pretty much alive. It even has JSX support now. Although lacks types and tooling.
var that = this
I always favored `self = this`, personally
Careful not to overwrite global self!

Oh the foot guns of `this`

dealing with IE6 nightmares
The IE6 debugger, specifically, which Did Not. Especially when it was a very specific IE6 crash bug that did not occur in any other context. Drawing vml polygons on maps.
error on line 0