Re: C# 3.0 partial methods and automatic properties
Adam Sills <[email protected]> Fri, 10 Nov 2006 13:20:29 -0600
| Newsgroups | gmane.comp.windows.devel.dotnet.cx |
|---|---|
| Message-ID | <[email protected]> |
Can't answer the first one, but the second one is an easy answer: usability. The refactorings in VS2005 have helped rid a lot of the tedious code quite a bit, but wouldn't it be great if I didn't have to go through the unnecessary steps of activating the refactoring. I think a similar point can be made on anonymous methods. They're really not that special (after all, you can create a class, write the method, etc), but they can be so much more usable in certain scenarios. The same is true for ParameterizedThreadStart. Why bother with that, all you need to do is create a little private class that holds your state and contains your thread process method. The ParameterizedThreadStart just made a little pain point that much more usable. Adam.. -----Original Message----- From: Discussion relating to the specifics of the C# and Managed C++ languages [mailto:[email protected]] On Behalf Of Fabian Schmied Sent: Friday, November 10, 2006 12:48 PM To: [email protected] Subject: [DOTNET-CX] C# 3.0 partial methods and automatic properties Having visited a few talks by Anders Heljsberg this week on the TechEd Developers 2006 EMEA, I learned about two new C# 3.0 features I wasn't really aware of previously. The first one is that of partial methods. Unfortunately, I missed the whiteboard discussion where AH seems to have defined what these actually are - can anybody on this list shed some light on this new feature? Is it finally possible to implement the same method in different parts of a partial class, having these implementations being merged into one? Or is it something different? The other thing is automatic property generation - shortcut property declarations, for which the compiler automatically generates a private field as well as getter/setter methods. Anders Hejlsberg said that this feature is actually the one they were asked for the most - why's that? After all, an auto-generated property behaves pretty much the same as a public field, with the only advantage being that you can choose to make it more complex at a later time without having to recompile client code. Is that really so important? Am I missing something? =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com