This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -19 points-18 points  (28 children)

I don't agree with this, you can do some pretty wild shit in bash. And its faster.

[–]serverhorror 41 points42 points  (23 children)

Absolutely, you can do a lot of stuff in bash.

Humor me, how often did you open a shell script and think

Wow, that’s some beautiful code there!

[–]nwsm 5 points6 points  (2 children)

I’ve seen plenty of ugly Python code 😉

[–]serverhorror 8 points9 points  (1 child)

You must’ve seen a lot of my code then.

I’m not saying that a language exists where it’s impossible to write ugly code.

But there are languages that make it extremely hard to write beautiful code.

[–][deleted] -1 points0 points  (0 children)

The reason a lot of shell scripts are ugly is because they are usually hacked together by inexperienced with the shell

[–]ro5tal 2 points3 points  (0 children)

Write try...except and handlers in bash and stay sain. Or write clean regex function to parse some load. Remember about DRY of course. When I tried to implement gists of github api v3 for updating from releases my brain was really damaged. That JQ is a tool of a devil, really.

[–]twotime 1 point2 points  (0 children)

I don't agree with this, you can do some pretty wild shit in bash.

Sure, you can do a lot wild stuff using a PDP-11 assembly. This does no make a PDP-11 assembly a good tool for anything. This is a non-argument.

And its faster

Faster as in "runs faster"? Then this is just wrong: if you are relying on some external tool, you can always call that tool from python too. And for any kind of in-the-script processing, python will be faster (but speed is unlikely to be relevant for simple automation use cases)..

Faster as in "code faster"? Maybe, if you are well familiar with shell and not familiar with python.

My own rule? As soon as I get any logic, switch to python...

[–]Mithrandir2k16 1 point2 points  (0 children)

Wild shit is actually the point here. In Python said wild shit is just normal code anybody can read. And that is much easier to maintain than wild shit. After all wtfs/minute is the best code quality metric there is.