The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

tempusfugit (144) [Avatar] Offline
#1
6.3 Calculating with schedules (p.151)

"The change in the date is specified as a lambda function that returns a new DateTime object."

Technical nitpick: Both System.DateTime and System.TimeSpan are structures, so no object references are returned, instead the updated value is returned, to be copied into target DateTime memory location. So it would be more accurate to say:

"The change in the date is specified as a lambda function that returns the new DateTime value."

The fact that structures inherit from System.Object just serves to confuse the issue.

Presumably because DateTime and TimeSpan are structures, not classes, accounts for the fact that the "new" keyword isn't required, allowing for "construction in-place". Even in C# you don't have to use "new" on structures if you don't use a constructor but simply use the structure's fields, properties and methods.