When I was a kid, I liked writing BASIC on the TRS-80 at school so much that we eventually got a C64 in the house. After that I took CS classes in colleges for fun (that is, “a minor”) and instead of going into the writing business as planned I went into the computer biz.
Twenty years in consumer electronics and a Master in Design later, I still like learning languages and new ways of thinking about computing. Last month I read the Erlang book out of curiosity and last year I started playing with machine learning using Mallet.
Through all manner of trickery I managed to avoid Python. Fixed column formatting like COBOL and Fortran? A mixture of English and symbols for logic? Typeless unless it’s not? An object-oriented scripting language that doesn’t have a two pass compiler so there’s no way to do forward references? Screw you, buddy, I’ll stick to PERL!
Then along comes Rhino 5.0 (an excellent package even in alpha) and their decision to replace Visual Basic (hack, spit) with Python so your scripts will run on both OSX and Windows installations.
Crap. I have to learn Python.
I made the mistake of starting with the Rhino tutorial, which is more of a tutorial on Rhino than a tutorial on Python. I asked my “pythoneer” friends what to read and pointed out some of my goals and favorite ways to learn. I also I had a few planes to ride, so I tried the electronic version of “Learn Python the Hard Way“. It’s an excellent book for someone who has never written a program but can be a bit of a tedious read if you’re fluent in C++ or Java and try to do all the exercises. (I did none of them. :-)
So by “too late”, I mean long after everyone else has learned it, and long after they’ve worked through all the dev problems related to moving a language up to 3.x over the space of 20 years. I’m making notes as I learn and asking some of the obligatory “why is this so stupid?” questions that come from people who either expect better or are just used to the ANSI problems in C++. (Trigraphs. Fucking trigraphs.)
I’ve written a few scripts in the past week and it feels very much like when I learned Lisp after learning C, “Interesting language, but what would I do with it?” Looking at tasks I’ll do in Rhino I think Python makes a lot of sense as the scripting language.
One place where I think it leads other languages is the class-based operations on lists and hashtables of objects. In the 3D world, your model is often nothing more than a list of (probably complex) objects, being able to write scripts that process these lists is a basic requirement.
One of my next 3D projects is to generate a model using code, and instead of OpenSCAD I can just rack a Python script and have it generate the model for me. Rather than send you the model, I can just send you the script and you can tweak it as needed then generate your model. If I decide it needs to be %5 larger to account for shrinkage, just tweak a variable in the script and run it again.
I guess reading about Erlang really was just for fun, I don’t think I’ll use it to write any model generators or filters any time soon.