Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As other comments have pointed out, it seems like the author is looking for PowerShell. I have used a fair amount of PowerShell and it always leaves me feeling like I should just fire up Visual Studio and learn C#. I think that shell languages should prioritize terseness at the expense of readability, allowing experienced users to accomplish their goals as quickly as possible. Any code that you expect others (or yourself) to maintain in the future does not belong in a shell script.


>Any code that you expect others (or yourself) to maintain in the future does not belong in a shell script.

That is a gross generalization that is not true in many, many circumstances. Creating a full-blown application requires several more steps and much more maintenance due to compilation and packaging than writing interpreted scripts. Whether it's PowerShell, Python, or something else, scripts solve an accessibility problem: not everyone knows how to, is comfortable, or has the time to create compiled applications.

Additionally, PowerShell in particular has excellent self-discovery and help facilities built into the language. The Get-Help cmdlet can be used on any script or cmdlet to retrieve its associated documentation. Tab completion means I don't have to guess what classes, namespaces, members, parameters, etc. are available and I can even be lazy and not use Get-Help to discover them.


Couldn't disagree more.

Any code that you expect others (or yourself) to maintain in the future does not belong in a shell script.

Why? A shell script is often the best tool for the job. If your reason is that shell scripts aren't maintainable, then this is a circular argument basically amounting to "we shouldn't make shell scripts maintainable because we shouldn't ever maintain shell scripts because shell scripts aren't maintainable".

allowing experienced users to accomplish their goals as quickly as possible

Having both short and long versions of each flag seems to give you the best of both worlds.


I agree that ideally shell scripts should be maintainable, and that designs which allow both succinctness and maintainability – like supporting both short and long flags – are preferable. But there will always be cases where you have to choose between the two, and in those cases I think a shell should choose succinctness. For all of the Unix shell’s weaknesses as a programming language, it’s an incredibly powerful tool for interactive programming, writing one-liners at the shell prompt. And when you’re trying to program as close as possible to the speed of thought, every keystroke counts.


And when you’re trying to program as close as possible to the speed of thought, every keystroke counts.

And when is that ever important? I've been in development and sre roles for decades, and I've never been in a situation where I have to program at the speed of thought.

The only time I've seen milliseconds matter is watching movie depictions of hackers.




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

Search: