Categories
Computers

Quick Thoughts on Python

I’m writing the blog client in python. I had spent some time learning Perl a while back and I liked it. Unfortunately, I didn’t have anything to keep me working at it and I forgot a lot of the syntax. For Perl, in particular, that’s a killer. Some of the code that I go back and look at is real difficult to figure out. My only saving grace is that I never got to a point of proficiency with the Perl idioms, so I don’t have any super dense code to decode.

I had tinkered with python and liked it. It seemed to be a better implementation of a programming language than Perl. In particular, the language syntax itself is compact, making it easy to put together useful programs quickly. The ability to have quick success with a programming language can’t be understated. Further, the more powerful and useful forms of the language are accessible without all kinds of little idiosyncracies or exceptions (funny characters, unusual punctuation, those sorts of things).

I’m not particularly qualified to assess the language to any great degree, so I won’t waste the time. The topic has been given adequate attention by more accomplished programmers than I. For me, the bottom line is it’s possible to write useful, maintainable, programs quickly in python. Further, if my blog client is any indicator, it seems to scale well when used in larger programs.

For posterity’s sake, I thought I’d put the first “pythonic” idiom I concocted myself. It actually did exactly what I wanted it to the first time I coded it:

n = max(map(lambda x: len(self.__ast[x]), self.__ast.keys()))

It sure beat ‘for’ loops and ‘if’ statements. The only help I’ll offer is that ‘__ast’ is a dict of lists. Actually, that’s probably all the help needed.

Leave a Reply

Your email address will not be published. Required fields are marked *