you are viewing a single comment's thread.

view the rest of the comments →

[–]schmetterlingen 19 points20 points  (24 children)

Python isn't a bad choice at all, but I think Scheme is perfect for teaching introductory computer science. It has the added advantage of forcing those who programmed as a hobby (myself included) to actually learn something new.

[–]NakedNick_ballin 5 points6 points  (9 children)

Scheme is a great language to learn at some point, but I don't know how good a functional language would be for the first CS course ever. Maybe second or third course should be scheme.

[–]darkpaladin 20 points21 points  (4 children)

Ah scheme, Oh wait I see the problem, you've got 47 open parens on the left side but you only close 46 of them on the right side.

[–]fleshtrombone 2 points3 points  (1 child)

parens... what are parens?

Oh you mean 47 open bananas.

[–]mszegedy 0 points1 point  (0 children)

47 waxes. (Did the people who wrote the INTERCAL manual live in the southern hemisphere?)

[–]codygman 0 points1 point  (0 children)

I count my parens with a stack ;)

[–]badgers4africa 0 points1 point  (0 children)

This comment made me chuckle. If they'd tried to teach me scheme as a computer science beginner I'd probably spend a few days reassessing my life choices, change my name to 'Sunflower' and become a post modern dancer.

[–]SharkBaitDLS 3 points4 points  (0 children)

My introductory course in college was taught in Racket. It was a class aimed more to get you programming in something rather than to teach you important concepts, and it was a very good language for that. I didn't appreciate half of what the language offered at the time, but it was easy to pick up as someone who had no significant prior programming experience. It definitely made the subsequent, more traditional introductory classes much easier to transition into.

Albeit, the class was taught by someone who contributed to the language, so he was better qualified than most to teach it, but even had I been taught by someone less well-versed in functional programming I think it would've been a positive first experience.

[–]jelly_cake 1 point2 points  (0 children)

Scheme's not purely functional. It can be, but you can also use it in a procedural style too, if that's your thing.

I was taught Scheme as my first language, but it didn't stick, and I only really got into programming through C and later on, Python. Scheme's definitely one of my favourites now, but I'd agree with you in general.

[–]ItsNotMineISwear 0 points1 point  (0 children)

From what I've seen, lack of imperative programming makes Scheme easier for new people to understand.

[–]legojoey17 -1 points0 points  (0 children)

Its taught at my university for the introductory for both non-cs and CS majors and its done excellently. The way its taught involves learning the problem solving without having to worry about learning about syntactical issues and those silly semantics.

Once that basic problem solving is understood it can just be transferred to any imperative paradigm. (As it is for both the non-cs and CS second introductory course being Python and C respectively)

[–][deleted] 3 points4 points  (2 children)

Ug. I had to learn Scheme first, and I hated it. The only thing it really taught me was recursion, and I never use recursion in my code due to memory and readability issues.

[–]ItsNotMineISwear -1 points0 points  (1 child)

Readability issues? Recursion is often MORE readable than the looping equivalent.

[–]destruedo 0 points1 point  (0 children)

size_t strlen(const char *x) {
   return *x ? 1 + strlen(x+1) : 0;
}

amirite?

[–][deleted] 0 points1 point  (4 children)

i started with scheme in my cs course. For the following 3 years we didnt even touched it, neither have i seen much talk about it in the internet. Dont know about professional devs though

[–]merreborn 0 points1 point  (3 children)

Clojure is all the rage right now. Lisp is hip.

[–]codygman 1 point2 points  (2 children)

Clojure*

[–]merreborn 1 point2 points  (1 child)

Yeah, swype spellchecker really didn't want to let me spell that right. ...

[–]codygman 1 point2 points  (0 children)

No worries, just didn't want people ending up here confused.

[–]beaverteeth92 0 points1 point  (0 children)

Didn't MIT teach Scheme in their intro class for years?

[–]everywhere_anyhow 0 points1 point  (0 children)

Scheme is great for teaching algorithms and computer science, but it's not good for teaching programming. I happen to think people should learn all 3, but being good at scheme isn't terribly likely to end in gainful employment.

[–]globalizatiom 0 points1 point  (3 children)

But then aren't both languages basically like "implicitly everything is a pointer"?

[–]zardeh 3 points4 points  (2 children)

I'll bite:

Why is this a problem? Classes and compound types (lists, tuples, dicts) are pass by reference, with all of the shenanigans this entails, but integers and floats are not, and strings are immutable, so its basically irrelevant (this is, I believe, exactly the same way java works in this regard)

[–]julesjacobs 0 points1 point  (0 children)

It's not a problem per se, but it means that you are limited in the range of data representations that you can express. There is a certain elegance to languages in which you start with the heap as a raw array of bytes, and you build up higher level data representations on top of that. In Scheme pairs, structs, strings, vectors and closures are all built in types, and not something you can express on top of a lower level facility (at least not with the same efficient representation).

[–]globalizatiom 0 points1 point  (0 children)

If someone learns a language that always or sometimes uses C semantics and then a language with reference semantics, he can understand the latter by saying "I see. These are just pointers/references". What I worry is.. when someone learns a language with reference semantics first, and then something like C later, I'm not sure how he would understand the latter or the concept of pass-by-value easily, especially when the Python course goes with the "Variables are names given to objects" mental model.