Sunday, 11 March 2007

Automatic properties? No, thanks

Scott described a few new features of C# 3.0 a few new features of C# 3.0 on his blog. I'm happy that Microsoft tries
to improve C# all the time. But C# architects needs to be careful as much as possible in order not to overload the language and keep it as clear as possible. The syntax of Automatic properties is very similar to that we use nowadays to declare abstract properties. And this is confusing. I don't see any reason that justifies that move. Since VS.NET 2005 we don't have to create properties on our own. Instead we can just right click and choose Refactor->Encapsulate field. Needles to say that ReSharper supports that as well. Then what's the problem? Please don't change C# towards VB.NET and be as explicit as possible.


  1. We have automatic events (without add/remove) why we cannot have automatic properties?

  2. You landed in the junk folder for some reason. Anyway, automatic events are different because there are only automatic events and nothing that is similar to them. Automatic properties are very similar to abstract properties which may confuse people.