Hacker News new | ask | show | jobs
by ohples 735 days ago
> Python and Lua are already well suited for the typical scripting tasks (plus there is good old Perl). And I would actually recommend them for any non-trivial scripts as the maintenance is so much easier.

I have some personal rules of thumb/guidlines around this, if a bash script does any of the follow it should be put on the docket to be converted to a Python script/app:

- a nested for loop with more then one level of nesting.

- anything involving arrays/list.

- anything involving json beyond simple queries.

- more then 5 functions.

1 comments

I have a much simpler heuristic. More than five lines of work: use a real language. There are just too many bash foot guns to do anything more sophisticated than pipe one executable into another.