views:

342

answers:

12

If you had the opportunity to teach new students how to program for a year, what would you teach? I've always found that a multi-paradigm approach to teaching programming works best, but is it too much for first-year students? Is it better for a student to be great at one or good at 3-5?

At the moment I am looking to help tutor students on the following:

  • x86 Assembly Language
  • C
  • Haskell
  • Java
  • Perl
  • C++
  • Prolog

At the moment these students are only exposed to some very basic Java, so my theory is that these students would be able to expand further from here far better than they would with a basic understanding of just one language.

Please note that the question is not whether students can handle it, because a simple look at the programmes at the top universities show that they can, but whether it is advisable to those not at the top universities to focus on knowing as much as possible. It's not necessarily about knowing a language well, but giving students the ability to pick up and choose the right language for the job, and to become proficient in it as their studies continue.

+3  A: 

I think that depends on how much programming experience they have already. If they are just starting out, then teaching them lots of paradigms might be overwhelming. If they already have a solid grounding, then teaching them several different languages is probably a good idea. I'd also include a data-driven language like ML in there, as it's very different from our normal imperative programming paradigms.

QuantumPete

QuantumPete
We cannot say that all of these students know how to program, and because of this the current course starts (and pretty much ends) with the basics. The problem is that next to all CS students have at least touched programming and that the basics cause them a great disservice to their future ability.
EnderMB
I'm not sure I'd describe ML as "data-driven", but Haskell certainly fits the bill for "like ML". I assume you meant "functional"?
Oliver Hallam
@Oliver Hallam - I did indeed. We learnt SML when I was at uni, it was good to see a functional paradigm, when you've learnt nothing but imperative all your life.
QuantumPete
+1  A: 

I think beginning students would benefit more by concentrating on a single language. I don't think that learning multiple languages helps much until one develops basic programming skills.

I also don't think it is reasonable to think that beginning students would be able to get "good" at 3-5 languages in their first year, unless your definition of "good" is very broad.

But, having said that, it would be valuable to give them some exposure to other languages. I wouldn't try to get them to learn the other languages, but showing them some alternate ways of expressing algorithms would be beneficial.

The good students will be able teach themselves other programming languages if they get solid fundamentals and some exposure to alternatives.

Kristopher Johnson
By good I mean capable; able to take one of the languages they've used, continue with the basics they've learned and to apply it to a project. If we stick to one language (Java) then it'll be the only language they'll want to use, and after 3 years we'll just churn out Java programmers.
EnderMB
Your question states that you are only going to be teaching them for a year. If that's the case, then I recommend concentrating on a single language. If you had asked what should be taught in a 3-year program, I'd have a different answer.
Kristopher Johnson
I don't get to control what is taught in other modules throughout the year or further on in the year. All I can say is that programming experience will be assumed in later modules and there are circumstances where proficiency in multiple languages will be useful.
EnderMB
Well, again I would point out that it is unlikely that your beginner students will develop "proficiency" in multiple languages in one year. Better to concentrate on giving them the knowledge and skills they need to pick up what they need later, rather than try to teach them everything in short time.
Kristopher Johnson
+1  A: 

I'd add to QuantumPeter's response that what you're going for is giving them exposure to concepts and practices. You aren't going to be able to produce great programmers in a classroom setting over the course of a single year, even if you narrow your focus to a single language.

Unless your students are exceptional (and you're a brilliant teacher), there's just too much practical ground to cover. However, you can produce programmers who are competent and ready to acquire experience. So I would agree with QuantumPete that for those who have never programmed, focus on one traditional imperative language for a year, so they learn how to begin to "think" like a programmer. For those who have this basic competency, give them enough exposure to other things that they could "jump in" to a project and start learning more. The variety should help to keep them interested and foster that desire to go out and learn more.

Adam Bellaire
A: 

What's the goal here? Exposure to several languages or fluency? That is the question you need to nail down right away because time is a pretty precious commodity and you simply aren't likely to become fluent in 3-5 of them in a year unless that is all you do and then, I'm still really skeptical. But if the goal is to provide a survey of different programming constructs and use the various languages to demonstrate them, then that might work. I took a class in college where we did a survey of three languages and while I wasn't an expert in any of them at semester's end, I did get a pretty good idea about the topics we were really learning - at the time it was recursion, pointers, some algorithms, memory.

If your goal is fluency and having a technology where they're useful, then I'd stick to one. Pick one that covers as many of the bases as you'd like to address and then you can always do a little "aside" piece about something the chosen language doesn't cover completely or as well as you'd like.

Just my two cents.

itsmatt
The goal is to provide a platform for students to become proficient in the language THEY want to use. The aim is not to make them great programmers in every language, but to give them enough to be able to pick any language they want to use and to be able to put it to practice.
EnderMB
So pick a few that you like and run with it. I'm a practical guy, so I'd pick languages that have application today. I'm sure some folks are writing Prolog but not in the industries I've been in. Nobody I work with does x86 assembler, but I'm sure there are many who do. Best of luck!
itsmatt
+1  A: 

Assembly language is the best case of imperative programming, Haskell is the fine example of functional programming and the prologue is good for the logical programming. So they should be tought at least superficially. Maybe Smalltalk are better than a C++ for showing basic OOP principle. And I don't see any profits in learning C, Java or Perl on the first year. IMHO these languages should be tought in a separate courses.

akalenuk
+1  A: 

I think you're trying to do too many things at once. Try teaching them just one-or-two languages, and give hints that there are other paradigms out there.

E.g. if you're teaching an OO language, you will probably want to teach some simple design patterns. You could then say, "Of course, most of these patterns are just ways to wedge Functional idioms into an OO language." Give a minimal introduction to Haskell -- just enough to show what you meant -- and then move on.

dysfunctor
A: 

You can show several languages to demonstrate common programming practices or techniques, but if the goal is to learn programming, I would pick one language to concentrate on. Occasionally show snippets of other languages, but make it clear you are showing a different language. Once they have learned one language, the syntax of the others will be easy for them to learn.

Jim C
+2  A: 

Yes, in fact, in most typical College Computer Science programs, there is a core class called "Programming Languages" where a survey of various programming language paradigms & implementations is done.

Among other things we covered the concept, such as:

  • static versus dynamic scoping
  • type systems, i.e. weakly typed versus strongly typed variables, inferred types, etc.
  • compiled versus interpreted languages
  • object oriented design
  • functional programming
  • aspect oriented programming
ceretullis
Typically this is not a first year course.
tvanfosson
That's not typical, I would say. I know a lot of unis in the UK only teach you Java or C++ and leave it to you to find out more if you need it.
QuantumPete
IMHO, In the USA this is a very typical class. IIRC, is a core requirement for undergraduate students at nearly every major university computer science program. At my univ. this wasn't a freshman class, I've heard of programs where this was the first CS class.
ceretullis
I had a few classes that could fall under this heading at Waterloo ranging from first to fourth year courses depending on the level of detail as some concepts like compiled versus interpreted are first yar but object-oriented design is more of a 3rd year course that is now 2nd year, IIRC.
JB King
A: 

I would suggest that one should start with functional programming to get the basic ideas, then move quickly to something more "cool" like programming in e.g. seaside to get them using OO without really realising, and doing some imperative programming.

From there you can either get students to be better at using the skills they have, comparing the approaches available, understanding efficiency, etc, or move them to some other paradigms, so that they at least know what is out there.

Marcin
+1  A: 

I taught programming languages for 8 years at a big-name school. This was not for intro students, but I found that in one semester I could make pretty good functional programmers out of them, and they'd learn a little dynamic OO in smalltalk/ruby style. That plus some technical material on programming-language theory was plenty for one term.

I think if I had a whole year for beginning students I'd spent a semester teaching Lua and a semester teaching C. The Lua group would get a little functional programming; the C group would understand pointer arithmetic and what the machine actually does. But that's speculation; the preceding paragraph is based on N years of experience.

The advanced PL students have tended to become successful practioners: Microsoft, Google and startups (including most of the single-digit employees at facebook) are popular choices.

Norman Ramsey
+1  A: 

Warning: Python is my hammer of choice.

If it were me, I'd teach the course in Python. It has a simple syntax, good library support, a great "beginner's" IDE/debugger in IDLE, and a large community with good documentation.

In this case, though, one of the better factors is going to be that Python is reasonably good at many, many programming styles. Not perfect, mind you, but good enough to create a firm base in imperative and OO and cover a lot of the concepts of functional programming, as well as supporting a handful of more obscure types as well, without having to switch languages.

Or, too put it simply, Don't Repeat Yourself. :)

J.T. Hurley
A: 

Possibly a more interesting question is "Is it possible to learn several languages" at once. I remember learning Fortran77 and Ada83 at the same time as an undergrad and finding it very difficult to separate the (obviously very different) syntaxes. If it is the students first attempt at programming, I suspect learning more than one at once would be difficult.

Colin Desmond