Argh - I can't believe I fell for it
-
"A property or indexer may not be passed as an out or ref variable" Oh C#, what are you doing to my C++ mind. I know better but I tried to do this anyway. :doh: :-O Properties seemed so cool (for about 2 minutes). My brain is turning to mush mush with all these poorly conceived abstractions.
-
"A property or indexer may not be passed as an out or ref variable" Oh C#, what are you doing to my C++ mind. I know better but I tried to do this anyway. :doh: :-O Properties seemed so cool (for about 2 minutes). My brain is turning to mush mush with all these poorly conceived abstractions.
Properties ARE cool, because they save you writing a get method, or allow you to easily write code based on a variable changing. In fact, some things won't work with a variable and will only work with a property. BUT, C# is a strain on the C++ mind at first, no doubt about that.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Properties ARE cool, because they save you writing a get method, or allow you to easily write code based on a variable changing. In fact, some things won't work with a variable and will only work with a property. BUT, C# is a strain on the C++ mind at first, no doubt about that.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
Christian Graus wrote:
because they save you writing a get method
Properties are get/set methods, just with a confusing syntax.
-
"A property or indexer may not be passed as an out or ref variable" Oh C#, what are you doing to my C++ mind. I know better but I tried to do this anyway. :doh: :-O Properties seemed so cool (for about 2 minutes). My brain is turning to mush mush with all these poorly conceived abstractions.
Everything that Christian said...and I've explained to a psuedo-programmer customer once when they asked why duplicate effort with properties that not using properties is like having a daughter being taken out on dates without your knowledge. In this case, your class variable is your daughter. It is a very bad idea.
-
Christian Graus wrote:
because they save you writing a get method
Properties are get/set methods, just with a confusing syntax.
Duh. Therefore they save you having to maintain a variable and a seperate method.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Duh. Therefore they save you having to maintain a variable and a seperate method.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
Well, automatic properties do that, which is nice. Properties themselves can still have a get/set method and you'd likely want to use a private variable. The difference is that it saves the caller from having to call a get/set method... they just have a single property they can use instead.
-
Well, automatic properties do that, which is nice. Properties themselves can still have a get/set method and you'd likely want to use a private variable. The difference is that it saves the caller from having to call a get/set method... they just have a single property they can use instead.
Yeah, but even then, your get and set were together, instead of just being methods in the general stew of things. whne I started C#, I was horrified, b.c foo.bar = 3; was no longer an operation with known costs. Who knows how much code you're executing when you do that ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.