4 ms·
Can somebody explain the advantage of doing it on the command line vs in Python or R? What would a practical use case look like?
by c06n 7y ago
Can somebody explain the advantage of doing it on the command line vs in Python or R? What would a practical use case look like?
- robertelder 7y agoThe most significant use case for all things command-line IMHO is automation. Also, I would change that from "command line vs in Python or R" to "command line and Python or R". Build a pipeline like I've discussed in the article, then pipe it into Python or R.
- criddell 7y ago> Build a pipeline like I've discussed in the article, then pipe it into Python or R. Why not just do it all in Python or R? That way you also get something that will probably work on non-unix platforms.
- robertelder 7y agoOver the years I've found that I usually fall into a pattern of starting with low-fidelity automation in languages like shell and slowly re-writing it over time into more higher-level languages, usually python first, then Java. This way, unimportant tasks can be automated in less than 5 min with one of these shell commands. If it breaks or has errors, no big deal. Python works well for figuring out the structure of the solution as an actual program, and then finally a language with static type checking when it really needs to run without errors.
- criddell 7y agoI go to Python first because it's nice to be able to single-step through the script with a debugger and monitor exactly what's happening. I also know Python a lot better than shell script so it saves me a lot of time as well.
- fizixer 7y agoPlease see my comment to this thread (which links to one of my past comments): https://news.ycombinator.com/item?id=21614511 https://news.ycombinator.com/item?id=21614511
- ibern 7y agoThe advantage is that it's faster to prototype/write on the command line and usually ends up being less verbose (although potentially harder to read). It's easy to see what you're data is doing as you work with it and incrementally add pipes to new commands. I like to use command line tools for for one-off tasks that I'm unlikely to repeat. If there's a task I know I'll need to repeat or is too cumbersome to do in a couple of lines, I'll reach for Python.