3 ms·
15 seconds on the shell beats 5 minutes trying to debug a ruby or pythons script. That said I would agree as soon as something becomes complex or you need to d
by hpoe 5y ago
15 seconds on the shell beats 5 minutes trying to debug a ruby or pythons script.
That said I would agree as soon as something becomes complex or you need to do computation looking outside the shell is probably a good idea.
The huerestic that I use is
1. Do I need to do math? Move out of the shell.
2. Is the logic starting to get complicated enough that I need consider creating modules? Move out of the shell.
3. Is there enough code to fill more than one screen? Out of the shell I go.
4. Is this going to be something that needs robust error handling and that will be used frequently outside of me? Out of the shell.
I've found that as long as I don't hit one of those conditions hacking around in the shell is quite powerful and useful.
- chrisfinazzo 5y agoFor me (a Comms major/IS minor as an undergrad), most of what I'm manipulating is text and shell is just a tool to speed up the process and as such doesn't have those concerns. Still, I've found Rake and Make - as simple containers for shell rather useful and more flexible - newlines are sane, far less of this `\n` nonsense. ^ An odd complaint, but it just seems like the terminal or the environment should handle this without input from me. Now if only I could do something about Make syntax requiring tabs...
- pjmlp 5y agoIn what concerns UNIX shell, Python always wins for me, other than very basic scripts to automate launching applications, or a pipeline.
- einpoklum 5y ago> 3. Is there enough code to fill more than one screen? Out of the shell I go. Completely disagree. Just parsing a command-line takes a screen's worth of lines. Hell, just the usage info message for a script can take that much. > 4. Is this going to be something that needs robust error handling and that will be used frequently outside of me? Out of the shell. Disagree even more strongly. You're saying never to write shell scripts for use by many people. Actually, shell scripts make up a lot of a typical systems' /usr/bin and /usr/sbin - and that is fine and proper.