metadata, modeling, static types

2008-02-12 @ 19:09#

Steve Yegge has a solid (long) post on the issue of metadata in programming. here's a taste from the summary:

I think the general answer to this is: when in doubt, don't model it. Just get the code written, make forward progress. Don't let yourself get bogged down with the details of modeling a helper class that you're creating for documentation purposes.

been there!

i struggled with some of this when i started building exyus last year. yes, i wanted a very bare-bones set of classes that focused on the issue of HTTP programming within REST contraints. yes, i added some metadata (in the form of .NET attributes), too.

at the same time, i really appreciate the notion of "less is better" (remember Code is our enemy). i wrote the engine in a way that supports the "static type" of HTTP Methods (GET, PUT, POST, DELETE, HEAD, OPTIONS). that's valuable. i also wrote the engine in a way that supports collection of URIs and Mime-types to handle routing and representations. that's where the attributes come in.

finally, it's important to find the 'sweet spot' that provides just enough generalization and just enough specialization. too much of either, and you get mush. for my final quote (this one from Albert Einstein):

Everything should be made as simple as possible, but not simpler.