[Python-ideas] Framework for Python for CS101
Rustom Mody
rustompmody at gmail.com
Tue May 26 07:36:47 CEST 2015
On Tuesday, May 26, 2015 at 9:50:09 AM UTC+5:30, Nick Coghlan wrote:
> Gary Bernhardt coined a nice phrase for the functional
> programming focused variant of this: Imperative Shell, Functional
> Core. The notion works similarly well for an object-oriented core. The
> key though is that you can't skip over teaching the side effect laden
> procedural layer, or you're going to inadvertently persuade vast
> swathes of people that they can't program at all, when there's
> actually a lot of software development tasks that are well within
> their reach.
>
Why does the question arise of not teaching side-effects/procedural
programming?
Its only (if at all) a question of sequencing not of 'not teaching'. In
fact that is why Python is
preferable to say haskell.
Take the example of arithmetic and algebra.
Lets say we agree that both need to be taught/learnt.
Can that be done simultaneously?
>From my pov:
arithmetic ↔ functional
algebra ↔ imperative
You want to see it the other way? That's ok and one can make a case for
that viewpoint also.
You want to say that algebra is more basic than arithmetic? Thats also ok
[I guess many professional mathematicians would tend to that view: a group
is more basic than a ring is more basic than a field. School arithmetic is
one very specific and not too interesting field]
The viewpoint that will not stand up to scrutiny is to say that
arithmetic/algebra are the same and can be approached simultaneously.
Easiest seen in the most simple and basic building block of imperative
programming: the assignment statement. When you have:
x = y+1
One understands the "y+1" functionally
Whereas we understand the x = <rhs> imperatively
If you think the separation of these two worlds is unnecessary then you
have the mess of C's 'expressions' like ++
And you will have students puzzling over the wonders of nature like i = i++
whereas the most useful answer would be "Syntax Error"
> More advanced conceptual modelling techniques like functional
> programming and object-oriented programming are then *optional*
> aspects of the language to help people cope with the fact that
> imperative programming doesn't scale very well when it comes to
> handling more complex problems.
Thats certainly true historically.
However as I tried to say above I dont believe its true logically.
And pedagogically the case remains very much open.
ACM's most recent curriculum¹ juxtaposes FP and OOP (pg 157, 158) and says
that 3 hours FP + 4 hours OOP is an absolute basic requirement for a CS
major. I regard this as an epochal shift in our pcerception of what
programming is about. The fact that this has happened 50 years after Lisp
should indicate the actual speed with which our field adapts. Dijkstra
said that it takes 100 years for an idea to go from inception to general
acceptance. Think of when Cantor invented set theory and when modern math
entered primary schools. Other inversions of historical | logical |
pedagogical order here.²
And finally all this is rather OT. I am talking of a framework for a
teacher to chart a course through python, not any changes per se to python
itself.
A teacher wanting to chart a different course through python should be free
(and encouraged) to do that as well.
¹ https://www.acm.org/education/CS2013-final-report.pdf
² http://blog.languager.org/2011/02/cs-education-is-fat-and-weak-1.html and
sequel http://blog.languager.org/2011/02/cs-education-is-fat-and-weak-2.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150525/ad59a6cc/attachment-0001.html>
More information about the Python-ideas
mailing list