I can't help but cringe when looking at the dependency count when using some javascript framework to write client-side code. I think the frameworks and the ecosystem is overly complex and the same could be accomplished by embracing minimalism. I do like things such as babel and webpack though, but those are dev-dependencies which is unrelated to the contents of the final bundle and I can live with few dev dependencie…
The JavaScript ecosystem is delightfully weird
111–120 of 248 posts
Re: The JavaScript ecosystem is delightfully weird
#112Earlier quoted context omitted.
IMHO JavaScript is neither a good OOP language not a good Functional language.
Unfortunately I think the opposite. JS was a great prototype-based language, but very few understood those and tried to fit it into functional or OOP mindsets. When they started talks about adding classes to the spec I knew I had to run away.
Re: The JavaScript ecosystem is delightfully weird
#113> Less that 10 years ago, JavaScript sucked bad. It had no imports, no classes, no async, no arrow functions No classes in JS was much better than with. As someone who used and contributed to CoffeeScript, I was initially excited by them but in retrospect, they've been a huge negative IMO. Douglas Crockford saw it immediately: https://www.youtube.com/watch?v=PSGEjv3Tqo0&t=300s
I accept that in gigantic apps worked on by multiple teams, and libraries shared with 3rd parties, Typescript makes sense. But 90% of the time I see it used it's with a smallish node app or SPA worked on by a few people, and all Typescript does is slow things down.
I feel like I can count on one hand the number of times I've gotten burnt by a run-time JS bug that a compiler would have caught. I just don't see that as a strong use case for the overhead and development drag of TS. I only see sharing lib-ish code across teams as a net benefit of TS.
99% of the time when the TS IDE complains over something that a JS linter wouldn't have caught, it's just because something wasn't defined properly in TS, not because it's an actual error in the code.
Re: The JavaScript ecosystem is delightfully weird
#114Earlier quoted context omitted.
typing saves so much time. Especially since the flexibility of its optionality does not restrict, and allows for really nice autocompletions. Especially with esbuild which has made this simple and fast, one could even say it has saved javascript.
Typing wastes time. Teammate and I tried switching a backend project to TS, and I kept a mental note of time spent defining types vs time saved not debugging type-related issues. The result was some high number vs 0. Also messed with the toolchain, making things like Node profiling not work.
Re: The JavaScript ecosystem is delightfully weird
#115> Nobody Writes JavaScript Any More This is how "delightful" it is, and is the reason I'm waiting for it to die. Every couple of years we decide on the 'no no, definitely this time we have it all figured out, trust us, just use X' "solution" to the problem of JavaScript. We have the definative 'this is how you do it', until the next one.
Re: The JavaScript ecosystem is delightfully weird
#116Earlier quoted context omitted.
> Most off-putting thing was the "callback/promise hell" erroneously recommended in tutorials until I realized you're actually supposed to use async-await Async/await's pretty new, is probably why you're seeing so many tutorials that don't use it.
Yeah, but even new documentation sometimes uses promises, particularly anything related to Google like https://firebase.google.com/docs/auth/web/custom-auth
If their JS docs are anything like their Android docs, Google's terrible about updating examples.
Re: The JavaScript ecosystem is delightfully weird
#117Earlier quoted context omitted.
JavaScript, The Good Parts by Douglas Crockford symbolises this well today https://www.reddit.com/r/ProgrammerHumor/comments/621qrt/jav...
Javascript, The Good Parts, is not really relevant to today's Javascript, unless it's been refreshed. I remember working through it 10+ years ago: * `var` is no longer a thing. * Even `let` is less common now. * Using closures and prototypes to enable functions to be used like classes and have private variables and static variables, have been replaced with proper classes Nowadays if you want to use the good parts of…
Looking at the book now, I still like some sections like "Curry" and "Memoization".
Re: The JavaScript ecosystem is delightfully weird
#118I must be the only person left not writing TS at this point. Once EcmaScript adopts optional static types or some kind of standardized type annotations [1] I will probably use those. At least in Node, where I have more control of the runtime version. [1] https://github.com/tc39/proposal-type-annotations
Re: The JavaScript ecosystem is delightfully weird
#119> Less that 10 years ago, JavaScript sucked bad. It had no imports, no classes, no async, no arrow functions No classes in JS was much better than with. As someone who used and contributed to CoffeeScript, I was initially excited by them but in retrospect, they've been a huge negative IMO. Douglas Crockford saw it immediately: https://www.youtube.com/watch?v=PSGEjv3Tqo0&t=300s
That just described how I feel about Typescript - created by Java programmers so that they can feel comfortable and not have to learn how to program in Javascript. I was a Java dev for a decade. It's so much more tedious and less fun than programming in Javascript. I get Java recruiting emails and I shudder. I accept that in gigantic apps worked on by multiple teams, and libraries shared with 3rd parties, Typescript…
Close! C# programmers. :)
Re: The JavaScript ecosystem is delightfully weird
#120Earlier quoted context omitted.
ECMAScript Language Specification 13th Edition / June 2022 (846 pages): https://www.ecma-international.org/wp-content/uploads/ECMA-2... Working Draft, Standard for Programming Language C++ from 2020-01-14 (1815 pages): https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n48... I'm not sure what's the "correct" spec for the current C++ standard is. Still a big difference between these languages, but 846 pages isn…
Random committee draft of the C spec from 2007 (552 pages): https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf Intel 64 and IA-32 Architectures Software Developer’s Manual, Volume 2 Instruction Set Reference (2552 pages!!!): https://cdrdv2-public.intel.com/774492/325383-sdm-vol-2abcd.... The ECMAScript language spec is closer to the C spec than the C++ spec, by a large margin. I'm not sure how much you can de…
Note: I'm a moderate JS dev so correct me if I'm wrong.