Friday, November 28, 2008

I'm just about done teaching a series of classes on Bash scripting for the systems admins where I work (mostly junior types). I present a one hour course every other week, focusing on the basics that they'll be able put to use right away.

Pretty soon, I'm going to start a series of similar courses about Ruby. Here's the rub though, I'm not sure where to start. If you had three or four one hour blocks to get a group of junior to mid-level sys admins going on Ruby, what would you focus on?

5 comments:

I think one of the most important points is a good understanding of the IO Class, specially to make scripts that are able to execute external shell commands and the possibility of manipulating the stdin,stdout and stderr IO streams of the commands.

Probably go with the syntax and "naturalness" of it. While I'm not a ruby-head by any means, as a perl guy, and a sysadmin things like the cool "everything is an object" paradigm don't fall into the usefull-to-the-job side of the desk.

If they're familiar with shell programming with perl/bash/whatever pull in what in Ruby makes it better than $favorite_language and maybe pull in any advantages like the lispy proc() or lambda() or whatever it is.

Speaking for myself, sysadmins gravitate to what they know to get the job done. If I need to say, export a database table to a CSV file I can whip something up in perl in a few minutes using Class::DBI and a while loop or three. Show me how to do it more easily in Ruby and they'll be all yours.

I agree about IO - ruby is my go-to language when I need to whip up a simple homebrew test client or server in sysadmin tasks.

As a sysadmin, I find the text manipulation features the most helpful. You know, the sort of thing perl is supposed to be perfect for, but without all the cruft. Do some readability comparisons with some perl code.