3 ms·
I can't help thinking that almost everything he lists applies more to Scheme than Python. Scheme also has the advantage of being much simpler, smaller, more con
by tikhonj 15y ago
I can't help thinking that almost everything he lists applies more to Scheme than Python. Scheme also has the advantage of being much simpler, smaller, more concise, more flexible and more elegant than Python. It actually does functional programming well rather than half-heartedly, and is rather nice for OOP as well.
Additionally, Scheme has one very important property that Python lacks--there is almost no magic. Even definitions and assignments (define and set! respectively) look like normal function calls. It also makes it clear that very little is fundamental to a language--with Java and Python things like classes and control structures are special and built into the language; with Scheme they do not differ superficially from normal functions. With Java I thought classes and objects were somehow the only way to do it; Scheme clearly showed me that they do not even have to be part of the core language.
Now, Scheme does have some complicated ideas like macros and continuations, but there is no reason to teach those to beginners--it's an eminently useful language as is, and extremely simple. The very first CS course I took in college used Scheme; we spent something like just two lectures on the language itself. Now that the professor retired they've changed the course over to Python; I think they're still learning the language half-way through the semester.
Scheme is also great because, being very simple, it is much easier to implement than Python. And once you have a basic Scheme implementation, you can modify it to see other potential languages. For example, in our intro CS course, we talked about writing a memoizing interpreter and even a lazy interpreter. It's hard to imagine a lazy Python! We even reused Scheme syntax (but not really semantics) to cover logic programming à la Prolog.
That course was one of the most enlightening semesters I have ever spent. I really think that Scheme is the perfect introductory didactic language.
- Derbasti 15y agoIt makes sense to use a language that is close to what people will be using later just so they will be able to transfer their learned knowledge more easily. Lisps are very interesting and important, but their syntax does not transfer easily to most popular languages.
- driax 15y agoI never really accepted the argument that Scheme/Lisp is simpler than a language like Python, simply because everything in the language is reduced to constants/terminals (what's the right terminology here?) and functions. Many language differantiate between statement and expression, and compile-time and runtime and lots of other stuff. Saying that we can express C-structs in a language by reducing them to functions is not a simplification, instead I would argue it's worse when trying to grok C. While coming from Python it would be easier since we already have classes, and C-structs are simply compile-time final classes without inheritance. I agree though that learning Scheme can teach a lot, just not necessarily how to grok every other language well.