Wednesday, December 14, 2005

Humane Interfaces vs Minimal Interfaces

There is an interesting debate going on between proponents of Humane Interfaces and Minimal Interfaces. It looks like, Ruby camp is representing the Humane Interfaces while Java camp is representing the later. The debate started with a posting by Martin Fowler "HumaneInterface". And here is a summary of the debate., referred to as the Monkey knife fight.

I favor the Humane Interface camp. The interface should reflect all reasonably common scenarios it can be used. Not just the minimal building blocks. Let me explain by an example. Assume you have a Math class and a method add. As per mimimal interface camp, this is enough to carry out addition, subtraction and multiplication. It is true that you CAN do all those operations with add method. But not without user writing some code on top. Like if you want mulitplication, you would write a loop to add it as many times or some other smart logic. Imagine you have 1000 different users use your class. All 1000 users have to duplicate similar code in their product to do muliplication. All 1000 users have to test their code. All 1000 users have to maintain this code. But had this multiplication code be added to the class itself, the class would have been tested only once and need maintenance at one place. This would help developers focus more on the business logic, than writing utility functions all around. This might be translated in to hefty $$$ of savings for organizations too.

However, it is little hard to find out balance and identify only and all reasonably common scenarios and provide an interface equipped with all of them. But it pays off very soon, particularly if you are writing generic libraries, like the Java framework libraries. But there is a blessing in disguise in the minimal interfaces. Lot of work and more jobs for a whole lot of programmers.

NDTV.com : Fact or Allegation ? Just another twisted title for sensationalism

This is yet another example of NDTV.com’s sensationalism twisted titles. The title says, as if this was a fact, woman made to urinate in pub...