I find that explanation disturbing. Why not start from a language that teaches the basics of the common programming paradigms, such as OOP (Java) or FP (Scheme)?
I find that explanation disturbing. Why not start from a language that teaches the basics of the common programming paradigms, such as OOP (Java) or FP (Scheme)?
Scheme is elegant and small, and a traditional choice for teaching programming where functions are first-class objects. If you consider Scheme appropriate for FP, my guess is that you’d also consider SmallTalk appropriate for teaching OOP.
If you had to pick one language to teach people who had never programmed before and you wanted to be able to demonstrate the basics of OOP, FP and other styles, then Python would be a good choice.
(Disclaimer: I like Python quite a lot.)
Could you imagine only introducing mutation halfway through the semester of a Python course? That's what my intro CS course did with Scheme, and it was perfectly natural and effective. Scheme also makes it very easy to see mutation as something different from definition--it has both define and set! which do different things. Python doesn't even differentiate between the two because it has a weird scoping model.
Of course, Scheme itself isn't a perfect functional language either. I found that pattern matching is extremely important--Haskell, mostly thanks to pattern matching, helped me internalize recursion much more than Scheme when I was learning the two concurrently.
Scheme is also a good language to teach about OOP because it divorces the OO part from the language itself. When I had learned about it in Java, I had assumed that an object system was inherent in a language. Scheme showed me that a very expressive OO system could be written on top of a language without the language supporting it in syntax.
Finally, it is very easy to adapt Scheme syntax to other paradigms. Could you reasonably write a logic programming language that looked like Python? I honestly don't know. On the other hand, making one like Scheme is trivial. Not only did we use a language like that in the same intro course, but we actually went over how to implement it.
Ultimately, I think Python is too complicated. Not in terms of being difficult to use, but in terms of just being a ton of different features put together. They may look similar, but they are still discrete ideas that do not naturally come from each other. Scheme, on the other hand, has a few core ideas and everything else is built from those. Just compare the grammars of the two languages to see what I mean.
My point was that if you were to teach people new to programming just one language then Python might be a good choice because it supports many paradigms.
I agree there are languages that are much more conducive to learning functional programming than Python.
Because that stuff is boring and it drives away a bunch of people who might really get in to programming if there wasn't a huge gap between "just starting" and "doing anything remotely cool".
I for one would not have become a developer if my first experience with programming was a typical "CS101: Let's spend 3 months learning about loops" class, which unfortunately is many students first introduction. This class alone probably drives away half of the people who were interested in programming enough to take the class in the first place, which I find disturbing.
I spent a bunch of my free time as a kid making (really bad) web pages, (really bad) Javascript, and (really bad) PHP. Did I understand OOP, or how/why it's different than FP? Heck no. It wasn't until years later that I even took a programming course. But by the time I was ready to learn solid programming fundamentals, I'd already been bitten by the programming bug.
If I had to guess, I'd say this class is more about getting people interested in programming than it is intended to teach everything you Should Know. IMO, that's what a beginner course on any heavy material should be anyway.
The beauty of scheme is that it's turtles all the way down. If you want to see how something works, it's easier to explore.
I just don't have time to twiddle with document object (DOM API) just to see results.
Some people don't have time either to deal with scoping or the right way to do prototype in JS.
We all should use QBasic...
I think using something like d3.js or processing.js would be a good place to start: http://mbostock.github.com/d3/tutorial/circle.html
That's a FUN tutorial that could easily dovetail into a larger project.