On Sun, Jul 1, 2018 at 5:28 PM Steven D'Aprano
On Sun, Jul 01, 2018 at 08:35:08AM -0700, Michael Selik wrote:
On Sun, Jul 1, 2018 at 12:39 AM Tim Peters
wrote: So, ya, when someone claims [assignment expressions will] make Python significantly harder to teach, I'm skeptical of that claim.
I don't believe anyone is making that claim. My worry is that assignment expressions will add about 15 to 20 minutes to my class and a slight discomfort.
How do people who teach other languages deal with this?
Python may be in a unique situation in the history of programming. It wouldn't surprise me if more people learned Python last year than any other programming language.
Assignment expressions are hardly a new-fangled innovation of Python's. They're used in Java, Javascript, Ruby, Julia, R, PHP and of course pretty much the entire C family (C, C++, C# at least). What do teachers of those languages do?
Assignment expressions are not the issue. The real question is: How do open-source projects balance the addition of new features against the growth of complexity? It's the same as that "Remember the Vasa" thread. [...] R [has] *four* different ways of doing assignment.
I think that's a good explanation of why I teach Python and not R. The first time someone asked me to teach a data science course, Python wasn't the clear winner. In fact, R may have been more popular among statisticians. I picked Python for the same reason it's more popular in the industry -- it's the easiest* to use. * Easiest that gets the job done well.
As Mark and Chris said (quoting Mark below), this is just one straw in the
struggle against piling too many things on the haystack. Unlike some changes to the language, this change of such general use that it won't be an optional topic. Once widely used, it ain't optional.
Without knowing the details of your course, and who they are aimed at, we cannot possibly judge this comment.
I disagree. I think the sentiment holds for a great variety of courses and audiences.
Decorators are widely used, but surely you don't teach them in a one day introductory class aimed at beginners?
Most of the time, no. Once, yes, because that's what the team needed. I was pretty proud of myself for handling that one. Because I had to teach decorators early, many other important topics were excluded. Here is the syllabus for a ten week course:
https://canvas.uw.edu/courses/1026775/pages/python-100-course-syllabus
Note that decorators and even regular expressions don't get touched until week ten. If you can't fit assignment expressions in a ten week course, you're doing something wrong. If you can't fit them in a two hour beginners course, there is so much more that you aren't covering that nobody will notice the lack.
It's not about any one particular topic, but the trade-offs between topics. A 10-week lecture course might be 30 hours of lecture, comparable to a 4-day "bootcamp" style course. I assure you that 4 days doesn't feel long enough when those last few hours are winding down. There's always more to say.