83

I hear about C, C++, Java every day whenever people starting talking about computer science, but in my first computer science class we are asked to write in Scheme (DrRacket).

Why is that?

What differences will this make to my future understanding of programming?

UPDATE: I have finished my first term, but not completely done with Scheme. In my second term (which is now) we got in to C programming. It was frustrated to learn pointers at first, but now I feel much better.

There's not much more to say than that. I'm trying to teach myself Java (or C++?) for the OOP part which I'm missing. So far, I still like functional programming best. Lambda is just fascinating. :)

Erica Xu
  • 1,131

11 Answers11

93

Sounds like a great school! Lisp dialects follow the mathematical paradigm of algorithms much more closely. They force programmers to learn recursion and the functional style. This is excellent experience. Your school is in the ranks with MIT, which still uses Abelson and Sussman for the required CS 6.001.

You might find this article encouraging and helpful in understanding the issue.

40

Congratulations, you're now being turned into the equivalent of a vegan in the computer world, and in two years you won't be able to end up any discussion without informing people about the higher moral ground you stand up onto. ;)

Anyway you landed a very good school. Schools that are not industry-whipped are good.
As someone else said, they teach you the science, from which you derive the craft.

Many bad code-monkey-farms teach you the craft, and then you may happen to infer the science from it, but it's not guaranteed. (and you may end with pretty weird misconceptions about it)

Anyway, as an honored member of the functional crowd, when you get out of there, you'll always feel misunderstood and under-appreciated.

Which, let's admit it, for the average computer wiz is nothing new.

You're in now for an high risk of:

  • trying to wrap up in an academic career,
  • embark in the pursuit of a PHD,
  • ...emacs.

You will also probably like open source, but you will never find enough collaborators for your functional projects.

ZJR
  • 6,361
38

No one expects that as a freshman you'll be proficient enough in any language to get a real job, so why not start with one that's easy to learn? Expecting novices to learn programming by using a professional language in a professional IDE is kind of like giving a scalpel to a first-year med student and having them work on live bodies.

Don't worry; you'll eventually learn Java/C/C++, probably starting your second year. If you started learning Java 6 now, by the time you graduate Java 8 will be out. Or it will have been replaced by Python. Or some other language that hasn't been invented yet but takes the industry by storm. Better to put off learning the "popular" stuff as long as possible so it's not obsolete when you get out in the workforce.

Scheme/Racket will help you focus on the important concepts: algorithm design, data structures, and information manipulation. You know, the stuff that's common to all languages.

Barry Brown
  • 4,095
23

What differences will this make to my future understanding of programming?

That's a little like asking how reading Shakespeare will help you write term papers. Programming (in any language) is just a means for expressing your ideas in executable form. Computer science provides the conceptual building blocks that will give you something interesting to say. Scheme syntax is relatively simple, so you can get to interesting ideas quickly and without running into a lot of compiler errors, standard libraries, etc.

Pay close attention in class -- you're going to learn a lot of interesting stuff this semester.

Caleb
  • 39,298
15

It seems like you are very new to programming having no prior experience in it at all. So here are some clarifications:

Why Scheme and not C/C++/Java...?

When learning a programming language (an analogy could be made with the English language) you learn the syntax you need to follow so that your code is gramatically correct. However a language won't teach you the logic behind solving problems. In order to learn that logic, you learn different programming paradigms.

Each language can implement (more or less accurately) one or more paradigms. A paradigm is a way to structure your logic, and the paradigm implemented by Scheme is called Functional Programming(FP).

So the real question you're asking is: Why FP?

As you mentionned, C, C++ and Java (who don't implement FP) are far more popular. As a matter of facts, (and for various reasons, everyone have their opinion) FP is not very popular in the industry.

On the other hand, FP is very highly regarded in academic circles. It is closer to the common mathematical approach, focuses more on provability and optimization of algorithms, and most people will agree that it would make you a better programmer in general.

It's similar to schools that teach Latin in order to study English litterature.

rahmu
  • 1,016
11

You're supposed to learn how programming is being done and what the basic concepts are. The everyday languages used in most businesses might be well suited for producing the software needed today, but aren't necessarily best suited for teaching you the basiscs of programming.

Once you have grasped the concepts, it's easy to apply them to other languages.

perdian
  • 2,106
9

If you're learning with DrRacket, I'll bet you're also using the How to Design Programs curriculum.

Here's what one of the (admittedly biased) authors of HtDP has to say about the how teaching Scheme has prepared undergraduates at Northeastern University for the cooperative education program ("co-op": students alternate semesters of academic study with semesters of full-time employment).

Prior to my arrival, Northeastern had been using a standard curriculum for two decades: three terms of the currently fashionable language (Pascal, C++, Java), using a set of extremely graphics-rich exercises intertwined with lessons on practical applications. The curriculum was widely published in SIGCSE and related communities, but it didn’t work. At the height of the web bubble, only around one third of the students got programming co-ops; most others ended up as “techies” as they called themselves: moving computers, running scripts, setting up routers and networks, etc. And all of this education cost $150,000 tuition.

After a year at Northeastern, our dean asked me to take over the first course. The first instance was a success—contrary to predictions from some local faculty. Even though it had been considered a trial, we switched to the TeachScheme! curriculum permanently; the dean suggested that I design a bridge course to connect the HtDP course to the rest of the curriculum; this started my collaboration on HtDC with Viera Proulx. See the postscript below. Within a couple of years, I started hearing from our co-op faculty that the share of programming positions was going up. By 2007—the last time I was involved with the course—I was told that the ratio of programming on the first co-op went up to two thirds and higher. In the meantime, all TeachScheme! courses have been taught by numerous faculty members with rather different teaching styles and personalities than my own. The ratio of programming co-op has risen to three quarters and more, and all the downstream faculty are happy about the students’ programming skills.

Edit: for those very interested in the rational behind the curriculum, here's the main architect's explanation - http://www.youtube.com/watch?v=m3be1PHW5X0

pidge
  • 191
  • 3
6

My school started with Scheme also. One reason that was mentioned was this helped leveled the playing field. Most 1st yr Comp Sci might have some, or a lot, of exposure to more common languages. It was less likely that anyone person had a lot of knowledge of Scheme.

6

Actually, as Lisp (Scheme being a dialect) is the Grande Dame of functional languages (think of F#, Groovy, Clojure, Haskell etc), then this training does not leave you at any sort of commercial disadvantage either, as this is the hottest topic on the development block right now.

4

Scheme will help you get good and think in the proper way to use functional programming languages. Scala for example is a Functional/OO hybrid that is quite brilliant, although a bit dense. Languages like this though mark the future - hopefully.

Lisp-like languages though have a purity and simplicity to their design that make them a bit easier for teaching. The nice benefit though is that you'll have a much easier time learning something like Scala afterward.

egervari
  • 387
3

We completed Scheme in the first and first-half of the second semester. It was not until we actually got down to working with C that I began to realize the power of Scheme.

As to your question, why Scheme is chosen: the answer is that it is one of the simplest languages out there and it allows you to do alot (especially when we start playing with lazy lists later on). Moreover :

  1. For people who have no programming experience, it is easier to learn. There aren't many technical details and just a few special forms.
  2. It allows for higher level abstraction. A good course can focus on teaching programmers how to think instead of focusing on the technical details which allows students to become better programmers.
  3. The lists are amazing. There is so much that you can do with them. Car and cdr prove to be powerful tools and it is only when you start working with pointers that you realize that Scheme was amazing at handling lists.
BЈовић
  • 14,049
Avian78
  • 43