Click here to Skip to main content
15,914,444 members
Home / Discussions / C#
   

C#

 
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 
AnswerRe: Installer Problem Pin
Xmen Real 17-Feb-09 2:59
professional Xmen Real 17-Feb-09 2:59 
QuestionRead a No of Characters in a Image Pin
devacaleb17-Feb-09 1:19
devacaleb17-Feb-09 1:19 
AnswerRe: Read a No of Characters in a Image Pin
SeMartens17-Feb-09 1:22
SeMartens17-Feb-09 1:22 
AnswerRe: Read a No of Characters in a Image Pin
Tom Deketelaere17-Feb-09 1:29
professionalTom Deketelaere17-Feb-09 1:29 
GeneralRe: Read a No of Characters in a Image Pin
Nagy Vilmos17-Feb-09 1:53
professionalNagy Vilmos17-Feb-09 1:53 
AnswerRe: Read a No of Characters in a Image Pin
benjymous17-Feb-09 1:31
benjymous17-Feb-09 1:31 
AnswerRe: Read a No of Characters in a Image Pin
Calin Tatar17-Feb-09 1:34
Calin Tatar17-Feb-09 1:34 

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.