Monday, May 14, 2007

Data representations: the more the better

A friend of mine, also a long time Lisp hacker, stated the opinion about 15 years ago that object oriented might be the "last great programming paradigm". A good thought, but object representation is just one way to think about and manipulate data. I admit that my favorite style of programming is with an object oriented language with transparent object relational mapping (e.g., Java with Prevayler, Ruby with ActiveRecord, or Lisp with something like AllegroCache).

The ability to write programs (preferably quickly :-) allows us to experiment with data representations. The point I am making here is that different software tools can not only help solve different problems with different levels of effort, but the tools that we choose inform us and change the way we think.

Sometimes a relational data model just works best, both for efficient access (not letting an object relational mapping system build an entire object in memory when you are only interested in a few columns in a table) or for thinking about and browsing data.

When there are too many attributes characterizing data that you need to explore or use, then faceted browsing helps a lot: pick the most important attribute, then the second, etc., eliminating large parts of a data space.

For some problems graphs are the best data representation and languages like Lisp and Prolog that allow list data structures to be cut up and put back together are most effective.

No comments: