Click here to Skip to main content
15,919,245 members
Home / Discussions / C#
   

C#

 
GeneralRe: Direct X 9 ID3 tags ? Pin
leppie3-Aug-04 19:12
leppie3-Aug-04 19:12 
GeneralAlignment of listview Pin
Christian Graus2-Aug-04 10:56
protectorChristian Graus2-Aug-04 10:56 
GeneralRe: Alignment of listview Pin
beowulfagate2-Aug-04 13:59
beowulfagate2-Aug-04 13:59 
GeneralMulti-Column What Pin
Peter86753092-Aug-04 7:41
Peter86753092-Aug-04 7:41 
GeneralRe: Multi-Column What Pin
Nick Parker2-Aug-04 8:52
protectorNick Parker2-Aug-04 8:52 
GeneralRe: Multi-Column What Pin
Peter86753092-Aug-04 9:42
Peter86753092-Aug-04 9:42 
Question"Bad Form" to use public class variables without get & set? Pin
ThomasH12-Aug-04 7:06
ThomasH12-Aug-04 7:06 
AnswerRe: "Bad Form" to use public class variables without get & set? Pin
Steven Campbell2-Aug-04 7:38
Steven Campbell2-Aug-04 7:38 
The main argument against public fields is one of compatibility. If you change the public field to a public property, then that is a breaking change.

So, probably not a big deal for monolithic single EXE apps, but for class libraries it is a no-no.

In C#, I usually just put the whole property on a single line -- that way it does not clutter up the code so much.

There is one (experimental) .NET language takes care of this more elegantly, called Boo. It uses attributes to let you mark a private field as having a getter and/or setter, which is then auto-generated at compile time (by the Boo compiler).


my blog
GeneralRe: "Bad Form" to use public class variables without get & set? Pin
Judah Gabriel Himango2-Aug-04 8:05
sponsorJudah Gabriel Himango2-Aug-04 8:05 
GeneralRe: "Bad Form" to use public class variables without get & set? Pin
ThomasH12-Aug-04 9:16
ThomasH12-Aug-04 9:16 
GeneralRe: "Bad Form" to use public class variables without get & set? Pin
Nemanja Trifunovic2-Aug-04 8:18
Nemanja Trifunovic2-Aug-04 8:18 
GeneralRe: "Bad Form" to use public class variables without get & set? Pin
Nick Parker2-Aug-04 8:48
protectorNick Parker2-Aug-04 8:48 
QuestionHow to change error icon shown in datagrid cells Pin
Kasdoffe2-Aug-04 5:43
Kasdoffe2-Aug-04 5:43 
Generalservices with gui Pin
elraton2-Aug-04 5:26
elraton2-Aug-04 5:26 
GeneralRe: services with gui Pin
Colin Angus Mackay2-Aug-04 8:12
Colin Angus Mackay2-Aug-04 8:12 
GeneralCustom Control leaps to 0,0 on F5 Pin
ddelapasse2-Aug-04 5:26
ddelapasse2-Aug-04 5:26 
GeneralProblem with string.Replace() and antislashes... Pin
polkiujhy2-Aug-04 4:58
polkiujhy2-Aug-04 4:58 
GeneralRe: Problem with string.Replace() and antislashes... Pin
Michael P Butler2-Aug-04 6:15
Michael P Butler2-Aug-04 6:15 
GeneralCuston TrackBar Pin
Guinness4Strength2-Aug-04 4:11
Guinness4Strength2-Aug-04 4:11 
GeneralRe: Custon TrackBar Pin
leppie2-Aug-04 4:16
leppie2-Aug-04 4:16 
GeneralRe: Custon TrackBar Pin
Guinness4Strength2-Aug-04 9:22
Guinness4Strength2-Aug-04 9:22 
GeneralRe: Custon TrackBar Pin
Guinness4Strength2-Aug-04 9:34
Guinness4Strength2-Aug-04 9:34 
GeneralPropertyGrid Pin
blankg2-Aug-04 2:03
blankg2-Aug-04 2:03 
GeneralRe: PropertyGrid Pin
Nick Parker2-Aug-04 3:35
protectorNick Parker2-Aug-04 3:35 
GeneralXml Serialization and Interfaces... Pin
mgaerber2-Aug-04 1:00
mgaerber2-Aug-04 1:00 

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.