My article is finally online

Introduction to Python Decorators is available for you to read after you fill out the annoying registration form.

I have a few ideas for the next article. Do any of these seem interesting?

  1. Demystify metaclasses: use metaclasses to add camel-cased aliases for underscored method names, show how to automatically make methods into properties, and build a crude ORM.
  2. Explore logging with python, ranging from writing out to local files to setting up a syslog-ng server. Show how to use logging config files and filters.
  3. Build a prototype inheritance system into python. I got really interested in prototype inheritance when I studied lua. Prototypes make it really easy to change class-based behaviors at run time.

Finally, the meaning behind the pirates-vs-ninjas debate became clear to me during a recent nitrous-oxide haze (no, not how you think; I was getting my teeth cleaned at the dentist). Anyhow, pirates and ninjas are symbols.

The ninja is a metaphor for the corporate employee. A ninja will get the job done or die trying. A ninja will kill everyone in his own family if he’s ordered to. A ninja has no sense of entitlement or dignity or flex time.

Meanwhile, the pirate is the entrepeneur, or maybe the upper-level executive. He has no sense of duty or honor. He seeks adventure and glory only. He’ll jump ship as soon as possible. He might even maroon his crew-mates on a desert island if it means he gets the treasure to himself.

Pirates love to hire ninjas because a ninja never disobeys. Ninjas love to kill pirates because they can pretend they’re killing their own pirate boss.

6 thoughts on “My article is finally online

  1. I’d like to see what you could come up with on logging. In the sysadmin world, we usually log everything to syslog, but I’d like to see if you can come up with some fancy alternatives. It’d be helpful for me with some of our code so I can generate custom stuffs for Splunk to munch on via our configuration management system.

    Also, love the Ninja/Pirate analogies. I’d have to disagree with the Pirate jumping ship part. I’ve bore whiteness to enough pirates going down with their ship to know that most of them will stick it out to the death; they’re quite chivalrous that way. I’d also like to add that ninjas, have no problem killing their pirate boss, if it means it will get them closer to their ultimate goal.

  2. Good stuff. If you do option A I’d be happy to help even if just as a proofer. I like decorators and metaclasses more than most – I implemented class decorators for 2.3, 2.4, 2.5 and they were finally added in 2.6 and 3k. I prepared a lightning talk for PyCon but didn’t get to do it because the slots filled up really, really early in the AM. The slides are here) but don’t do it justice as most of the content was to be spoken. The gist of it is that class decorators are a gateway to demystifying metaclasses because decorators are radically more simple.

    Drop me an email if you want to collaborate or just want a pedant to review the article.

  3. Ben, I think you’re right about pirates having a gallant streak, so my theory needs some modifications.

    As for logging, I think logging to syslog is great, especially when you can accumulate results from lots of remote boxes. Makes debugging prod issues much easier.

Comments are closed.