Saturday, November 21, 2020

Pythonic Polemics


I've been circling the block, pounding the pavement, knocking on doors, none of that literally, to advance the just cause of (drum roll)... lets just call it: sharing the Pythonic ecosystem.  Yes, "python" sounds like a scary snake, eating up the everglades in Florida.  Monty Python is funnier, but is also esoteric.  But then geeks enjoy esoterica... 

I'm talking about Python the computer language, invented by a Dutchman named Guido, with a lot of help from his friends.  It's a gateway language, a grand central.  Get oriented in Python, then use it as your bridge to something else.  Take advantage of those added smarts.  Python fits your brain.

"Pythonic" means pithy, to the point, according to the principle of least action, optimized.  It doesn't mean densely clever or tricky, what the Djangonauts call "being an astronaut". 

When you code in Python, you're ideally not showing off so much as upholding standards.  You're aiming for readability, almost personability. Pythonic code is reader-friendly.

On Quora, I answer a lot of questions about Python, though I'm starting to branch out more.  Answering questions about Python helps me improve my writing and teaching ability, or to at least stay in shape.

This ecosystem includes more than just the one tool however.  We have that whole Anaconda business, with the flagship Jupyter, both Notebooks and Labs. 

I saw another thing calling itself Pluto out there.  Imitation = sincerest form of flattery. That's what they say.  We're not talking about planets here, but types of interactive "notebook". Know what I mean?

I'm the guy thinking it's a travesty to offer something called "high school", which is supposed to get to the median hard core of whatever the current culture has to offer.  Yes, that includes skills like:

supplying the cooks
cooking for groups
playing sports
reading maps
making jewelry, other adornments, clothing
studying infrastructure (both global and local)
tilling the fields, planting
caring for animals
personal and public health... 

... and then, as usual, academics: PATH + STEM.  

Jupyter stuff would usually go under STEM but could just as much be Literature (silently between A and T, anthropology and theater) or natural language processing (NLP).

As a futurist, I work to keep pace with the Zeitgeist, not hang back and pretend like I still live in the past. 

Not having a command line, a shell, a place to store files, electronically, in the cloud and/or locally, is so forty years ago by now.  

I remember my gig with the police in Hillsboro, Oregon, who were pissed.  Why inspire fear among the youth, around the criminality of copying (piracy) -- Napster was new -- when the copyleft cultures exist?  

You don't need to pirate Windows when you can legally copy Debian, and distribute it to all your friends. This liberated media culture had legally free music tracks, as well as free executable programs.

These police, led by a second generation Chinese police chief, resolved to teach about that Copyleft World themselves, at the police station, if the schools were too cowardly to do so. I'd hazard most were more lazy than cowardly. 

The police hired a Linux + Python teaching duo, Jerritt Collard and myself.  Officer Heuston (since retired) was our man on the inside.

So yeah, if you went through high school in the last five to ten years, or make that twenty to thirty, and had no exposure to Python, or Jupyter Notebooks, then you live well below the poverty line in my book.  You've been oppressed.  

I'm not saying to therefore act like a victim.  

I'm saying it's your work to fight back.

The Zen of Python, by Tim Peters

Beautiful is better than ugly.

Explicit is better than implicit.

Simple is better than complex.

Complex is better than complicated.

Flat is better than nested.

Sparse is better than dense.

Readability counts.

Special cases aren't special enough to break the rules.

Although practicality beats purity.

Errors should never pass silently.

Unless explicitly silenced.

In the face of ambiguity, refuse the temptation to guess.

There should be one-- and preferably only one --obvious way to do it.

Although that way may not be obvious at first unless you're Dutch.

Now is better than never.

Although never is often better than *right* now.

If the implementation is hard to explain, it's a bad idea.

If the implementation is easy to explain, it may be a good idea.

Namespaces are one honking great idea -- let's do more of those!