Hi all,
I've been insisting on this point (Postel's Law as applied to
software) but I feel that my argument hasn't been convincing. To be
sincere, it's my fault: I haven't presented the argument in a
convincing way. Let's try to correct it.
Postel's Law is one of foundations of Internet design. Why does it
work? Simple: it creates an asymmetry on the strictness requirements.
As a programmer, you must make sure that you play nice. It's something
that *you can control*. But you can't control what other pieces of
software do, so you have to be more open minded about what do they
send to you. Other people may have done it in a slightly different
(but incompatible) way, based on a perfectly reasonable interpretation
of the same standard. Postel's Law is just the realization of an
inherent asymmetry in the problem space.
I believe that Postel's Law principles should apply to any complicate
enough piece of software (and that includes anything bigger than a few
dozen lines). The reason is: the programmer only does have control
over the interface provided by software he's writing, but no control
over the interfaces it uses.
One of the consequences of failing to meet Postel's Law guidelines in
software is the usual fingerpointing exercise. If two pieces of
software do not match, it's usual to hear heated arguments about who
did wrong, and who should correct it. But what if both sides have
reasonable arguments? Simple: the client side must adapt to it, as
reasonably as possible. It's simpler done this way, and consistent.
Better, it avoids surprises.
In SQLObject's case, I believe that the principle is simple. If the
programmer declared an IntCol, it's reasonable to enforce it. But
there's no way one can enforce the same kind of strictness about the
DB driver. I'm not saying this in the strict sense of the int()
conversion, I'm talking about the generic case. That's why I believe
SQLObject should perform automatic coercion on all the data it fetches
from the database.
--
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: car...@gm...
mail: car...@ya...
|