Sunday, November 16, 2003

Properties vs. Methonds

Brad Abrams asks in his blog for some feedback on this. I wrote the 34th comment or something like this. I hope Brad will read them all ;) This is mine:

Brad, I remember when Omri Gazitt got me converted to ADO.NET design philosophy. In http://discuss.develop.com/archives/wa.exe?A2=ind0009B&L=DOTNET&P=R53999&I=-3 he explained that the ADO Recordset design was bad because in some scenarios it isolated the programmer from the knowledge that he was doing expensive cross machine operations.

The fact is that the changes introduced in ADO.NET had nothing to do with changing property syntax to function syntax. On the contrary they created a new object model in which the programmer had to explicitly program for the cross machine scenario. They also gave the programmer the dataset which allowed for saving networks round trips.

In your example I sincerely see no point in the function syntax helping code review. I have done code review and I know those parenthesis are lost in 10 thousand lines. You really have to know what you are doing and go line by line, or use case by use case to find the not so great coding.

In the end the get_ at the beginning and the parenthesis are just adding to code clutter, and they are no replacement for a good profiling tool that would put a red alert close to the expensive line.

Please, let’s stick to properties and consistence in this case.

No comments:

Moving to MSDN

I haven't decided yet, but it is very likely that I will stop blogging here for some time. For some background, I have moved to the sate...