Live data from Hacker News

Today’s JavaScript, from an outsider’s perspective (2020)

lea.verou.me

41–50 of 391 posts

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#41

I always go into these things hoping the outsider will be an Amish farmer or professional welder, but it always turns out to be just another programmer.

I am "just another programmer" (more familiar with PHP and Go than with Node however), but when some Node module in some project I have to work on starts throwing the kind of obscure errors mentioned in this article, I sometimes feel like an Amish farmer...

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#42
I think the problem was using Node in the first place - most the article is fighting node + NPM nonsense. I personally try to avoid Node + NPM where I can these days, and use Deno for backend stuff since it is much more sane IMO. I've never heard of people putting typescript into a .js file - is that some node thing?

Modules in the browser for vanilla JS is a delight and Just Works though. I've started doing it recently and it is lovely - no need for a bundler/compile step. There are concerns about load performance if there ends up being many modules, but you can do on-demand module loading via vanilla javascript (import returns a promise IIRC) for when that happens.

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#44
post #28

I always go into these things hoping the outsider will be an Amish farmer or professional welder, but it always turns out to be just another programmer.

in what scenario an amish farmer, a professional welder, or, well, anything but a programmer, would know anything about this "javascript" thing?

1. Relative says he is earning $300k making web stuff. 2. Bootcamp

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#45
post #31

sounds like the same experience I have with pretty much every language I'm not used to. I just want to try this C++, download, unzip, oh it's windows so .project file. Fine, redo on windows , oh it's 3 versions of vstuido old and says it wants to upgrade , okay. Hmm errors. Try to fix. Now it's getting linking error. repeat the same with xcode and any project in c, c++, objc, swift okay how about ruby? oh I have old…

Go is yet to prove its stability over timespans similar to those languages you've mentioned, but it doesn't have many of noted (and similar) quirks.

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#46
post #31

sounds like the same experience I have with pretty much every language I'm not used to. I just want to try this C++, download, unzip, oh it's windows so .project file. Fine, redo on windows , oh it's 3 versions of vstuido old and says it wants to upgrade , okay. Hmm errors. Try to fix. Now it's getting linking error. repeat the same with xcode and any project in c, c++, objc, swift okay how about ruby? oh I have old…

Go is yet to prove its stability over timespans similar to those languages you've mentioned, but it doesn't have many of noted (and similar) quirks.

My old go code doesn't compile anymore with the newer compiler versions

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#47

Module resolution is quite a mess in JS at the moment. With the steady move to ESM, hopefully things will get better soon. In this transition period, it's painful. Even for those that deal with JS everyday, most don't actually understand the intricacies of CommonJS & ESM.

It's the thing with every tech ever, first you need to know (way to many) intricacies, and then the tools evolve and you don't need anymore... I remember having to fight sound cards and modems on linux once, or (slightly more recent) days of having to manually install and set up every single service for local dev environment, which basically required a linux administrator level of skills from a developer, plus a lot of time and patience - and nowadays you just type a single command and drivers work, docker is up with your project ready, you're done in minutes... it's the normal path of evolution for these things...

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#48
post #5

Deno uses ES modules and has a build in TypeScript compiler and solves these issues. Just be careful when using different versions of different packages and always use the same version of a service like esm.sh that translates CommonJS modules to ES modules, it has a versioned API so esm.sh/v70/lodash@1.2 != esm.sh/v71/lodash@1.2. I hit my head on this problem for a couple of days.

But Deno is incompatible with npm, no? Deal breaker.

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#49

I think the problem was using Node in the first place - most the article is fighting node + NPM nonsense. I personally try to avoid Node + NPM where I can these days, and use Deno for backend stuff since it is much more sane IMO. I've never heard of people putting typescript into a .js file - is that some node thing? Modules in the browser for vanilla JS is a delight and Just Works though. I've started doing it recen…

I completely disagree with this as someone who's spent a significant number of hours bashing my head against the same issue and reading tons of GitHub issue threads

It seems to come down to the es module spec being half baked so that it's not possible to implement them in a backward compatible way with the rest of the nodejs ecosystem

I'm not sure what the solution is, but I no longer use any packages which export only an es module.

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#50
post #46

Earlier quoted context omitted.

Go is yet to prove its stability over timespans similar to those languages you've mentioned, but it doesn't have many of noted (and similar) quirks.

My old go code doesn't compile anymore with the newer compiler versions

What was it that broke it? Usage of unsafe? Security and bug fixes in the compiler/tooling? Just interested.
Post reply on HN