by nsonha · 2y ago · 0 comments
do you think javascript was just too easy and people had to invent some bs to make it more interesting for no reason? You don't even know what you're talking about when you make the connection from ts to oop.
My experience comming into javascript is that it's a garbage language and the web stack was a joke, everything was hard for the wrong reason (css centering things kinda stuff)
All these modern tooling, though complicated, is not new in NORMAL programming and makes sense, so you cow boys learn to deal with it.
JS was certainly never a “garbage” language but the elegance is unappealing/unappreciated by entire classes of developers. I totally get the perspective, but it’s all based on a worldview that just doesn’t get functional programming
(In face, the Java/C++/OO-types I know strongly dislike TS because it's structurally typed. TS doesn't care a jot who extends what - as long as they have the same properties it's happy. Hard to get more un-java than that.)
The real reason that TS won is simply that large teams (e.g. hundreds) cannot effectively work together on untyped JS. If you're doing a solo project, fill your boots - use JSDoc comments, sprinkle asserts around, whatever. But the webdev world at large doesn't care about Java or OO concepts, it settled on TS because huge teams can work effectively with it.
What I am saying is, across several comments you seem to be arguing that you think TS's massive popularity is partly due to its proponents liking Java or classical inheritance, or not understanding FP or closures, or something. And that's just wildly not true. And it's also not even true that the TS world particularly favors OO. If you weren't saying those things and I misunderstood, my bad!
An elegant typed one would be Structurae [0].
I imagine/would love to see a bunch of elegant non-typed ones as well.
I’d strongly encourage doing a deeper dive here. Functions in JS are objects and can have their own methods/props + scope. They’re a first class citizen.
How about reasonable scoping rules?
Pre-es6 JavaScript was a nightmare of ugly hacks needed to make the language usable. that = this and {...}() All over the place.