Archive for the 'Coding' Category

Unnecessary complexity?

So I’m working on a project at work that recieves data in the form of a URL, parses it and saves it to a database.

The previous version of this Python script is very simple, using raw sql to save down the data to the database. My redesign includes SQLAlchemy, a Python ORM/DAL. Many people would say that for such a short script this is overkill. And on the face of it, they would be right.

Lazy Cat

However, as the system evolves over the course of time, the simple SQL approach will be less and less suitable, and the benefits of an ORM framework will be more and more apparent.

A lazy person would not do anything extra, and hack out a quick script that would be very brittle to changes in the database engine, or environment. For example, if we migrated at some point in the future away from our current engine to PostgreSQL (for example), some of the sql syntax may change and break the code, requiring further tweaks and debugging.

A Proactively Lazy person knows that with a little extra effort now (Learning SQLAlchemy’s syntax) many problems can be avoided in the future.

This applies not just to the database framework, of course, but documentation and testing. Both make your job easier in the long run!

Photo courtesy of ~fb~



Error: Twitter did not respond. Please wait a few minutes and refresh this page.


  • 1,492 hits