Click here to Skip to main content
15,885,954 members
Home / Discussions / C#
   

C#

 
GeneralRe: Property vs Public Variable Pin
PIEBALDconsult17-Feb-09 6:36
mvePIEBALDconsult17-Feb-09 6:36 
AnswerRe: Property vs Public Variable Pin
EliottA17-Feb-09 3:39
EliottA17-Feb-09 3:39 
AnswerRe: Property vs Public Variable Pin
Pete O'Hanlon17-Feb-09 3:48
mvePete O'Hanlon17-Feb-09 3:48 
AnswerRe: Property vs Public Variable Pin
DaveyM6917-Feb-09 4:08
professionalDaveyM6917-Feb-09 4:08 
GeneralRe: Property vs Public Variable Pin
PIEBALDconsult17-Feb-09 5:31
mvePIEBALDconsult17-Feb-09 5:31 
AnswerProperties SUCK! Pin
Ennis Ray Lynch, Jr.17-Feb-09 4:44
Ennis Ray Lynch, Jr.17-Feb-09 4:44 
AnswerRe: Property vs Public Variable Pin
Xmen Real 17-Feb-09 5:17
professional Xmen Real 17-Feb-09 5:17 
AnswerRe: Property vs Public Variable Pin
cmk17-Feb-09 5:25
cmk17-Feb-09 5:25 
A better way:
public int UserID { get; set; }

Is it better ?
The only reason (i accept) for using properties over public variables is that changing from a variable to a property breaks your interface.
http://blogs.msdn.com/abhinaba/archive/2006/04/11/572694.aspx[^]

I generally use properties unless i know for sure that i will never ever want to add logic to get/set. As it's hard to see the future i generally try to err on the side of safety.

...cmk

The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack

AnswerRe: Property vs Public Variable Pin
PIEBALDconsult17-Feb-09 5:42
mvePIEBALDconsult17-Feb-09 5:42 
AnswerRe: Property vs Public Variable Pin
_Maxxx_17-Feb-09 16:51
professional_Maxxx_17-Feb-09 16:51 
Question.net error in application Pin
ToddHileHoffer17-Feb-09 3:04
ToddHileHoffer17-Feb-09 3:04 
QuestionAccessing Website Content Pin
Rahul Babu17-Feb-09 2:21
Rahul Babu17-Feb-09 2:21 
AnswerRe: Accessing Website Content Pin
SeMartens17-Feb-09 2:23
SeMartens17-Feb-09 2:23 
AnswerRe: Accessing Website Content Pin
dan!sh 17-Feb-09 2:30
professional dan!sh 17-Feb-09 2:30 
AnswerRe: Accessing Website Content Pin
N a v a n e e t h17-Feb-09 2:36
N a v a n e e t h17-Feb-09 2:36 
GeneralRe: Accessing Website Content Pin
Rahul Babu17-Feb-09 2:45
Rahul Babu17-Feb-09 2:45 
GeneralRe: Accessing Website Content Pin
SeMartens17-Feb-09 2:48
SeMartens17-Feb-09 2:48 
GeneralRe: Accessing Website Content Pin
J4amieC17-Feb-09 3:03
J4amieC17-Feb-09 3:03 
AnswerRe: Accessing Website Content Pin
Eddy Vluggen17-Feb-09 3:26
professionalEddy Vluggen17-Feb-09 3:26 
QuestionProcessStartInfo Pin
Peter Walburn17-Feb-09 1:40
Peter Walburn17-Feb-09 1:40 
AnswerRe: ProcessStartInfo Pin
benjymous17-Feb-09 1:46
benjymous17-Feb-09 1:46 
GeneralRe: ProcessStartInfo Pin
Peter Walburn17-Feb-09 3:06
Peter Walburn17-Feb-09 3:06 
AnswerRe: ProcessStartInfo Pin
SeMartens17-Feb-09 1:49
SeMartens17-Feb-09 1:49 
GeneralRe: ProcessStartInfo Pin
Peter Walburn17-Feb-09 3:07
Peter Walburn17-Feb-09 3:07 
QuestionInstaller Problem Pin
Waheed Ur Rehman17-Feb-09 1:40
Waheed Ur Rehman17-Feb-09 1:40 

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.