4 ms·
Given Python's limited lambda implementation and Guido's distaste for FP I find it odd that Python should be chosen to teach SICP let alone replace Scheme as a
by cutler 11y ago
Given Python's limited lambda implementation and Guido's distaste for FP I find it odd that Python should be chosen to teach SICP let alone replace Scheme as a teaching language.
- pmoriarty 11y agoThere's a lot of pressure to teach languages that are widely used in industry, which is why so many students come out of university knowing mostly Java. There's also a lot of bias against "old" languages, and for newer, trendy languages. Teaching SICP in Python is just a further development of that trend. Software engineering is a very trend-following, path of least resistance, bandwagon-jumping profession. If "everyone" is using language X, that's where most engineers (and managers) want to be. Universities are just satisfying that need. It's a wonder that Scheme lasted in universities as long as it did. It'll be interesting to see how long Python lasts.
- cutler 11y agoThere's always Clojure. Best of both worlds, i.e. Scheme-ish with Java host. We had a SICP Clojure group here in London last year and I think someone has written an adaptation of SICP in Clojure. If it was any other text I'd have nothing to say but SICP without the Scheme/Lisp doesn't make sense. If universities choosing Python or Java as their teaching language they should also switch to texts based on OOP.
- conceit 11y agoWhy doesn't it make sense without any LISP? I read only the first chapters and found the concept of composition immediately applicable in C and as a C programmer I would write the same way in python, probably.
- groovy2shoes 11y agoAh, yes. The perils of which have been demonstrated for over a decade now. http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html http://www.joelonsoftware.com/articles/ThePerilsofJavaSchool...
- dalke 11y ago"newer, trendy languages" Python is 25 years old. Remember, all of those "old" languages, when they became notable or influential, were younger than Python is now. Scheme, when SICP was written, was only 15 years old. It was young and trendy at the time. C was less than 20 years old when I learned is as part of a required course for my CS degree. I've no doubt that part of the reason was that it was widely used in industry. C++ was the trendy thing by the time I left school. It was less than 10 years old. Perl was 10-15 years old when it was used as the "Swiss Army chainsaw" for a lot of the first era of web development. While this appears to solidify your observation that software engineering is very trend-following, I listed them to point out that Python seems to be the oldest language when it made the jump. It's surely older than most of the students and even TAs for the course.
- kedean 11y agoPython has been a common teaching language for at least a decade now, it's just that this particular course has now switched to it as well. Still took 15 years for it to get that momentum, though. You won't see a CS course taught in Go or Rust anytime soon.
- steveklabnik 11y agoThere actually have been a few CS courses taught in Rust. http://rust-class.org/ http://rust-class.org/ was a few years back, but http://cis198-2016s.github.io/ http://cis198-2016s.github.io/ is being taught at Penn and http://homepage.cs.uiowa.edu/~achampion/teaching/plc/lectures.shtml http://homepage.cs.uiowa.edu/~achampion/teaching/plc/lecture... is being taught at the University of Iowa _right now_.
- sillysaurus3 11y agoIt's not really limited. You just have to name your lambda before you use it. def make_adder(n): def f(a): return n + a return f Using this style, you can make the inner function as complicated as you want. You can have statements, or anything else.
- JamilD 11y agoIt's no secret that Guido has a little bit of a distaste for functional paradigms. From the man himself: "About 12 years ago, Python aquired lambda, reduce(), filter() and map(), courtesy of (I believe) a Lisp hacker who missed them and submitted working patches. But, despite of the PR value, I think these features should be cut from Python 3000." http://www.artima.com/weblogs/viewpost.jsp?thread=98196 http://www.artima.com/weblogs/viewpost.jsp?thread=98196
- icebraining 11y agoAre lists comprehensions (the proposed alternative) less "functional" than map/reduce/filter?
- cutler 11y agoLambdas are anonymous functions so an inner def is not the same thing. The fact that you have to "adapt" Python to get non-crippled lambdas suggests it should have been the last choice for teaching a text like SICP.
- sillysaurus3 11y agoThe reason lambdas are powerful -- one of the only reasons -- is because it's a closure. The fact that you can reference variables outside of the function is the power, not whether it has a name. A label is just a convenience. (Or in this case, an inconvenience.) If my understanding is flawed, I'd like it to be corrected, though.
- groovy2shoes 11y ago
- vkjones 11y agoIt is odd indeed. Chapters like http://cs61a.org/lab/lab04/ http://cs61a.org/lab/lab04/ ("linked" lists) would drive me away from both functional programming and Python.