rubikzube

software engineer ¤ yogi ¤ turban cowboy

Thursday, November 25, 2004

Sometimes the interface is half-empty

Last morning I spent some time thinking about what to do when I want to reference an instance of a class by its interface but I need to use the powers of two separate interfaces.

A more experienced co-worker suggested that I write a new interface that declares no methods (i.e. empty) and inherit from both of the required interfaces, however, this solution seems clunky to me. I alway thought of interfaces as contracts that specify a behavior on the part of the implementing class, and a method of avoiding the brittleness and limitations of deep class hierarchies. By that logic, creating empty interface hierarchies to work around scope creep seems to obviate everything that is elegant about interfaces.

In surfing the web for alternative guidance, however, I found empty interfaces commonly used for a variety of reasons by programmers with far more experience and education in the dark arts than myself; tagging classes for semantic purposes and enforcing standardization at compile time being among some of those reasons. And while personally I would agree with none of these uses, I have to admit defeat and recongnize that while an inherited empty interface may not define any behaviors and impose unecessary restrictions down the line, it can serve a purpose.

(For the record, I still reserve the right to call it clunky.)

Tuesday, November 23, 2004

And the hits just keep on comin'

The greatest thing about being a programmer is the relative youth of the field. There is always something new coming down the bend that last week was beyond your imagination and in two years will be a part of your daily routine.

This time around the new hotness was brought to light reading an article by Sergey Dmitriev of JetBrains on Language Oriented Programming. I spent two hours composing a scathing retort against the it, decided to do a little more research on the subject before opening my big fat mouth, and ended up blown away his forward thinking after looking at Jack Greenfield's work on Software Factories.

With Software Factories a.k.a Language Oriented Programming a.k.a. Domain Specific Languages, I have a new third conceptual approach to my craft in as many years. It’s like having a girlfriend who likes to dress up in fun little outfits, and although it may not have the same warm and tingly effect, it is very exciting indeed.

Friday, November 05, 2004

Gettin' out the foreign vote

This past Tuesday my father went to the polls and voted for our next President, as he did in 2000. This would be perfectly normal if my father were a citizen of the United States It is amazing to me that after repeatedly telling government representatives that he is not a citizen they continue to place him on the list of registered voters. It doesn't stop there either They also let him use his green card as identification when he shows up at his polling site

I must say that I am very proud of America for finally letting the rest of the world have a say in the future.