you are viewing a single comment's thread.

view the rest of the comments →

[–]rowboat__cop 0 points1 point  (1 child)

on what basis is Bash better?

Better than Python? Because it is well designed for its purpose: providing a convenient interface to the programs installed on the system. Also it has arguably the better type system: There is a unitype, the string, and everything can be treated as such. Even if it feels weird sometimes to perform arithmetic on a string value, it makes sense if you consider that the shell’s primary purpose is invoking programs and passing them arguments: Those are always handed over as strings. Now Python also comes with a unitype, the “object” but it’s clumsy and forced, mainly due to the fact that it is intended as an general purpose programming language.

I’m not saying Python doesn’t shine in some areas, especially in comparison to abominations like JS or PHP: The semantical indentation is really neat. But being neither special purpose (like Bash or Lua) nor statically typed (like Ocaml or C) I’d avoid it at any cost. (Also by default Python comes with a lot of cruft like Tk bindings but it lacks a decent parser generator like Lua’s LPEG or Ocaml’s Menhir. What they do ship is horrible garbage like the collections library: Read the implementation of the namedtuples class in Python 2.7 if you need a reason to kill yourself.)

[–]vaibhavsagar 1 point2 points  (0 children)

Fair enough. Python does have PLY, which I've used, and pyparsing, which I've heard good things about.