Wednesday, December 12, 2007

Settling in with Python

Dude, Python needs forward declares? That's a shame.

It's vaguely disconcerting that it seems like nothing is checked until runtime, and that all kinds of errors don't get caught unless the code actually gets executed. It totally confuses my traditionaly ways of reasoning about what is wrong. I bet it's more intuitive for beginners, though, to think of parsing/typechecking/execution as happening all at the same time.

Ada is really subversive. In Ada, you can call a zero-argument function by stating its name. In Python, with first-class functions, that is a legal syntax for the wrong thing, but it doesn't stop me from using it. (The solution, of course, is that functions must not have zero arguments. If you have referential transparency, there's no point in zero-arg functions.)

Doing object-oriented design in Python is a lot like doing it in Smalltalk, except that I can work in just one text file easily. It's quite pleasant.

0 comments: