On Tue, 21 May 2002, Andreas Häber wrote:
> If you read the docs for DateTime.AddHours[1] then it is very clear that
> this is the expected behaviour. Read especially the "Remarks" section...

Although I agree with that, my view is that the opening sentence of the
documentation of this method is not helpful.  (This sentence also appears
in the index of the methods of the struct.)  

The sentence says: 
  Adds the value of the specified TimeSpan to the value of this instance.
I think it would be more helpful to say:
  Returns the value formed by adding the value of the specified TimeSpan
  to the value of this instance.

There are many other opening sentences of the documentation of methods of
the DateTime struct that I would also alter in a similar way.

Similar comments probably apply to other immutable structs/classess.

For example, I've just looked at the opening sentence of the documentation
for the Replace method of the String class.  This says: 
  Replaces all occurrences of a specified Unicode character or String in
  this instance, with another specified Unicode character or String.
Once again, I would reword this as:
  Returns the string formed by taking a copy of this instance and
  replacing all occurrences of a specified Unicode character or String
  in the copy with another specified Unicode character or String.

--
Barry Cornelius                   Telephone: (0191 or +44 191) 374 4717
User Services, Information Technology Service,         Office: 374 2892   
Science Site, University of Durham, Durham, DH1 3LE, UK   Fax: 374 7759
www.dur.ac.uk/barry.cornelius/             [EMAIL PROTECTED]

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to