Click here to Skip to main content
15,891,851 members
Home / Discussions / C#
   

C#

 
GeneralRe: Coding Standard Question Pin
Pete O'Hanlon2-Oct-07 2:15
mvePete O'Hanlon2-Oct-07 2:15 
AnswerRe: Coding Standard Question Pin
Pete O'Hanlon1-Oct-07 10:06
mvePete O'Hanlon1-Oct-07 10:06 
AnswerRe: Coding Standard Question Pin
Matthew Cuba1-Oct-07 10:19
Matthew Cuba1-Oct-07 10:19 
GeneralRe: Coding Standard Question Pin
donovan.solms1-Oct-07 10:34
donovan.solms1-Oct-07 10:34 
GeneralRe: Coding Standard Question Pin
Dan Neely1-Oct-07 10:51
Dan Neely1-Oct-07 10:51 
GeneralRe: Coding Standard Question Pin
PIEBALDconsult1-Oct-07 13:58
mvePIEBALDconsult1-Oct-07 13:58 
GeneralRe: Coding Standard Question Pin
Scott Dorman1-Oct-07 15:46
professionalScott Dorman1-Oct-07 15:46 
AnswerRe: Coding Standard Question Pin
Scott Dorman1-Oct-07 15:50
professionalScott Dorman1-Oct-07 15:50 
My preference would almost always be the first example. The second example is good if you can guarantee that you will never need to do anything more advanced in the property getter or setter. Both of thees example are equivalent, with the second one allowing the compiler to automatically generate the backing variable.

I have used both styles, and generally only use the second for very simple classes and structs.

For future reference, you should be clear that you are referring to a .NET 3.5 (Orcas) feature, especially with this question as the second example is also the way a property is defined in an interface.


Scott.

—In just two days, tomorrow will be yesterday.

[Forum Guidelines] [Articles] [Blog]

GeneralRe: Coding Standard Question Pin
PIEBALDconsult1-Oct-07 16:56
mvePIEBALDconsult1-Oct-07 16:56 
JokeRe: Coding Standard Question Pin
Pete O'Hanlon1-Oct-07 21:59
mvePete O'Hanlon1-Oct-07 21:59 
GeneralRe: Coding Standard Question Pin
Scott Dorman2-Oct-07 2:59
professionalScott Dorman2-Oct-07 2:59 
GeneralRe: Coding Standard Question Pin
Robert Rohde2-Oct-07 1:55
Robert Rohde2-Oct-07 1:55 
GeneralRe: Coding Standard Question Pin
Scott Dorman2-Oct-07 3:01
professionalScott Dorman2-Oct-07 3:01 
GeneralRe: Coding Standard Question Pin
PIEBALDconsult2-Oct-07 5:41
mvePIEBALDconsult2-Oct-07 5:41 
QuestionSelecting listview item by method not retained when tabbing into listview Pin
jchalfant1-Oct-07 9:30
jchalfant1-Oct-07 9:30 
AnswerRe: Selecting listview item by method not retained when tabbing into listview Pin
jchalfant1-Oct-07 9:59
jchalfant1-Oct-07 9:59 
Questioncalling modeless lookup form from datagridview combobox Pin
AndrusM1-Oct-07 9:29
AndrusM1-Oct-07 9:29 
QuestionInsert a row in Gridview Pin
ss.mmm1-Oct-07 9:24
ss.mmm1-Oct-07 9:24 
AnswerRe: Insert a row in Gridview Pin
Not Active1-Oct-07 9:46
mentorNot Active1-Oct-07 9:46 
GeneralRe: Insert a row in Gridview Pin
ss.mmm1-Oct-07 9:55
ss.mmm1-Oct-07 9:55 
GeneralRe: Insert a row in Gridview Pin
Not Active1-Oct-07 10:05
mentorNot Active1-Oct-07 10:05 
GeneralRe: Insert a row in Gridview Pin
DotNetXenon1-Oct-07 10:12
DotNetXenon1-Oct-07 10:12 
GeneralRe: Insert a row in Gridview Pin
ss.mmm15-Oct-07 8:28
ss.mmm15-Oct-07 8:28 
QuestionUniversal Toolbox Item installation help Pin
Jason Farrar1-Oct-07 9:06
Jason Farrar1-Oct-07 9:06 
AnswerRe: Universal Toolbox Item installation help Pin
TJoe1-Oct-07 13:10
TJoe1-Oct-07 13:10 

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.