2011-01-30

Static Typing vs Python

Small to large Python applications have a bad reputation with me, especially whenever they involve a GUI. I generally anticipate that "Oh no, it's in Python, it's going to run into a Runtime Exception when I click a button." And sure enough, it almost always does.

The latest victim is Transmageddon, a transcoding application which hopes to transcode my video files. I am amazed at the run time exceptions it encounters, especially after looking at the code. "How could this be missed?!" I wonder, but I know. Python is interpreted and dynamically typed, so a lot of a programme's correctness isn't verified in a compile step, quickly alerting the developer that something's amiss. When someone tells me that dynamic typing allows you to write code faster, I now think "Well, faster doesn't matter if the result is wrong" and "I could write C code faster too if I just made the compiler accept garbage."

(Note: Transmageddon is not garbage and bug reports exist, it was just an example of a programme where I expected to have an issue at run time and did.)

(Note 2: perhaps it would be nice if more people used pylint or something like it.)