>> But that's obviously a lie... they are not compatible in the
>> public interface contract, since the OLD version let you
>> twiddle the properties at will, and the new one restricts
>> the input values.  That's the sort of subtle change that
>> leads to MFC42.DLL hell.
>
> I think that "lie" is a bit harsh.

I calls them as I sees 'em :)  Maybe I'm a bit sensitive to such things,
like when heap allocation rules change between releases of MSVCRT.DLL
(remember that fiasco?)

> What if the original documentation explicitly stated that the
> values have to be in a certain range?

Documentation is only half the answer... if you document something, but
don't do it, that's certainly a bug (or even two, one on the code, one on
the unit test); you might even call it a bug in the documentation.  Whether
you can safely make an invisible change is another matter entirely.  If your
modification breaks existing code (right or wrong), you have to let people
know, and do the right thing in "compatibility mode".

> If a client noticed that he can pass in "foo" instead
> of "baz" despite what the documentation said, then
> the client has a bug, and it's not the publisher's
> responsibility to perpetuate that.

Okay, so you _document_ that class "zot" property "foo" must lay between
zero and property "baz", and don't check during the settor in revision
1.0.0.0.  Later, you ship 1.0.1.0 and declare it compatible.  If "baz"
defaults to 10 in the constructor, the following code, which used to work,
and was PER DOCUMENTATION, starts to fail because the new version is
enforcing a temporal restriction that wasn't necessarily in the
documentation, but is implied.

  zot a = new zot();
  a.foo = 52;
  a.baz = 100;

but this code works:
  zot a = new zot();
  a.baz = 100;
  a.foo = 52;

> Is the public interface contract what the documentation says or
> what the implementation is?

The whole Open Source explosion, and my experience with code maintenance and
enhancement since 1981 indicate that the code _IS_ the documentation.  Just
look at how many times we reference looking at "how Rotor does it", or
"check the Mono implementation" to explain huge gaps in the CLR/FCL docs...

Marc

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
NEW! ASP.NET courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to