Awhile back I ranted against using dynamic languages like Ruby, Python etc. Recently, I’ve been using Python as a way to test Resteasy’s SMIME integration. It was an extremely frustrating experience that would have been much better if Python was statically typed. Why? Well, take a look at this documentation for doing SMIME with Python and M2Crypto. The problem was is that the examples are interacting with Python’s mail API. I needed to be able to send SMIME over HTTP. So, I needed to understand the M2Crypto API a little bit better. If you look at the example code, you have no idea which additional methods are available, and more frustratingly, when types of objects these methods return. The auto-generated javadoc-like docs for M2Crypto were even less helpful. What I had to end up doing was diving into the M2Crypto codebase to figure out exactly what was going on.
Moral of the story? Programming in dynamic languages can be a lot of fun. But when you run into APIs you’re not familiar you’re pretty much at the mercy of the documentor. If the documentation sucks, you’re pretty much up shit creek and forced to dive into the code to understand what is going on.