views:

2200

answers:

6

Suppose there were several projects mostly maintained by smart interns, who eventually leave after a period of time. Scripts are used here and there in key parts, for example, to back up a database, rename it, zip it, move it over ssh, unzip it, and then to restore it with different settings. You know, the scripting stuff.

The programming languages for the application side is set, but those for scripts have been relaxed. Currently there are probably healthy mix of bash and .bat file, and maybe some Perl.

1) To avoid language proliferation, and 2) because I don't want to force bash upon future Windows programmers, I'd like to set an "official" scripting language.

Google picked Python for this, and it's famous for being readable, easy to learn, and having good library; however, I personally don't find it that readable compared to C-like grammar, Pascal, or Ruby.

In any case, if you were to be forced to use only one scripting language on a Windows machine (with Cygwin if you want to) for all scripting, what would you like it to be, and why?

Related religious wars:

+11  A: 

PowerShell - designed from the ground up to be a Windows scripting language, and it can hook into the CLR for advanced functionality.

(yes, I realize this doesn't run under cygwin... but why is that a requirement?)

ahockley
I meant to say that Cygwin is available for ssh and other things if needed.
eed3si9n
Not a problem. Google for "powershell ssh".
le dorfier
A: 

Powershell. It's got the breadth and the depth, and is fully supported (now and in the future.) Unlike Cygwin, for instance.

le dorfier
A: 

Gah. I was going to say "powershell" but I was too busy coding powershell to send my answer here, that 2 other people beat me to it.

GregD
+3  A: 

I'll try to provide an alternative - JavaScript and VBScript work fine too even on Windows versions long gone, and they don't need a seperate installation like PowerShell. ;) Of course, PowerShell has more power :P

Vilx-
+2  A: 

When I've written cross-platform product installers, coding a UNIX shell script for Linux/Mac/Solaris etc. is really easy, but trying to do equivalent tasks in BAT is like working in the dark, underwater, with both hands tied behind your back. I can't state strongly enough that BAT scripts are a blight on humanity.

So what I've heard about PowerShell makes me happy. It's a life-saver for Windows developers. The only trouble is that I believe it's still a separate install, it isn't available by default (I've read that it'll be on Windows Server 2008 and Windows 7).

Oh well, it only took Microsoft 20 years to replace BAT scripts with something as capable as UNIX shell, so I guess I shouldn't be too ungrateful! >:-P

Get the installer for PowerShell here:

http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx

Bill Karwin
+2  A: 

I'd urge you to give Python a chance. It looks a little odd to 'C' programmers at first, but its easy to pick up and more importantly easy to remember. You are going to have interns of various skill levels using and modifying the code so you want something that can draw from a wide user base. And if you are going to go to the trouble of installing something new why choose powershell which is going to be a dead end for anyone using it.

Brian C. Lane