Live data from Hacker News

The JavaScript ecosystem is delightfully weird

fly.io

151–160 of 248 posts

Re: The JavaScript ecosystem is delightfully weird

#151
post #92
post #7

Coffeescript was well before "tree shaking" (the JS ecosystem's way of spelling "dead code removal") and code splitting, both being relatively new things in the bundler world ("tree shaking" being introduced with rollup if memory serves). Then came Acorn, which gave way to a whole slew of JS transformation bits. It also didn't help that Node was fixed at 0.12 for years and years, and we had the IO.js fork until Node…

So, what language/ecosystem do you prefer nowadays if you were free to choose?

For web apps is just Javascript. And since you are forced to use it, why not run it on the server too and use less programing languages? Not a fan, but it is what it is.

Re: The JavaScript ecosystem is delightfully weird

#152
post #44

I 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

I'm with you. I do not want my code transpiled. I wrote vanilla JS and use Typescript only as annotations (https://www.typescriptlang.org/docs/handbook/jsdoc-supported...)

Re: The JavaScript ecosystem is delightfully weird

#153
post #92
post #7

Coffeescript was well before "tree shaking" (the JS ecosystem's way of spelling "dead code removal") and code splitting, both being relatively new things in the bundler world ("tree shaking" being introduced with rollup if memory serves). Then came Acorn, which gave way to a whole slew of JS transformation bits. It also didn't help that Node was fixed at 0.12 for years and years, and we had the IO.js fork until Node…

So, what language/ecosystem do you prefer nowadays if you were free to choose?

I firmly believe Rust is the future.

Re: The JavaScript ecosystem is delightfully weird

#154
post #57

Earlier quoted context omitted.

I have ample experience with typed languages like C++, C#, Java, Kotlin, Go, AS3, Swift, etc. Maybe I just have exceptional memory but I rarely encounter a problem that would have been solved by using TS.

It's about big codebases and team use, not about you.

Every use case is different.

Re: The JavaScript ecosystem is delightfully weird

#155

Earlier quoted context omitted.

If you already have an existing, functioning codebase, adding types is not saving you time (right now). It's akin to adding a lot of unit tests. You gain time later, and often indirectly from others not making mistakes your types would prevent.

Ample time passed, we added more after we were already on TS, and it wasn't helping. In fact it was a constant burden on new code.

Alright, good luck out there. I strongly prefer types

Re: The JavaScript ecosystem is delightfully weird

#156
post #68

Earlier quoted context omitted.

> As a maintainer of several large JS packages, and being so dreadfully burnt out on JS, there are other words I'd use to describe the whole thing than "delightful". My first project that used JS was in 1996, so I've been along the ride every step of the way. Up until today where I am working with all of this on an Angular 15 enterprise project. I actually would describe it as delightful, compared to what it was like…

The thing about JS is that it was always terrible 5-10 years ago, and is always "actually good now". [EDIT] Though I actually agree that it's nearly-tolerable now that we have TypeScript and async/await to force what always should have been the default behavior.

The thing about JavaScript is lots of people are touching it and are innovating both in how to use it, and for language features.

It's always getting better, and always has opportunities to get better

Re: The JavaScript ecosystem is delightfully weird

#157
post #6

Javascript is this generation's C++. It's a massive language and the only way to stay sane on a project is to agree to use a well demarcated subset of it. Nothing wrong with being C++. The reason JS is so massive and weird is because it's the language that everybody uses, or has to use at some point. Upsides and downsides.

For me:

JavaScript === C

TypeScrit === C++

You can shoot yourself in the foot writing vanilla JavaScript. There should be a book "TypeScript: The Good Parts" though: the language brings a lot of stuff that is better not to use.

Re: The JavaScript ecosystem is delightfully weird

#158

Earlier quoted context omitted.

I'm so sick of these paradigm religious wars. There's nothing wrong with object oriented programming. There's nothing wrong with functional, either. You use them for different purposes. These people like Crockford who talk about "Java programmers are stuck in this inferior way" are the ones who are stuck and not all that educated on programming.

Wait until you have to maintain someone else's overly crufty, inheritance-based JS framework.

There's nothing wrong with inheritance, even in JavaScript.

Re: The JavaScript ecosystem is delightfully weird

#159
post #68

Earlier quoted context omitted.

> As a maintainer of several large JS packages, and being so dreadfully burnt out on JS, there are other words I'd use to describe the whole thing than "delightful". My first project that used JS was in 1996, so I've been along the ride every step of the way. Up until today where I am working with all of this on an Angular 15 enterprise project. I actually would describe it as delightful, compared to what it was like…

The thing about JS is that it was always terrible 5-10 years ago, and is always "actually good now". [EDIT] Though I actually agree that it's nearly-tolerable now that we have TypeScript and async/await to force what always should have been the default behavior.

Not sure what language you were coding in but I remember actively hating it 5-10 years ago and definitely didn't think "it's actually good now". It was always getting better of course, but even these days there's lots of problems that would prevent me from saying "it's actually good now".

The Web APIs are pretty lacking:

* WebUSB has only been available for a couple of years

* WebGPU is only now becoming a thing despite the aborted attempt that was WebGL

* Raw TCP/UDP sockets are still experimental

* WASM is still struggling to solve the scaling challenges to make it possible to make available a large portion of existing software as libraries for JS to interop with without overhead.

* WebCrypto doesn't have streaming hash support & fails to standardize protocols that are relatively popular (e.g. ED25519)

From a language level, there's all sorts of footguns/edges that can't be fixed due to back compat and the language is both slow in adopting good features but also fast to adopt features that don't work too well or just plain annoyances when switching between langauges (e.g. did any/all really have to be unique and called some/every?).

The ecosystem also has large annoying challenges with TypeScript being super slow to type check even small projects, a mess of bundlers to pick from (most of which are ass slow except for ESBuild and maybe SWC), linters (only really ESLint in the game which is slow for TS), formatters (prettier which is slow but thankfully there's now dprint), ES/CJS bifurcation that's a nightmare to manage, tooling that only works with very specific combinations of things, etc etc etc.

You can usually build something passably if you know what you're doing but it's a mess for someone new entering the field and even after having spent some time in it I'm finding myself futzing with project settings quite a bit to accomplish some slightly off the beaten path combination of tools.

Re: The JavaScript ecosystem is delightfully weird

#160

I like javascript, but I always think about the time when I was working as a front end developer, and a guy across the room suddenly stood up, walked over to the white board, and wrote "F*CK JAVASCRIPT" in massive letters. I believe his concern was around the lack of type safety (this was before we used Typescript). And this was someone not prone to dramatic gestures. At the time I laughed. Guy must be having a bad d…

> a guy across the room suddenly stood up, walked over to the white board, and wrote "F*CK JAVASCRIPT" in massive letters

>Guy must be having a bad day.

He was having a bad day because he was doing stupid things with the code he wrote that led to problems. I've never had a problem with Javascript's type system, or having the wrong type show up where it shouldn't. I accepted the dynamic nature of JS long ago when it first came out in Netscape, and I adjusted my coding style accordingly. And Javascript types are not a mystery, type coercion is fairly simple and doesn't produce unexpected results if you actually understand the language. If you don't understand the language (or any programming language), then writing things like "F*CK JAVASCRIPT" in massive letters on a whiteboard is something that might happen.

Post reply on HN