Rod wrote:
I have 3 questions for all the programmers and script writers here.
If you had a student under you, what is the first thing you would teach them about scripting?
Find existing code and read it. Try to understand it. Try to grasp why the author choose that solution or particular idiom and determine if it is better than what you have seen up to now. Is it more readable? More efficient? More amenable to changes? Ask questions. To yourself, to Google, to people in the know (that would be me, if you are my intern). Then write code. Don't be satisfied with it just because it works. It should "look good" (this assumes a fairly decent level of self-criticism).
Rod wrote:
Why?
Because that's how I learn new computer languages. And in 30 years, I have learned quite a few, and rather quickly achieved a reputation of expert each time (but I keep reminding myself that in the land of the blind, the one-eyed man is king)
Rod wrote:
And .......
Which scripting language would you teach them?
The more generic one, but it depends on the actual needs, too. Not so long ago, I had the choice between Python and Scheme, to code scripts for some obscure software authored by mostly unshaven Scandinavians(*) that I play with in my spare time (the software, not the Scandinavians). Scheme is Lots of Idiotic and Stupid Parentheses, and Python has a lot of uses elsewhere. So I took Python, and 300 lines of code later, in my day job, they look for someone who can write Python scripts to configure web servers... wink, wink, nudge, nudge, see what I mean? Plus Python object-like programming makes is really easy. Say, for instance, that you are writing a piece of code that draws periodic decorations along a curve. You want to draw sines, triangles, squares... either you write three different pieces of code despite all the common stuff, or you put a lots of tests and generate spaghetti code, or you define a generic class that you derive to replace a couple of methods to draw squares, triangles, or sines. Your choice.
(*) OK ,there is also a Russian in the gang, and may be even some uncouth French...