Sunday, June 04, 2017

Learning to Code

I'm back to code school teaching Monday morning. This next one is immersive, for adults, but not a boot camp.

In code school lingo, boot camp is about putting in full days at the school, assuming brick and mortar, not virtual. PDX Code Guild hosts those.  These run for several weeks, say twelve to sixteen.

However, many courses of study, from MOOCs (massive open online courses) to community college, are less intensive than boot camp, yet still immersive.

These code school boot camps don't seriously involve boots, unless someone happens to wear them. I suppose there's a pun in there somewhere, regarding self-booting computers, but that'd seem lame.

Teaching a computer language is not unlike teaching a human language, including music.  We sing a music called "ordinary speech" and don't call it singing.  Then we have other forms of singing, notated using musical notation in some cases, not that there's just one such notation.

Likewise computer languages notate what the computer will do, the programmer being less a player (the computer plays itself) than a composer.  To program is to compose.  Sometimes the movies get it wrong and show some hacker typing lines of code at almost superhuman speed.

On the contrary, programming tends to be a halting activity, with frequent breaks to pace, draw on a white board, consult documentation, doodle, sketch.  And right, there are many flavors of programming.

Python, one of these computer languages, has a grammar and vocabulary, like J does, another language I've studied (J is a close relative of APL's).  Python inherits from ABC, with an emphasis on the C (inside joke, in the sense of CPython, not to be confused with Cython, nor Jython).

We grow in our awareness of Python through (0) its keywords and the grammatical structures they form (1) its special names, sometimes known as magic names (2) its core builtins, standard library and 3rd party modules (namespaces).

Namespaces build out the vocabulary, but in your core Python, you get the full grammar, a way of fitting puzzle pieces together.  Then it's just a matter of adding pieces, while continuing to use the same grammar.

Because of this difference between grammar and vocabulary, also real in human languages, it's possible to talk about mastering basic Python in three days of immersive hands on study.  That's not a lie.

People thinking one could never learn to play a musical instrument that quickly are correct: developing those reflexes takes a lot longer.  Music is played against time, at a fixed rate, and that's more like dance.

Programming is slow, with lots of "thinking about" and pausing, so it's the analogy that was maybe misleading.  You don't have to memorize all that much either, to master the grammar.

A vocabulary is like a shop talk.  Think how long it takes to develop familiarity with a tool set, such as for maintaining and repairing bicycles.  The heart surgeon has a tool set.  These are shop talks.  In learning Python, we're not learning to be bicycle mechanics or surgeons.

A computer language may have magic in it somehow, but that doesn't put it outside the natural limitations we're used to among human beings.  Step one in becoming a programmer is maybe setting aside certain stereotypes and misconceptions that only make the prospect seem more daunting than it is.