3 ms·
Has CLI taken on a different meaning than Command Line Interface? The primary purpose of javascript seems to be for adding code to web pages. Javascript can't
by mikewarot 5y ago
Has CLI taken on a different meaning than Command Line Interface? The primary purpose of javascript seems to be for adding code to web pages.
Javascript can't access the file system, what good would it be for most command line programs?
Python seemed like a far better choice until they abandoned 2.x because of their Unicode fetish. There are hints that 4.0 won't happen.
C, C++, C#, Java, Clojure, Rust, Pascal all seem like better ways to go for the command line.
- thiht 5y ago> Javascript can't access the file system, what good would it be for most command line programs? I mean, NodeJS has been around for more than 10 years now? Of course you can write CLIs with JS.
- mikewarot 5y agoMy initial reaction: What does Node have to do with Javascript? It would be like some random library coming up every time I search for pascal. Googles node.js (instead of saying -node.js like I did yesterdays search about javascript and command line): Oh... it's not a library, what a stupid deceptive name for an interpreter.
- dragonwriter 5y ago> I mean, NodeJS has been around for more than 10 years now? And server/desktop support (with filesystem access, though the specific mechanism/API was different for different implementations) for JS is much older than Node; Rhino and WSH JScript support came about in the late 1990s.
- dragonwriter 5y ago> Javascript can't access the file system No, code running in a browser can’t access the file system, because browsers don’t expose an API for that. Other JS environments (e.g., Node, Windows Script Host, etc.) have different capabilities. A CLI app based on JS almost certainly isn’t targeting the browser, so browser limitations that don’t apply elsewhere aren’t relevant. > Python seemed like a far better choice until they abandoned 2.x because of their Unicode fetish. I’ve done plenty of CLI tools with Python, both 2 and 3, and its definitely not worse for that purpose now than it was with 2.x.
- schwartzworld 5y agoYou can write JavaScript outside the web browser using nodejs. You absolutely have file system access. For whatever warts the language may or may not have, command line scripting in JS is a pleasure. Often you don't care about or need the benefits of those other languages. You can write CLIs, web servers, wrangle data or even just replace shell scripting.