microformats

Just now I was scanning the recent activity on the Microformats wiki and doing some simple wiki gardening when I had a moment of insight (at least I hope it was insight ;)

microformats help solve **now** problems instead of **possible** problems

Now, what do I mean by that. In my previous job I had to deal with large amounts of data that comecame from different data sources but yet contained similiar data items. After all, there are only so many ways you can "describe" inventory or payroll information right?

Well, actually, there are n+1 ways where n is the number of programmers involved in the process ;)

The method I came to use while solving these problems involved setting up classes in a classic object-oriented manner; like data items get described by like classes and classes forming relationships using either inheritance or containment - all "normal" to most programmers. This worked for majority of the cases and the remainder were handled by either pre-processing the data to normalize it or building those ugly edge-case-if-structures to handle the exceptions within the implementation of a class.

I found that this method worked very well and eventually I came to have a collection of classes that described almost all of the data that I had run across. It got to the point where I could create a new import or export routine by hooking up classes to each other with some procedural "glue". Pretty nifty if you think about it - not everyone can say that OO methods had actually cut down the time or reduced the amount of new code that had to be written to solve a problem.

But to get back to the point ...

Early on in the above process I used to plan and try to anticipate all possible data uses, values and/or possibilities -- I mean after all, isn't that what you were supposed to do when you designed your class heirarchy? Soon I found that the code to handle all possible code paths made the code that dealt with actual data much more complicated and was the source of many an ugly bug. (editor's note: now he finally gets to the point!) The lesson I learned back then was that while you could look ahead and plan for the things that experience had shown would be possible variations, any other planning was purely premature and not something to do.

This is the aha! moment I had earlier. Microformats are a way to ensure that the data presented, or the visible data - as it's described in the the microformats principles wiki page, is both usable by human and machine and also is the simplest method to describe that item of data.

updated 2005-10-22 03:30


Mentions