The Active Network
ActiveMac Anonymous | Create a User | Reviews | News | Forums | Advertise  
 

  *  

  Properites vs. Methods...
Time: 19:17 EST/00:17 GMT | News Source: GotDotNet | Posted By: Jonathan Tigner

It is an age old debate… we have some fairly good guidelines, but they certainly leave room for improvement. Today at a WinFX API review (for some cool stuff that didn’t make it out in the PDC drop) we had the debate again… Today the APIs look like:

public DateTime GetDisconnectTime();
public TimeSpan GetIdleTime();
public DateTime GetLogonTime();
public SessionStates GetSessionStates();
public WindowsIdentity GetUserInformation();

My knee jerk is to make these properties…

public DateTime DisconnectTime {get; }
public TimeSpan IdleTime {get; }
public DateTime LogonTime {get; }
public SessionStates SessionStates {get; }
public WindowsIdentity UserInformation {get; }

the problem… well, the calls *could* be cross machine…. My worry is if they are cross machine making these guys properties will lead people to write inefficient code (and therefore bring down the wrath of Rico)…

So, my question for you… Based on this very limited data I have given you, what should we do here? Go for properties and hope for the best, or error on the safe side and use methods, something else?

Write Comment
Return to News

  Displaying 751 through 755 of 755
Prev | First
  The time now is 1:50:21 AM ET.
Any comment problems? E-mail us
#751 By 4240821 (82.115.4.100) at 1/6/2026 4:42:45 AM
https://www.pillowfort.social/posts/6558311
https://www.pillowfort.social/posts/6558105
https://www.pillowfort.social/posts/6558022
https://www.pillowfort.social/posts/6557957
https://www.pillowfort.social/posts/6557830
https://www.pillowfort.social/posts/6557649
https://www.pillowfort.social/posts/6557474
https://www.pillowfort.social/posts/6557261
https://www.pillowfort.social/posts/6557070
https://www.pillowfort.social/posts/6556926

#752 By 4240821 (82.115.4.100) at 1/6/2026 2:39:45 PM
https://www.pillowfort.social/posts/6565219
https://www.pillowfort.social/posts/6565121
https://www.pillowfort.social/posts/6565027
https://www.pillowfort.social/posts/6564918
https://www.pillowfort.social/posts/6564758
https://www.pillowfort.social/posts/6564643
https://www.pillowfort.social/posts/6564496
https://www.pillowfort.social/posts/6564408
https://www.pillowfort.social/posts/6564283
https://www.pillowfort.social/posts/6564204

#753 By 4240821 (82.115.4.100) at 1/9/2026 1:43:52 AM
https://www.pillowfort.social/posts/6803185
https://www.pillowfort.social/posts/6802213
https://www.pillowfort.social/posts/6801979
https://www.pillowfort.social/posts/6801764
https://www.pillowfort.social/posts/6801446
https://www.pillowfort.social/posts/6801272
https://www.pillowfort.social/posts/6801129
https://www.pillowfort.social/posts/6801035
https://www.pillowfort.social/posts/6800970
https://www.pillowfort.social/posts/6800892

#754 By 4240821 (82.115.4.100) at 1/9/2026 12:08:15 PM
https://www.pillowfort.social/posts/6515197
https://www.pillowfort.social/posts/6515130
https://www.pillowfort.social/posts/6515028
https://www.pillowfort.social/posts/6514906
https://www.pillowfort.social/posts/6514858
https://www.pillowfort.social/posts/6514726
https://www.pillowfort.social/posts/6514658
https://www.pillowfort.social/posts/6514457
https://www.pillowfort.social/posts/6514364
https://www.pillowfort.social/posts/6514252

#755 By 4240821 (82.115.4.100) at 1/9/2026 6:36:04 PM
https://www.pillowfort.social/posts/6522788
https://www.pillowfort.social/posts/6522648
https://www.pillowfort.social/posts/6522532
https://www.pillowfort.social/posts/6522144
https://www.pillowfort.social/posts/6521979
https://www.pillowfort.social/posts/6521800
https://www.pillowfort.social/posts/6521696
https://www.pillowfort.social/posts/6521639
https://www.pillowfort.social/posts/6521552
https://www.pillowfort.social/posts/6521447

Write Comment
Return to News
  Displaying 751 through 755 of 755
Prev | First
  The time now is 1:50:21 AM ET.
Any comment problems? E-mail us
User name and password:

 

  *  
  *   *