Npm has more abundance of good packages. They are typically better documented and easier to get started with, sadly :(.
JVM has some really great stuff - things which are lightyears ahead of what is there in NPM. Much of which started as university projects, as Java is popular at schools.
I wish JVM developers took a hint from others and started making very easy and fun documentation, but have no high hopes.
Hi Mike! Big fan of your work! Have been for years, so it's a pleasure seeing you have replied to my comment.
My latest example of this is the Apache Commons-Net Java package [0]. I wanted to make a toy Telnet server as an example for a friend asking how to do so.
I gave trying to install the library a good 20 minutes in my evening at home. Couldn't find a simple Maven "this is how you install" and no "easy 1-2-3 get started with this library" text either.
After looking around for a while, I decided to check how to do it in Node. It's super easy, you just do
require('net').createServer((socket) => socket.write('Hello from a toy telnet server!')).listen(8080)
And that is all! Got my task done in 5 minutes, and my friend learned something easy. My takeaway is that for software to be successful, being technically sound is only the first half of the marathon. You also need to make it accessible.
A telnet server is just a socket connected to a pty, no? I'm not sure there's much to it, which is why it's so easy in node.
I guess in java you'd do the same program something like this:
ServerSocket server = new ServerSocket(8080);
while (true) {
try (Socket sock = server.accept()) {
sock.getOutputStream().write("Hello world!".getBytes());
}
}
It's a bit more verbose, but hey, that's Java.
I think maybe the issue there is you got distracted by the idea that you needed a library. Commons-Net doesn't actually provide a telnet server because it doesn't need to.
That said, I agree that Commons-Net doesn't have great docs. I think it's fallen out of use over time. These days if you wanted a powerful non-blocking socket library you'd use Netty or VertX. The docs for Netty are much better:
Cheers for the example. The Commons-Net library was where I ended up after some searching - so my experience is of someone who wants to get from 0 to 100 asap.
Npm has more abundance of good packages. They are typically better documented and easier to get started with, sadly :(.
JVM has some really great stuff - things which are lightyears ahead of what is there in NPM. Much of which started as university projects, as Java is popular at schools.
I wish JVM developers took a hint from others and started making very easy and fun documentation, but have no high hopes.