hudebnik: (teacher-mode)
hudebnik ([personal profile] hudebnik) wrote2011-05-06 12:48 pm

Call for geek help: scripting languages

I'm teaching a Survey of Programming Languages course in the fall. The goals of the course are to teach students how to learn a language, and to introduce students to ideas and techniques they didn't see in their first-year Java courses; if they happen to learn a language that gets them a job, that's a bonus. They're familiar with (if not necessarily good at) class-based OOP and imperative programming; they haven't seen higher-order functions, closures, continuations, comprehensions, macros, or declarative programming in general. Most of them haven't seen any kind of parallel or multithreaded programming, nor network programming.

Traditionally, this course has been about 50% C++, 25% Scheme, and 25% Prolog, but the C++ content has been moved to another course. After polling the preregistered students by e-mail, I've decided to fill the gap with some reasonably-modern scripting language. Leading candidates so far are PHP, Python, Ruby, Lua, Erlang, and Scala.

I can make an unbiased choice among these because I don't really know any of them (although I've written some PHP-based server-side web scripts). So I'll be learning them just ahead of the students :-)

Any advice?

[identity profile] goldsquare.livejournal.com 2011-05-06 05:47 pm (UTC)(link)
Are you looking at "makes them employable", "typifies production tools", "demonstrated ordinary scripting concepts", "is used in the private sector a lot" or what?

PHP, Python (and PERL) are very commonly used. Ruby and its ilk are wildly popular and very good. I've only got a bare "magazine article" knowledge of Scala, Erlang and none of Lua... which may be a comment on me, or it may be a comment on how ubiquitous those languages are.

I figure, if you can't write in DOS Batch language or JCL, you ain't tryin'.

[identity profile] hudebnik.livejournal.com 2011-05-06 06:14 pm (UTC)(link)
This course will only spend maybe a month on each language, so I don't expect them to walk out with a professional/employable level of fluency in any one of the languages.

I tell them at the beginning of the course "If your [prospective or current] employer asks whether you know Language X, the correct answer is 'No, but I will next week.'" This course is intended to give them practice learning new languages and putting them into the context of the world of programming languages, as well as to expand their minds with programming techniques that you couldn't already do in 1965 Fortran :-)

I've written some perl-based Web server scripts too, and always felt as though it was purely trial and error: I never developed a mental model that enabled me to predict what the language would do with any given string of source code. Which means either the language is too complex, or I'm too stupid. In either case, I didn't want to do perl.

And JCL is right out :-) (Yes, I studied JCL the spring of my freshman year, retching all the while....)
siderea: (Default)

[personal profile] siderea 2011-05-06 06:56 pm (UTC)(link)
I've written some perl-based Web server scripts too, and always felt as though it was purely trial and error: I never developed a mental model that enabled me to predict what the language would do with any given string of source code.

You mean... it's not just me? :}

[identity profile] goldsquare.livejournal.com 2011-05-09 04:18 am (UTC)(link)
Once you've learned APL, PERL is actually easy to model. :-)

[identity profile] goldsquare.livejournal.com 2011-05-09 04:17 am (UTC)(link)
Hmmm. This sounds like a very interesting course.

If that goal is your real goal, then I'd focus on the more interesting languages such as Scala and Erlang. Python is not all that interesting, except that it's collections/iterators/generators are useful. Insofar as they grew out of PERL and its map operator... maybe PERL is interesting too.

I might, also, look at something like BASH - for a week or so. The notional idea of a glue language, and some discussion of how pipes and files are both more powerful than one might think AND also somewhat too primitive, might be useful.

I'm going to be very curious what you end up teaching.

[identity profile] hudebnik.livejournal.com 2011-05-09 10:44 am (UTC)(link)
I might, also, look at something like BASH - for a week or so. The notional idea of a glue language, and some discussion of how pipes and files are both more powerful than one might think AND also somewhat too primitive, might be useful.

Almost all the students in the course will be concurrently taking a Unix course that covers shell scripting (and C++, among other things).

[identity profile] ubiq31.livejournal.com 2011-05-06 07:30 pm (UTC)(link)
Perl is installed most everywhere by default, so it's never a bad choice (and is my choice of language for sysadmin tasks, day in and day out).

That being said, I'd say Python over PHP. PHP is popular, but it's also derided among the 'more serious' languages (though I don't know whether that's more because it's what all of the HTML coders learned when they needed to beef up their resumes and skillsets).

Knowing Python or Perl these days will do well where C++/Java is a bit 'heavy' or the like for certain tasks. Few places will choose to allow PHP to be installed for system-level tasks when Perl or Python are already installed and much more suited for the role. PHP is reasonable for web-oriented things...but if that's not the focus your students might be looking at, there are better choices ;)

[identity profile] ubiq31.livejournal.com 2011-05-06 07:31 pm (UTC)(link)
(So my choices would be Perl > Python > Ruby > Lua > PHP...Ruby has some nice things going on and Lua...well, it's not PHP) ;)