On 8/5/05, Leon Rosenberg <[EMAIL PROTECTED]> wrote:
> On Fri, 2005-08-05 at 07:18 -0600, Larry Meadors wrote:
> > You don't see it?!? Have you looked?
> >
> > As a self-professed Java bigot, I will readily admit that C# has a
> > *way* better sytax for defining and using properties that I wish Java
> > would implement (or even better - improve upon).
> >
> > public string MyProperty {
> >       get { return myProperty; }
> >       set { myProperty = value; }
> > }
> >
> > Now, instead of:
> >
> > someValue = foo.getMyProperty();
> > foo.setMyProperty(someValue);
> >
> > ...I can do this instead:
> >
> > someValue = foo.MyProperty;
> > foo.MyProperty = someValue;
> 
> 
> It looks better ... on the first glance.
> How do I distinguish if
> foo.MyProperty = someValue;
> is going through a setter or not (without looking into the code)?
> 

Who cares? is opacity not the point of Object Oriented-ness?

My argument is just the opposite: With C#, I can add a field, and
encapsulate it later with this syntax, can you do the same with
getProp/setProp pairs? No.

Score one more for the C# kids. In this realm, C# is clearly superior.

Larry

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to