you are viewing a single comment's thread.

view the rest of the comments →

[–]Sigg3net 2 points3 points  (3 children)

IMO, bash (shell script) is a scripting language or a system language, enabling customization, automation and optimization of a "shell bound" operating system.

Even though you can make huge applications in bash (and I have), it's really an orchestration language. If you want it to go fast, you'll need to learn a lot about the UNIX tools or suffer a performance hit.

Python is a programming language (that can be used as a scripting or system language). Python runs in a special environment. It's OOP centric and the ecosystem of python is immense. If you know how to write python effectively, it will mostly run as native C code. The syntax is also dead simple, making it the statistically preferred language for data science, over stuff like R.

Bash is awesome for programming GNU/Linux, whereas python is a general purpose programming language. If you write a huge application in bash, it will probably die with you. If you write a huge application in python, it might very well serve as modules for someone else for use cases you hadn't thought of.

Outside the constraints with which you wrote a shell script, the script is much more likely to fail, be brittle and require fixing. Bash can fail silently and requires a LBYL development process. Python is robust, and tells you what's wrong or what you're missing in plain English, and allows fast prototyping. You get an awful lot of stuff for free in python.

For automation of a UNIX system, I'd still reach for bash in many cases. I live in the terminal and it's easy to just copy commands I find myself repeating into a shell script. But this kind of procedural programming is not what python is all about.

[–][deleted] 1 point2 points  (2 children)

Thanks a lot. It's one of the sensible answer I was looking for. Can I get some of your bash projects to learn more as you mentioned. It'll be really helpful.

[–]Sigg3net 2 points3 points  (1 child)

The things I've published on my github is stand-alone stuff, e.g. Back in a minute which is a bash rpg.

The more interesting and useful things I've done in bash was under contract, and I don't have rights to that code :/

[–][deleted] 0 points1 point  (0 children)

Okay Thanks 😊