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. :)

8
  • 150
    Congratulations, it sounds (to me) like you may be going to one of the few schools left that actually tries to teach computer science. Learning Scheme as a first language is (IMO) a very good thing. No, it's not as commercial as many others, but it's an excellent language for learning the real essence of computer science. Oct 20, 2011 at 3:32
  • 22
    C, C++ and Java are industry byproducts of computer science. Scheme's entire roots are in computer science. The languages in commercial use have as much to do with computer science as McDonalds has to do with cuisine.
    – JasonTrue
    Oct 20, 2011 at 5:30
  • 36
    These guys are correct; you are confusing computer programming with computer science -- as Dijkstra said, that's like confusing telescope construction with astronomy. Scheme is about the best language there is for learning basic concepts in computer science. If you're expecting that taking a computer science degree is about learning how to write line-of-business apps in Java, you might be enrolled in the wrong program. Oct 20, 2011 at 7:40
  • 31
    For the same reason that zoology courses teach evolutionary biology, anatomy and animal behaviour rather than how to muck out an elephant stall
    – jk.
    Oct 20, 2011 at 7:58
  • 5
    Once you have your feet under you with understanding the basis syntax of Scheme, try reading "The Little Schemer". It is a thin book, but if you can understand everything in it you'll have a really solid grasp on the fundamentals of functional programming languages. Oct 20, 2011 at 15:58

11 Answers 11

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.

11
  • 7
    "Force" is probably not a good word to use. How about "train"? Oct 20, 2011 at 4:04
  • 5
    Actually, there have been sweeping changes in MIT's EECS curriculum over the past couple of years. Their intro course is split over two courses now (see mit.edu/6.01/mercurial/fall11/www/index.html for the first half), and the majority of the language instruction is in Python.
    – jonsca
    Oct 20, 2011 at 4:29
  • 5
    I agree that Scheme is a great language and it's a good idea to learn it. However, let's face it; almost every real-world programming job employs an imperative language; most really serious programming jobs require C++, and C++ programmers usually actively discourage you from using all the nice mathematically-based ideas for program design for one reason or another. Recursion won't play a large role in your imperative programs. Oct 20, 2011 at 10:05
  • 4
    @FelixDombek, are you sure? All ideas? Really? An imperative loop is a mathematicall idea too, mind you.
    – SK-logic
    Oct 20, 2011 at 11:41
  • 3
    @FelixDombek, I can only see a reason to use iteration instead of a tail recursion in C++. All the other forms of recursion are served exactly the same way as in functional languages implementations. So I can't agree with your remark at all. The more math you put into your C++ coding, the better. I doubt you're going to try implementing, say, red-black trees in C++ without recursion.
    – SK-logic
    Oct 20, 2011 at 14:59
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.

3
  • 2
    Sorry, to necro-comment, but why emacs? I'm curious. I'm in the same boat as OP was (starting college freshman this fall) and we're going to use Racket (similar to Scheme). Jul 1, 2015 at 1:15
  • 3
    @KevinJohnson emacs is frequently referred as an operating system written in LISP that accidentally helps lots of people edit code. If you do functional paradigms and (are taught to) like the obscenities of LISP-like syntaxes, it will likely grow on you as your preferred text editor.
    – ZJR
    Jul 1, 2015 at 17:19
  • 2
    "teach you the science, from which you derive the craft": +1
    – Giorgio
    Oct 4, 2016 at 19:22
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.

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.

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.

2
  • 1
    Scheme doesn't have to be used functionally, although it's more likely that you will do so than in C, C++ and Java. Mar 9, 2012 at 12:50
  • "It's similar to schools that teach Latin in order to study English literature.": Or to operating systems classes that teach a Unix-like OS instead of other, more wide-spread OSs.
    – Giorgio
    Feb 20, 2017 at 6:34
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.

3
  • 4
    "The everyday languages used in most businesses might be well suited for producing the software needed today" -- Considering the typical cost, quality, and success rates, that's a rather optimistic statement :-) Oct 20, 2011 at 10:58
  • That's definitely true! That's why I wrote "might" instead of "are" :-) Oct 20, 2011 at 11:26
  • 1
    "Once you have grasped the concepts, it's easy to apply them to other languages." - This statement is all too true. I suspect it would take me about a week to pick up the syntax in just about any new language, and be proficient. I was taught C/C++ and Assembly in school, but I taught myself Python on the side and Lisp for a research project. Without the fundamental understanding I gained from Python, Lisp, and Assembly, I doubt I would be nearly the programmer I am today. Oct 20, 2011 at 18:55
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

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.

1
  • 4
    I agree; I started CS knowing Pascal, C, Basic, x86 Assembler, while others had experiences in different languages or none at all. We were introduced to ML which not only no one had any prior experience with but which had a paradigm so foreign that it was like starting over even for the most experienced among us. Later, I think ML (the functional paradigm) is the most useful thing I learned at CS. Oct 20, 2011 at 7:39
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.

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.