Picking the right libraries
This time's rewrite section is about the art of picking the right libraries.
Yesterday I deployed some code that used Clickatell's SMS gateway. Everything worked fine locally, but on our production machines there was a library bug (SSL issues). Seems like the author used pycurl, which is a Python wrapper for libcurl. This was a bad choice, since he could have used Python's native urllib library instead. The solution for this problem was to rewrite his code to use Python's urllib. 1) For Skeletonz I had picked the wrong ORM twice, the first one was Zope's object database, which was really hard to debug and performed awfully. After some evaluation I rewrote everything to use SQLObject, which also had some awkwardness. After this I coded amidb and rewrote everything to it. This was a very costly process. So how should we pick the right libraries? I think experience is crucial in picking the right library - especially if you are picking an exotic one. So if you an unsure in your choice, pick a library that is proven. Growing your own libraries that fit your needs is also a good idea, if you know you can lift the task. For example, if I could choose between CouchDB and MySQL I would choose MySQL, since it's proven - even if CouchDB might have some really cool things in it.
Code rewrite
·
Python
•
21. Sep 2008
|
|