Faculty of Engineering and Mathematical Sciences 
Not logged in (login)

help4407


This forum is provided to promote discussion amongst students enrolled in Open Source Tools and Scripting (CITS4407).
 
Options:
RSS cloud
Jump to:

Bash vs Other Programming Languages (eg Python or C)

1 of 390 articles shown, currently no other people reading this forum.
photo
From: Christopher M.
Date: Tue 9th Jun, 4:50pm
Actions: 
        Login-to-reply

 

A great question Kerrie;  and thanks to Lee and David for their viewpoints - all correct, because 
there's no single one-size-fits-all solution or language for the majority of computing tasks.


As David stated, it's not reasonable to compare what we've completed in assignments (for the purpose 
of demonstrating that you've learnt something), and developing a new application in your favourite 
language.  And if you're equally fluent in a handful of programming languages, compiled or 
interpreted,  then you'll need to make your decision based on the best fit for the application domain, 
how much leverage you can get from existing tools and functions/modules, and whether there's any 
constraints such as speed, resource usage, readability, maintainability, and cost.

There's many occasions, not just my experience, where bash and friends are perfect for building a 
prototype of an application, because many of the necessary components already exist as other, external 
programs that can be invoked 'for free', and all we need to worry about it getting the input+output 
plumbing and formats correct.  Such prototypes can be easily demonstrated.  Then, if the prototype 
looks promising, and if speed is a future concern when the program will be connected to hundreds of 
clients per-second then, yes, devote the necessary resources and time to build a solution in a 
traditional programming language.

But everything exists on a spectrum; a working bash script may be considered too slow, so replace it 
with a developed Python program which, in turn, may be considered too slow, so replace that with a 
compiled C/C++ program.

There's been many occasions when I've started building a solution in a shell, with plans to replace it 
with a program one day,  only to realise that it took minutes to develop, it's only 20 well-documented 
lines long, takes less than a second to run, and only runs once a day or once a month anyway.  In such 
cases, there's no benefit at all in rewriting it.

Also, I think as an artefact of using languages/tools that haven't changed much at all for forty 
years, I find myself far less obsessed by ensuring that the same version exists on all the platforms I 
use, Linux, macOS, Raspberry Pi, for me.  The scripting tools are very mature, and their core 
'identical' in bash, zsh, and ksh, whereas Python, and others, are still in transition (or recent 
upheaval).

_______
Interesting topic Kerrie, thanks.

It'd be great to hear from some other students too - particularly those who, in February, said that 
they'd never programmed anything before.

Related articles

Bash vs Other Programming Languages (eg Python or C) (all 4) RSS
├─ original   Sun 7th Jun, 11:20am, Kerrie B.
├─ reply 1   Sun 7th Jun, 4:00pm, Lee dB.
├─ reply 2   Sun 7th Jun, 7:05pm, David M.
└─ THIS   Tue 9th Jun, 4:50pm, Christopher M.
This Page


Program written by: [email protected]
Feedback welcome
Last modified:  3:57pm Aug 06 2020