Live data from Hacker News

JavaScript is Eating the World

dev.to

61–70 of 323 posts

Re: JavaScript is Eating the World

#61
post #59

Earlier quoted context omitted.

It bothers me that I have to agree with this. I watched an NPM install once, and noticed that one particular library was downloaded and compiled somewhere around 40 times (and each compiled version was different). Think about that for a moment: one library, 40 versions downloaded and compiled to fill NPM dependencies. What if there was a vulnerability in a version of that library - how do I audit that? Can I even fix…

Personal experience: NPM can be mind-bogglingly slow in Windows. In my previous day-job, an NPM install on Windows 7 could take hours, for some reason. That's NPM 3 with about 20 dependencies on a small project. NPM on Windows also had other problems such as Python path is wrong or C++ compiler is missing. Then we switched to Yarn. Uncached install took about 2-3 minutes, and cached install would finish in seconds. R…

Still a bigger fan of Yarn here. My personal tests have Yarn running a bit faster still, but I also like that Yarn's command syntax is easier. NPM seems content with making a million aliases of everything and it's annoying. I think they even added 'add' from Yarn.

Also, Yarn's run command can be used to run locally installed NPM binaries, not just NPM scripts. i.e., you can do `yarn run -- webpack` and it will run the local copy of Webpack. This is handy imo, and as far as I know NPM doesn't do it.

Re: JavaScript is Eating the World

#62
post #55

Earlier quoted context omitted.

Using non-blocking IO is a very old trick. Even nginx does exactly this, and it's written in C. The ability to use non-blocking IO does not make a language unique in any real fashion.

I have never claimed that it's unique. In fact, most ideas in tech is just old wine in a new bottle. However, I guess what made it appealing initially, was that it uses a syntax known to a lot of web developers. The callback pattern helped. Although these days, we have been moving away to generators or async-await.

> a syntax known to a lot of web developers

This is the key. And it reflects poorly on them for that. Syntax is the easiest part of a language to learn. The nuances of behavior is the hard part - and those nuances change as you move from the browser to the server; what makes good browser code will not make good server code.

In reality they shunned a ton of knowledge and community support to keep a particular (and particularly mediocre) syntax. Even today, years after Node has reached popularity and many lessons have been learned, developers with no experience outside the browser think they can write perfectly good server code, simply because they know the syntax. Never mind that all of the design patterns change. Never mind that the core libraries they use change. Never mind that they suddenly have to be cognizant of how much CPU time their code takes.

Re: JavaScript is Eating the World

#63
post #31
post #17

The other day I managed to freeze my computer -- such that I did not even have access to the SysReq key, by stupidly running while (true) { var d = new Date; e.textContent = d.toLocaleString(); } I immediately realised my stupidity, and closed the tab. Shortly after, my mouse froze up, then my keyboard access, and eventually my entire access. Rather than just freezing Xorg as I had initially suspected, it froze my en…

Javascript is just the language. Its your runtime environment (browser) that is letting an unprivileged process consume resources like that without killing it.

And it seems, his operating system allowing the browser process to take all the CPU.

Re: JavaScript is Eating the World

#64
post #61
post #59

Earlier quoted context omitted.

Personal experience: NPM can be mind-bogglingly slow in Windows. In my previous day-job, an NPM install on Windows 7 could take hours, for some reason. That's NPM 3 with about 20 dependencies on a small project. NPM on Windows also had other problems such as Python path is wrong or C++ compiler is missing. Then we switched to Yarn. Uncached install took about 2-3 minutes, and cached install would finish in seconds. R…

Still a bigger fan of Yarn here. My personal tests have Yarn running a bit faster still, but I also like that Yarn's command syntax is easier. NPM seems content with making a million aliases of everything and it's annoying. I think they even added 'add' from Yarn. Also, Yarn's run command can be used to run locally installed NPM binaries, not just NPM scripts. i.e., you can do `yarn run -- webpack` and it will run th…

I didn't know that, thanks for pointing out.

I like Yarn run, because if I'm running a lint or tests, it errors out with error messages related to the specific process.

If you run via npm run, it would throw lot of extra error messages, making excuses that it wasn't NPM's fault the command exited with a non-zero status etc.; and hiding the relevant error messages.

And as always, you can just run a script as yarn script, instead of yarn run script; like yarn lint:src, instead of yarn run lint:src.

NPM does it only for a few common ones.

Also, Yarn run picks up right node version from .nvmrc - you don't have to run an nvm use and switch to it.

Re: JavaScript is Eating the World

#65
post #36
post #32

Earlier quoted context omitted.

Do you deny that implementations are part of the language? If the Javascript specification left this out, what other implementation gotchyas exist for them to exploit?

Few but you likely consider the implementation part of the language.

How is CPython not a part of Python? After all all Python implementations are always, always compared to CPython

Re: JavaScript is Eating the World

#66
post #52
post #6

What a depressing idea. I don't take JavaScript seriously at all.

Sorry to say this, but this kind of statements don't really add anything to the discussion. _Only a sith deals in absolutes_. Recently, JavaScript has adopted lot of language feature from C#, Ruby etc., that make it really useful for most common tasks. And the community moves really really fast, hence adoption of new language syntax is quite fast. JavaScript has some killer platforms / apps, that are being used in pr…

[deleted]

Re: JavaScript is Eating the World

#67
post #31

Earlier quoted context omitted.

Javascript is just the language. Its your runtime environment (browser) that is letting an unprivileged process consume resources like that without killing it.

And it seems, his operating system allowing the browser process to take all the CPU.

I would argue that all modern Operating Systems have dark corners and hidden bugs. It is just a question of time until you hit a similar bug on any OS.

I had a similar experience on macOS with Chrome Canary watching a YouTube movie full screen. My laptop simply froze, nothing, except a restart, worked.

Re: JavaScript is Eating the World

#68
post #60

What you build is infinitely more important than what you built it with. If someone writes a better Google the users won't care if it's using Javascript, Rust, or QBasic. They'd still be all over it.

I had a client that asked me to rewrite our software in JS. He didnt know anything about programming but said he preferred JS.

Re: JavaScript is Eating the World

#69
JavaScript has eaten my time. It's a really frustrating ecosystem to work in, all the deps, toolchains, build process is extremely fragile.

I'm pushing everything to Python these days and some light front-end in JS where needed. Couldn't be happier!

Re: JavaScript is Eating the World

#70

JavaScript has eaten my time. It's a really frustrating ecosystem to work in, all the deps, toolchains, build process is extremely fragile. I'm pushing everything to Python these days and some light front-end in JS where needed. Couldn't be happier!

The best part is if you get off the treadmill for any length of time you get to re-learn it all over again with whatever the new hotness is!
Post reply on HN