[Python-ideas] Framework for Python for CS101

Nick Coghlan ncoghlan at gmail.com
Tue May 26 06:13:09 CEST 2015


On 26 May 2015 at 13:50, Steven D'Aprano <steve at pearwood.info> wrote:
> If you insist on a pure approach, Python is the wrong language for you.
> Python uses a hybrid paradigm of functional and procedural and OO and
> imperative approaches.

Not only that, but Python *deliberately* makes stateful procedural
code the default, as that's the only style that comes to humans
intuitively enough for it to be the standard way of *giving
instructions to other humans*. It's the way checklists are written,
it's the way cookbooks are written, it's the way work instructions and
procedure manuals are written. If you allow for the use of
illustrations in place of words, it's even the way IKEA and LEGO
assembly instructions are written.

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.

Regards,
Nick.

P.S. 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.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list