4 ms·
At my current job we've started using Node.js for a lot of windows based migration jobs and shell scripts, historically where we would have used Perl. We're mos
by merpnderp 10y ago
At my current job we've started using Node.js for a lot of windows based migration jobs and shell scripts, historically where we would have used Perl. We're mostly C#, but data munging and migration is just a lot easier and faster in Node.js or Perl.
I'm curious on what we're missing out on by using node instead of perl?
- cutler 10y agoRead David Blank-Edelman's "Automating System Administration with Perl" (O'Reilly) and you'll see.
- SwellJoe 10y agoNode is getting pretty good. I'm a Perl developer of many, many years, and it is still my go to for command line scripts (and also web, but only because I really like Mojolicious and it happens to fit into existing systems). But, building command line tools in Node is no longer a crazy idea. It's still gonna be more verbose, by a lot, than Perl, for many classes of problem (data munging, file operations, almost anything that needs to interact with the OS), but the language has gotten nice with ES6. The libraries are pretty good. It's really hard to beat the built-in "while <>" semantics of Perl for writing concise, clear, programs that take something in from a file or STDIN and spit it back out. Perl is effectively a DSL for writing command line scripts that live in a UNIX environment (they work OK on Windows these days, too, now that Windows has a reasonable shell with reasonable semantics for scripts like that). If you want to write many small commands that are composable, Perl is a perfect fit. If you want to write one big application that does a bunch of things, the benefits of Perl look smaller and may even be outweighed by the bigger ecosystem of JavaScript/Node/npm; you can amortize out stuff like options handling and file/stdin handling across all of the functionality and it won't look like such a big part of your program anymore, compared to Perl (which gives you most of those things practically for free with one or two lines of code).