Tuesday, December 18, 2012

Python vs Bash

For some reason I liked the idea of language comparison.
Today's topic is "Python vs Bash". 

From internets: "Generally, bash works better than python only in those environments where python is not available."

Bash is great for one-liners, maybe 10-liners tops. For the rest tasks - Python is the clear choice. 
I've used both bash and python a lot. Bash maybe even two times more than python. And the main reason for choosing python over bash for scripting is that python works with read-data, while bash works with "stderr/stdout". In other words:

bash = "raw stdout/stderr text + script logic"
python = "down/upstream data + script logic (+ exceptions control, + multi-threading, + libraries)"

No comments:

Post a Comment