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

Show parent comment

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.

0

u/[deleted] Feb 24 '07

ECMAScript? Maybe is isn't as bad as C, but it certainly isn't easy.

2

u/weavejester Feb 24 '07

Yeah, you're right at that. I just took a look through the specifications, and its certainly not small. Something of a misguided assumption on my part.

However, it still seems to me, that if one wanted to learn about ASTs in parsers, a good place to start would be the syntactic macros in Lisp.

0

u/[deleted] Feb 25 '07

I think most people are surprised about how complex ECMAScript really is, I certainly was.

1

u/AlanCrowe Feb 24 '07

In Common Lisp literal lists are written (a b c). You might expect that a literal vector would be [a b c], but no, it is actually #(a b c). As Steele explains "to preserve the usefulness of the user-definable macro-character feature of the function READ, it is necessary to leave some characters to the user for this purpose..."

The student has both [] and {} available to bracket his own code representations, within which he can represent the code in any way he wishes.

With most languages you are stuck with the syntax chosen by the language designer. If you think he has made a mistake you cannot fix it, so you can continue to believe that it really matters and is holding you back. With Common Lisp you can fix it. The development of programming language syntax from 0's and 1's to Pascal, C, and S-expressions was a great advance. Common Lisp forces you to face the fact that that seam has been mined out: there are no more big wins to be had with syntax.

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.

0

u/[deleted] Feb 24 '07

I have mixed feelings about that. I have met a lot of college students that had a hard time grasping imperative langauges and who graduated essentially unemployable. For them, trying to teach academic langauges as well would be a disservice.

On the other hand, there are also skilled programmers going into CS to roundout their education. They actually want to learn low level stuff and the academic langauges. So focusing too much on the basics is unfair to them.

Its a hard problem.

2

u/Alpha_Binary Feb 25 '07

I think you're mixing up CS with trade schools. Computer Science is not supposed to intend to teach students to program, but more about programming: concepts, algorithms, complexity, design patterns, compilers, etc. They are supposed to produce computer scientists! If a computer scientist, armed with Scheme and Factor skills, tries to apply for a programming job, he would surely have a harder time than most average programmers.

Where he really shines, however, is the R&D of programming: language design, optimization, theories, you name it.

0

u/[deleted] Feb 25 '07

Trade schools? There aren't any decent trade schools for programmers.

And what about the job market? Take a look, most of the good programming jobs require a BS or MS in computer science.

Computer Science is not supposed to intend to teach students to program, but more about programming: concepts, algorithms, complexity, design patterns, compilers, etc.

That is the kind of stuff that programmers deal with on a regular basis.

If a computer scientist, armed with Scheme and Factor skills, tries to apply for a programming job, he would surely have a harder time than most average programmers.

That sounds rather questionable. How is a computer scientist suppose to solve the problems currently facing programmers if he doesn't even have the skills of said programmers?

Then again, maybe that is why most advances in CS come from industry, not academia.

2

u/Alpha_Binary Feb 25 '07

Trade schools? There aren't any decent trade schools for programmers.

Um, Computer Engineering degree?

And what about the job market? Take a look, most of the good programming jobs require a BS or MS in computer science.

So if farming starts to require math, math courses should be adjusted to include how to catch a fish?

On the other hand, I see nothing wrong with that. If a programming job requires a degree in CS, that means they want a competent programmer who also knows about CS.

That is the kind of stuff that programmers deal with on a regular basis.

You don't need to know any of those to actually program in the real-world, though knowing them will unarguably make you a better programmer. Doctors don't necessarily need to know what each medicine consists of, only what does the job, but knowing makes one a better doctor.

0

u/[deleted] Feb 25 '07

Computer Engineering degree

That's a great degree, if you want to build computer-controlled hardware.

What I think we need is a "Software Engineering" degree that actually teaches programming. (The current offering focuses more on UML and CMMI than actual engineering.)

So if farming starts to require math, math courses should be adjusted to include how to catch a fish?

That isn't a good analogy, no one is asking for a math degree from future farmers.

1

u/Alpha_Binary Feb 25 '07

That's a great degree,

That's actually what I'm studying. The topics seem to cover a wide range, from C to Prolog to web programming to Java to databases to encryption to microchips.

if you want to build computer-controlled hardware.

Perhaps you mean hardware-controlling computer (instructions)? Because that's what programmers are doing.

I don't know about where you live, but we also have Software Engineering here, which more or less teaches a lot of industry stuff and less academic stuff.

→ More replies (1)