Hacker News new | past | comments | ask | show | jobs | submit login

If you're doing crazy heavy processing or something, it's not the right tool. But you wouldn't do that in JS. You'd shell out or call something native.

Node is best used managing parallel streams of stuff. Perhaps surprisingly, a command line application is a great example of that.

I would much rather build a nontrivial command line app in node than in anything else. Try it, you'll see.




There are tons of better options to choose from. If you're not making a web UI, literally any choice is better than Javascript, unless that is the only language you know.


Compared to most languages you'd use for a commandline application, node has a simple, usable async I/O interface, and the libraries you can get for it actually assume async.

If you need that, there are only a handful of choices and node is one of them.


Which scripting language doesn't have an async library available (most of which don't descend into the Chinese Hell of Being Called Back Ad Infinitum)? Granted, most of the other languages have lots of libraries that don't play well with async, but then again, that's mostly because they have lots of libraries. And it's not like there's a guarantee that a random Node package won't screw you up, either.

I'm not really arguing against using JavaScript for command-line interfaces. I'd much rather see that than the same in PHP, and if the programmers don't know Perl, Python or Ruby, then why not? We're talking about an area where there are still way to many hacks that consist of badly written bash scripts with lots of inline sed and awk...


concurrency != async


Brainfuck, then :).

People don't use node for the Javascript. They use it for the modules, and node is the glue that coheres them (and does an admirable job at that).

When you're comparing writing a CLI app in node to writing it in something else, it's a world of difference, and that difference is npm. With good modules, writing a CLI app has little to do with Javascript -- you're more specifying config and flow by passing some options and streams around, and you're done.


How about writing it in Perl and using CPAN instead of npm then? There are tons of modules in CPAN. But since Perl is not cool any more, there's always Python and pip.


I have yet to see any language repository that constrains quality in the way CPAN does with CPAN testers.

CPAN modules must provide POD documentation, must provide a regression test, and must run on several dozen platforms before PAUSE accepts to publish it on CPAN.

Python or Ruby modules, or my favorite Lua, are a bunch of junk compared to CPAN.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: