For
Spartrekus ,
I will add my 10 cents this already long and interesting thread.
Consider my academic background is Mathematics and Finance, I learnt many programmnig languages because I like to program computers.
First of all, from your question I guess you do not know any "scripting" language. So I will make some considerations any script-savy programmer knows very well.
1] Choosing a programming language is also a
matter of aesthetics. As
Wittengstein said "My language is my world". So, if I decide to use e.g.
Ruby I know that in my world there are not pointers, I can not refer directly to memory location addresses. On the other side in Ruby world everything is an object. An integer, a float, a string, a file etc. all is an object. Each object can "receive commands" so, suppose "
s" is a string, I can convert a string to a floast as "
s.to_f" , suppose now "s" is a data-structure, i can convert the structure to JSON with "
s.to_json". I can read a file content with "
text = File.open("./foo.txt", "r").read" .
Can you see the beauty and elegance of all of this ?
2]
Sometimes it is at all not possible to use C. Consider web development, if your code must run in a browser you must use
Javascript. If you don't like it you need to find a XXX --> Javascript compiler or you are out of the game.
3]
Portability. In the years I wrote some programs in
Python (wiht Tk) for customers using Windows. I always developed all the stuff in Linux and then run them on the customer machines with almost zero issues ! ("almost" because, path names are not the same across different OS(es) )
No problem, i fixed the issue in a few minutes changing the source code on the customers machine !
4] If you try to use: Python, Common Lisp, Scheme, Ruby, Node ... you will see they have wonderful thing: the
REPL (Read Eval Pring Loop) ! Developing with a REPL is pure happiness.
4]
Libraries. Sometimes you must develop niche stuff. During phd I wrote a lot of statistical software. In that case I decided to use
R. In my opinion R is really an ugly language but it has so many high quality libraries it would have been stupid to use another language.
5]
Goodies. Some languages let you do very cool stuff like modifying functions when the code is running ! I tried this on Allegro
CommonLisp many many years ago, I admint I neved had the need to use this feature.
6]
Time - Money - Happiness. If your customer asks for a program written in language X, ok you do it that way. But usually they ask a program that solve a specific problem, running in a specific OS and costing below a given amout of $. So, now the choice is up to you, the programmer, you choose the language which maximizes the objective function:
obj = f(HappinessInDevelopment, RequiredDevelopmentTime, ExpectedPortabilityIssues)
7]
Ipse Dixit. In "The Unix Programming Environment" by
Kerninghan and Pike, more than half of the book is devoted to shell and shell programming (which is how to use the system default scripting language). So, you see, also the Masters belived a scripting language is useful and a more appropriate tool than C in many occasions
Personally i prefer not to use "
sh" because of portability, If i write a script in FreeBSD in sh, I can not expect it to run in Linux. Not because of "sh" per se, but because core commands are different e.g. "ls".
Bye
Nicola