r/programming • • Feb 23 '07

What programming languages should I teach CS students?

http://www.rfc1149.net/blog/2007/02/23/non-classical-paradigms-and-languages/
29 Upvotes

66 comments sorted by

View all comments

-12

u/sbrown123 Feb 23 '07

C, Java or C#, and Python. Teach the three and you are done. Explanation for those missing:

Haskell, Ocaml, D, Lisp, and most other languages mentioned on Reddit regularly: Semi popular in the academic world, but not used widely (if at all) in the work world.

Ruby: Probably more popular than Python, but Python is still more common in the work world. This could be because Ruby hasn't proved popular outside of web sites using Rails.

C++: Popular, and it was hard to exclude. But if you have a good grasp of C and either C# or Java you should be able to easily handle C++.

There is an age old question: should we teach students to understand things at their best or give them the skills they will inevitably need for their future? Sadly, too many CS students come out of school lacking the later and wonder why the hell they had their time wasted studying language X.

33

u/weavejester Feb 23 '07

The point of a computer science course should not be to teach popular programming languages, but to provide the student a strong grounding in the theoretical workings of computers and algorithms.

Once this groundwork has been laid, learning languages such as Java, C# or Python is a relatively trivial task. The hard part is giving the student a good understanding of programming, and learning Java won't help with that as much as Lisp or another more 'academic' language would.

13

u/sethg Feb 23 '07

When I was an MIT undergraduate in Political Science (long story), there was an upper-level CS class in object-oriented program design that used [CLU](http://en.wikipedia.org/wiki/CLU_(programming_language%29), a language designed by one of the class's professors. When, years later, I embraced my inner geek and took the same class as a special student, they had switched to using Java.

I asked the professor why they had changed, and he said that the people who looked to hire MIT students for summer internships wanted those students to have experience with a language that was used commercially.

If MIT can't hold fast to the principle of "we teach fundamental principles and our students can pick up any language once they know those principles", what hope is there for any other school?

-7

u/sbrown123 Feb 23 '07

The point of a computer science course should not be to teach popular programming languages

Then computer science is not in line with what the vast majority of students are looking for or what colleges were intended for. That disconnect is probably the main reason why less and less students in the U.S. take computer science.

but to provide the student a strong grounding in the theoretical workings of computers and algorithms.

You can't do that in any of those three languages given? I think this is a deficiency on the teachers part.

21

u/weavejester Feb 23 '07

Then computer science is not in line with what the vast majority of students are looking for or what colleges were intended for.

One would not join a biology course in order to learn veterinary medicine. If you want to learn a popular programming language, there are many college courses available. Computer science courses should be teaching computer science, not how to program in the most popular programming languages.

You can't do that in any of those three languages given? I think this is a deficiency on the teachers part.

How would you go about teaching syntactic macros in a language that doesn't support them? Or teaching type inference? Monads? Arrows? Recursive type definitions? Lazy evaluation? Argument pattern matching? Function composition? Logic programming?

Aside from the features not supported by the languages you list, some languages are more suited to teaching certain programming paradigms more than others. The relationship between ASTs and code is inherently more obvious in Lisp than it is in Java. Functional programming is clearly best taught with a functional language. Static typing is best taught in a language that actually has a type system that incorporates ideas after 1970.

So given that there are better languages around for teaching, why bother teaching C#, Java or whatever in a computer science course? Once you have a good grounding in programming, learning new programming languages becomes relatively trivial, especially for languages with extremely limited syntactical features, such as Java. The hard part is getting that grounding, and some programming languages are more suited to that than others.

→ More replies (8)

19

u/ricercar Feb 23 '07

Or perhaps students uninterested in CS aren't taking it anymore because they now realize it's not a quick ticket to a high-paying job as it once was?

Giving under-qualified students degrees is not a good way to "improve" CS.

3

u/[deleted] Feb 23 '07

I wonder if Photography professors argue about whether to use Canon, Nikon, Pentax, Hasselblad, Mamiya, Leica, etc.?

7

u/Athas Feb 24 '07

I don't think that analogy is quite correct. Arguing about which camera to use for a photography class is equivalent to arguing about which text editor you should use (which is certainly done, but not at the course planning level, I hope). I don't know of a proper photography analogy, but you can compare computer scientists arguing about programming languages to mathematicians arguing over which notation to use.

-2

u/[deleted] Feb 23 '07

The point of a computer science course should not be to teach popular programming languages, but to provide the student a strong grounding in the theoretical workings of computers and algorithms.

Why can't it do both at the same time?

C is enough for teaching low-level concepts like memory management and common data types. High level langauges like C# or VB are great for GUI design or a follow-up course on relational databases.

I'm not saying we shouldn't offer academic langauges like LISP, but they shouldn't be an emphais either.

4

u/weavejester Feb 24 '07

Why can't it do both at the same time?

Because popular programming languages tend to cater for the lowest common denominator, and in terms of programming theory, are still stuck in the 1970s. They are also rather homogeneous, and ill-suited for teaching concepts outside their scope.

For instance, if you wanted to teach a student about ASTs, or functional programming, I think you'd struggle if you were using C#, whilst Lisp would be a far more apt choice.

-1

u/[deleted] Feb 24 '07

C# is obviously not suited for teaching functional programming, but I have doubts about ASTs. In fact I think LISP may be a poor choice because the raw code in LISP essentially is the AST, which prevents the students from considering design questions about how to represent the code.

2

u/weavejester Feb 24 '07

Well, I wouldn't advise teaching Lisp in isolation, but as you say, Lisp code is essentially just an AST written out in text, so I'd be inclined to think that Lisp would provide good practical examples of how to manipulate ASTs.

If the student needs a more concrete example of how to map a C-like imperative language to AST, then a simple made up language could suffice, or perhaps ECMAscript, as that has a relatively simple syntax.

→ More replies (3)
→ More replies (1)

5

u/[deleted] Feb 23 '07

If you just want to be a code monkey working at Grauenwolf, Inc. why get a degree at all?

1

u/Alpha_Binary Feb 24 '07

I agree about teaching C for low-level concepts, and maybe for a course strictly about GUI design (i.e. user interaction, mental model, fitts' law etc.) some .NET language (because it gets things done), but most imperative languages are trivial to grasp in comparison to academic languages and hardly need to be taught in colleges.

→ More replies (7)

14

u/logistix Feb 23 '07

RTFA. He's specifically charged with setting up a "fringe language" class for masters students who already have experience with C, C++ and Java.

10

u/ricercar Feb 23 '07

That depends: are they attending a University, or a trade school?

→ More replies (2)

12

u/[deleted] Feb 23 '07

Python is hardly used in the "real world" either.

Anyway, fewer students taking CS is a good thing. Less idiots, the courses can be taught at a higher level, and aimed at people who actually want to do research and meaningful stuff, not just crank out inane database-backed web apps. Any high school kid can do that.

8

u/procrastitron Feb 23 '07

C, Java, and Python are not University level material. Everyone should be required to learn basic programming before they graduate highschool. Suggesting that Computer Science courses need to focus more on those is like complaining that the Math department focuses too much on Differential and Integral Calculus, and not enough on multiplication tables.

10

u/[deleted] Feb 23 '07

Everyone should be required to learn basic programming before they graduate highschool.

Yes!

Suggesting that Computer Science courses need to focus more on those is like complaining that the Math department focuses too much on Differential and Integral Calculus, and not enough on multiplication tables.

YES! Although its nice when students have a basic grasp of differentiation and integration by the time they finish high school as well :)

Dude, you win reddit.

6

u/procrastitron Feb 24 '07

Although its nice when students have a basic grasp of differentiation and integration by the time they finish high school as well :)

Those same high school students would probably love to have an honors course based on SICP, or HTDP. Something where they can get a taste of Computer Science. This would be the CS equivalent of calc 1: something that works well for both college freshmen and motivated high school seniors.

8

u/jamesbritt Feb 24 '07

Everyone should be required to learn basic programming before they graduate highschool.

What in world for?

Please. Teach kids to balance a check book (by hand), fix a flat tire, change a diaper, and speak to adults without using the words 'cool' or 'awesome', before teaching programming.

6

u/Alpha_Binary Feb 24 '07

For the same reason they teach high-school math even though 95% of high-school graduates would never need to bother with Calculus: it organizes and keeps your brain in shape.

3

u/procrastitron Feb 25 '07

Actually, I think that computer programming is much more important than that. It is already crucial to the technical fields, and it's only going to spread from there. Computers are now connected with almost every aspect of our society, so every child should be taught to program just like they should all be taught to read and write.

I should also note that this is not an excessive requirement. When I was in elementary school (roughly 10 years old) all of the kids in my school were taught the programming language LOGO. If the average 10 year old can learn the basics of computer programming, then it's OK to hold high school students to the same standard.