News for hackers. Stuff that matters.
Re:I finally escaped Node by bstar77 on Wednesday March 24, 2021 @09:36AM (#26566990)
- Lack of a good standard api: I don't understand this one. I've never had a problem with its documentation and the API always seemed fine to me, but I don't use C# or Go so maybe I'm missing out?

- There's a tendency in the ecosystem to abandon projects rather soon: This can certainly happen, but it's important to choose libraries and frameworks carefully. My node servers (Express.js) are extremely light weight, so I rarely have this problem.

- Lack of multi threading: I think you are wrong on this point but I don't know your expectations since I'm not a Java developer. I have written some multi threaded code and saw massive perf improvements. You can't expect a scripted language to perform like Java, but quality of code is also very important. I wrote a generator that replaced a Java utility that was 10x faster. I rarely have to worry about this because it's easier to write async code that's extremely fast.

- Lack of typing: this seems more like a criticism of javascript.

I get that this isn't the platformm for you, but I think you might be wanting it to be too much like what you are familiar with.

Re:I finally escaped Node by chrisandchris on Wednesday March 24, 2021 @10:56AM (#26568013)
About lack of standard library:

I don‘t personally work with node for the backend but typescript/javascript in the browser. And I think what is meant is something like LINQ in C# (all kinds of functions you can apply on enumerables/arrays), some basic DateTime library (how to add two dates in JS? How to get the diff of two dates in days or hours in JS? Both are 1 liners in C#) and maybe some more stuff for string mutation and so on.

Re:I finally escaped Node by hajile on Wednesday March 24, 2021 @03:51PM (#26572093)
There’s work on new JS standard called Temporal that’s a stage 3 proposal. People should be using its poly fill instead of other data libraries where possible.

https://github.com/tc39/proposal-temporal

JS standard libraries are forever. It pays to take a bit more time and get it right.

Re:I finally escaped Node by bstar77 on Wednesday March 24, 2021 @11:03AM (#26568113)
It's a one liner if you use Day.js. It's makes no sense to include this functionality in Node.
Re:I finally escaped Node by chrisandchris on Thursday March 25, 2021 @03:49AM (#26577420)
Strongly disagree.

Who maintains day.js? It‘s (i did not look, i guess) not the same people that develop the JavaScript standard library. At some point, day.js is abandoned or breaks something and nobody is going to fix it because it is abandoned, or even worse, soneone creates a fork and fixes it there and now we have 2 day.js.

If it is in the standard library, you have a guarantee that it works today, works tomorrow and with a quite high certainty still works the day after. There are not that many languages that successfully break backwards compatibility often.

And don‘t get me started with the legal aspect. There are many projects where one cannot simply pull another dependency just to calculate a date diff.

Re:I finally escaped Node by codecurve on Wednesday March 24, 2021 @11:13AM (#26568252)
What makes the Date constructor a good candidate for the standard library but not the aforementioned methods? Not everyone knows about Day.js, you had to learn that at some point. Why Day.js instead of Moment or Luxon or Date-Fns? There's a lot of cognitive value to having a fully featured standard library.
Re:I finally escaped Node by bstar77 on Wednesday March 24, 2021 @02:53PM (#26571458)
That why we read and learn. You can't expect node to work like java. I feel like I'm talking to a wall with you guys. I've been working with JS for 15 years. I would never presume to start Java dev and expect to do things my way. I saw the same thing when Java devs were trying to learn Ruby... you have to approach with a different mentality.

Regarding Moment, on their site and they plaster exactly why you should not use moment and explain exactly why other libs (Day.js included) are better. Node is designed to be modular, Java isn't.

Re:I finally escaped Node by chrisandchris on Thursday March 25, 2021 @03:52AM (#26577437)
That‘s not the point. Nobody expects that Node/Js does exactly the same as Java or C#. If so, one could simply use Java or C#.

A language should provide a set of functionality that makes the developers life easier and consists of a set that he can achieve basic (daily) things without the need of 3rd-party dependencies. And if that usually starts with „npm -i“ I‘m going to question that...

Re:I finally escaped Node by bstar77 on Thursday March 25, 2021 @11:44AM (#26581677)
We are going to have to agree to disagree then. Both Node and frontend js share the same package management system (npm). Everything is modular because it has to be. When you work fullstack JS and use one package manager for everything, it makes all the sense in the world why things are done the way they are. The same code has to work in Node, Blink, Webkit, Electron, etc.
Re:I finally escaped Node by rpdillon on Wednesday March 24, 2021 @11:19AM (#26568336)
Node's lack of a robust standard library results in significant dependency bloat, even for small projects. I often choose other languages (Racket, Python) for most projects because of this. I tend to consider a large number of dependencies as a risk for the stability and maintainability of projects. Through this lens, adding date handling to the standard library can make sense, I think.
Re:I finally escaped Node by maaanu on Wednesday March 24, 2021 @11:09AM (#26568189)
I think others think differently https://tc39.es/proposal-temporal/docs/
Re:I finally escaped Node by pitay on Wednesday March 24, 2021 @09:57AM (#26567230)
Was the Java utility one that started and didn't run for very long, like a command line application? The JVM (at least the Oracle one) takes a long time to start up, so any application that runs on the JVM takes a long time to start up. The JVM is much better for long running processes.
Re:I finally escaped Node by cyberpunk on Wednesday March 24, 2021 @10:39AM (#26567806)
A vendor gave us a .jar cli tool for managing an enterprise product last year, and I swear it starts up in under half a second (to the familiar spring boot splash too), so it is possible, just uncommon :)
Re:I finally escaped Node by pitay on Wednesday March 24, 2021 @01:49PM (#26570613)
Ah, my bad, my experience is old. Thanks for the correction. :)