Click here to Skip to main content
16,018,394 members
Home / Discussions / C#
   

C#

 
QuestionPublic member vs. public property Pin
cueshot23-Feb-07 5:45
cueshot23-Feb-07 5:45 
AnswerRe: Public member vs. public property Pin
kubben23-Feb-07 5:49
kubben23-Feb-07 5:49 
AnswerRe: Public member vs. public property Pin
BoneSoft23-Feb-07 5:50
BoneSoft23-Feb-07 5:50 
GeneralRe: Public member vs. public property Pin
cueshot23-Feb-07 6:04
cueshot23-Feb-07 6:04 
AnswerRe: Public member vs. public property Pin
Stefan Troschuetz23-Feb-07 5:51
Stefan Troschuetz23-Feb-07 5:51 
AnswerRe: Public member vs. public property Pin
Dave Kreskowiak23-Feb-07 5:56
mveDave Kreskowiak23-Feb-07 5:56 
GeneralRe: Public member vs. public property Pin
Christian Graus23-Feb-07 7:32
protectorChristian Graus23-Feb-07 7:32 
AnswerRe: Public member vs. public property Pin
Christian Graus23-Feb-07 7:31
protectorChristian Graus23-Feb-07 7:31 
There is almost no difference, so long as your class is never going to be in a dll, or otherwise reflected on. Either way, it does the same thing. It's true that much religious discussion occurs over public properties, but what is often missed is that the *point* of using public properties is that you can change the visibility of the set method and leave the get as public. If you just use properties instead of variables, but don't think about what visibility you use, then you've really missed the point.

Use properties, only because it's cleaner to always do so. But, remember also to always think about showing as much as you need to, and no more. I make all setters private to start with unless it's totally clear they need to be exposed, and change them if I need to.


Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

GeneralRe: Public member vs. public property Pin
BoneSoft23-Feb-07 8:03
BoneSoft23-Feb-07 8:03 
GeneralRe: Public member vs. public property Pin
mike montagne23-Feb-07 13:22
mike montagne23-Feb-07 13:22 
GeneralOh... and about Serialization and IDE processes Pin
mike montagne23-Feb-07 13:35
mike montagne23-Feb-07 13:35 
QuestionExcel: Problem with Datagrid-generated XML-file Pin
M.Vo.23-Feb-07 5:42
M.Vo.23-Feb-07 5:42 
QuestionForms Control Z Order Pin
BoneSoft23-Feb-07 5:33
BoneSoft23-Feb-07 5:33 
AnswerRe: Forms Control Z Order Pin
BoneSoft23-Feb-07 5:39
BoneSoft23-Feb-07 5:39 
AnswerRe: Forms Control Z Order Pin
kubben23-Feb-07 5:40
kubben23-Feb-07 5:40 
GeneralRe: Forms Control Z Order Pin
BoneSoft23-Feb-07 5:47
BoneSoft23-Feb-07 5:47 
QuestionCannot get datagridview to show records Pin
brainfuelmedia_23-Feb-07 5:07
brainfuelmedia_23-Feb-07 5:07 
AnswerRe: Cannot get datagridview to show records Pin
kubben23-Feb-07 5:32
kubben23-Feb-07 5:32 
AnswerRe: Cannot get datagridview to show records Pin
Drew McGhie23-Feb-07 5:48
Drew McGhie23-Feb-07 5:48 
GeneralRe: Cannot get datagridview to show records Pin
brainfuelmedia_23-Feb-07 5:56
brainfuelmedia_23-Feb-07 5:56 
GeneralRe: Cannot get datagridview to show records Pin
Drew McGhie23-Feb-07 6:00
Drew McGhie23-Feb-07 6:00 
QuestionRemoting Pin
Saaaaz23-Feb-07 4:48
Saaaaz23-Feb-07 4:48 
AnswerRe: Remoting Pin
Obaid ur Rehman23-Feb-07 6:02
Obaid ur Rehman23-Feb-07 6:02 
GeneralRe: Remoting Pin
Saaaaz25-Feb-07 8:13
Saaaaz25-Feb-07 8:13 
GeneralRe: Remoting Pin
Saaaaz27-Feb-07 3:12
Saaaaz27-Feb-07 3:12 

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.