But if you look at the kinds of malformed dates that are out there, most are not malformed because the programmer tried to use some legal variant of the date syntax and failed to get it right - they're malformed because the programmer failed to even try to get it right.
True. But IMO, if the syntax were simple, strict and understandable to the average programmer, this probably wouldn't happen.
I'm not so sure, Arnt. I get the feeling with many mail implementations that
the implementors failed to appreciate that RFC822 was actually meant to be a
strict grammar at all. Perhaps the human-readability of it lends the
impression that it's *only* meant to be human readable. Or maybe something
closer to your explanation is also true in some cases: the grammar is
sufficiently daunting that implementors just aim for an approximation,
coupled with some basic compatibility tests.
My best current guess as to how to deal with the problem is
to assume that implementors are lazy, and make a point of giving them
something easy to implement. Assume that they'll take short-cuts to
implementation, and thus take as many short-cuts in advance as you can, so to
speak. This design approach runs contrary to the typical designer mentality.
A designer thinks of his design as a great work of art and engineering, with
each subtle nuance of grammar thoughtfully crafted into place to form an
aesthetically pleasing whole.
In this area, I do believe that "less is more" is
the right sort of attitude. Einstein said we should make theories as simple
as possible, but no simpler, and it seems just as good a maxim for design.
"A designer knows he has achieved perfection not when there is nothing left to
add, but when there is nothing left to take away."
-- Antoine de Saint-Exupéry (1900-44)