Click here to Skip to main content
15,914,071 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Property or a method. This seems wrong. Pin
Chris Maunder21-May-14 4:10
cofounderChris Maunder21-May-14 4:10 
GeneralRe: Property or a method. This seems wrong. Pin
Rage21-May-14 5:58
professionalRage21-May-14 5:58 
GeneralRe: Property or a method. This seems wrong. Pin
David O'Neil20-May-14 19:56
professionalDavid O'Neil20-May-14 19:56 
GeneralRe: Property or a method. This seems wrong. Pin
CPallini20-May-14 20:09
mveCPallini20-May-14 20:09 
GeneralRe: Property or a method. This seems wrong. Pin
BillWoodruff20-May-14 20:09
professionalBillWoodruff20-May-14 20:09 
GeneralRe: Property or a method. This seems wrong. Pin
Jeremy Falcon21-May-14 4:03
professionalJeremy Falcon21-May-14 4:03 
GeneralRe: Property or a method. This seems wrong. Pin
Chris Maunder21-May-14 4:11
cofounderChris Maunder21-May-14 4:11 
GeneralRe: Property or a method. This seems wrong. Pin
User 5924120-May-14 20:13
User 5924120-May-14 20:13 
Interesting.
For another take look here:http://msdn.microsoft.com/en-us/library/w86s7x04.aspx[^]

Properties allow the hiding of the value in the backing store. "It is common for properties to use private fields as a backing store. The field is marked private in order to make sure that it can only be changed by calling the property." This is a very usefull way of preventing silly things from happening to the actual value and to know when the value changes because that is done through the setter. "They can take an action when data is changed, such as raising an event, or changing the value of other fields." This is another way of stating Lippert's premise "Properties should be stable" with which I agree.

About throwing exceptions the MSDN seems to disagree:
"The get accessor must end in a return or throw statement, and control cannot flow off the accessor body."
Peter Wasser

"The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts." - Bertrand Russell

GeneralRe: Property or a method. This seems wrong. Pin
Jörgen Andersson20-May-14 20:22
professionalJörgen Andersson20-May-14 20:22 
GeneralRe: Property or a method. This seems wrong. Pin
Chris Maunder21-May-14 4:13
cofounderChris Maunder21-May-14 4:13 
GeneralRe: Property or a method. This seems wrong. Pin
Jörgen Andersson21-May-14 4:41
professionalJörgen Andersson21-May-14 4:41 
GeneralRe: Property or a method. This seems wrong. Pin
V.20-May-14 21:11
professionalV.20-May-14 21:11 
GeneralRe: Property or a method. This seems wrong. Pin
Gary Wheeler21-May-14 0:28
Gary Wheeler21-May-14 0:28 
GeneralRe: Property or a method. This seems wrong. Pin
Chris Maunder21-May-14 4:15
cofounderChris Maunder21-May-14 4:15 
GeneralRe: Property or a method. This seems wrong. Pin
BobJanova21-May-14 1:11
BobJanova21-May-14 1:11 
GeneralRe: Property or a method. This seems wrong. Pin
Chris Maunder21-May-14 4:17
cofounderChris Maunder21-May-14 4:17 
GeneralRe: Property or a method. This seems wrong. Pin
Jeremy Falcon21-May-14 1:11
professionalJeremy Falcon21-May-14 1:11 
GeneralRe: Property or a method. This seems wrong. Pin
Marc Clifton21-May-14 2:05
mvaMarc Clifton21-May-14 2:05 
GeneralRe: Property or a method. This seems wrong. Pin
Chris Maunder21-May-14 4:18
cofounderChris Maunder21-May-14 4:18 
GeneralRe: Property or a method. This seems wrong. Pin
#realJSOP21-May-14 2:22
professional#realJSOP21-May-14 2:22 
GeneralRe: Property or a method. This seems wrong. Pin
Chris Maunder21-May-14 4:20
cofounderChris Maunder21-May-14 4:20 
GeneralRe: Property or a method. This seems wrong. Pin
Gary Wheeler21-May-14 4:21
Gary Wheeler21-May-14 4:21 
GeneralRe: Property or a method. This seems wrong. Pin
Ravi Bhavnani21-May-14 2:37
professionalRavi Bhavnani21-May-14 2:37 
GeneralThis question reminds me of the anecdote Pin
Ennis Ray Lynch, Jr.21-May-14 3:49
Ennis Ray Lynch, Jr.21-May-14 3:49 
GeneralNagy & DD Pin
thatraja20-May-14 17:36
professionalthatraja20-May-14 17:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.