←back to thread

160 points todsacerdoti | 5 comments | | HN request time: 0.193s | source
Show context
hresvelgr[dead post] ◴[] No.41900976[source]
[flagged]
1. davedx ◴[] No.41900995[source]
I’ve worked on some huge nodejs projects, it’s a great language for “serious projects”. It has costs and benefits like any other language. If you use TypeScript then IME many of the costs are mitigated.

What exactly makes JavaScript so unsuitable?

replies(3): >>41901085 #>>41901154 #>>41901238 #
2. hresvelgr ◴[] No.41901085[source]
> What exactly makes JavaScript so unsuitable?

Pretty much all the usual, boring offenders everyone's familiar with: truthy/falsey, errors passing silently, exceptions, and differences in importing behaviour with bundlers and runtimes. These things are admittedly quite simple to fix when it's your code, but when you multiply that by 1000 dependencies, which is a conservative number for a JS project a whole host of difficult to detect issues will rear over time.

> If you use TypeScript then IME many of the costs are mitigated.

TS meaningfully helps, but it still falls short of the mark imho. Turning on 99% of TS lints to error is the only solid way I've found to prevent a lot of the issues I've encountered. But that's really hard to introduce into existing codebases. It's doable, but with a lot of friction and effort.

3. helltone ◴[] No.41901154[source]
In addition to what is mentioned by the other comment, also threading and io.
4. rob74 ◴[] No.41901238[source]
> What exactly makes JavaScript so unsuitable?

If you look at JavaScript's history (especially for backend development), it reads like a series of accidents: First, the JS language was hacked together at Netscape in the space of a few months in 1995, and after that it was quickly baked in into all web browsers and therefore became very hard to change in a meaningful way. Then, Google developed the V8 engine for Chrome, and someone thought it would be a great idea to use it for running JS in the backend. My thoughts on that were always: "just because you can do something doesn't mean that you should"...

replies(1): >>41911866 #
5. wiseowise ◴[] No.41911866[source]
You didn’t list any issues of JS.