I haven’t written anything public that is substantive (unless you count tweets
as substantive) for nearly 2 years. How remiss of me. Work and life have got in
the way of random public writings.
I have had some time off and been in need of a distraction, so wanting to
simplify this blog (technically) from the already quite simple drupal
installation I had previously, I decided to throw myself at the learning cliff
of both python and Yaki.
Well it turns out that Python is pretty cool, even if it does do a few things in
a … different … way. I know, Peter Bengtsson was trying to get me on to the
Python band wagon five years ago, but sadly I was too far up Oracle creek to
care back then. Still, not everything is totally cool in the land of
constricting snakes, for example to join a list of strings together first
consider the string that you want to be the glue (e.g.
', ') and then use that
to join an iterable (so it can be applied to any set, and anything capable of
generating a set) —
mylongstring = ', '.join(stringList) — so not crazy, but
The one that has really caught me out though is the no closing brace thing, just
use indents to mark loops and conditionals. It is all well and neat, quite terse
even, but start editing someone else’s code when you have different ideas of
tabs vs spaces vs tab widths and you can all too quickly end up in a world of
pain that just feels, well, avoidable. I have just written myself a comment
block for future python with something very similar to the following in it:
# "Quick Description of Script."
# vim: et, ts=4, sw=4
# NO TABS, four spaces per tab.
# (if you are using vim this will be set by the modeline above)
So having just about got to grips with Yaki and on the verge of diving in to the
templating system (cutely named ‘snakelets’), I thought I would email Rui Carmo
(who wrote much of it) to ask about a snakelet syntax file for vim. I’m glad to
say he got back to me (and remarkably quickly too), not with a syntax file, but
to say that he is working on the next generation of yaki and that
those baby snakes have gone the way of the dodo. Of course that is both exciting
and irksome, since this time it is based on more up to date technologies like
fever (I haven’t checked yet, but I’m guessing it is his bottled version)
and decorators — more to learn in all the spare time I don’t have. Time to
climb further down the big snake’s neck. I’ll endeavour to keep folks up to date
with what I find down there.