Why Code Separation in .NET 2.0?

While Amanda Silver of Microsoft demonstrates code separation through partial types in a clip on Channel 9, I remain convinced that this is solely of use to those creating development tools and frameworks.

It therefore, represents a mechanism well suited to Microsoft's pursuit of a tool (model/factory/domain specific language) dominated development world.

For those few developers remaining who actually write code, its likely to just result in hidden code and confusion.

5 Comments

  • I vote for you!



    I wrote about it several time. it will be great if MS let us the option to touch the main class file code from the secound class they they let us use.

  • Are you complaint about absence of intristic knowledge of framework implementation details also?

  • I think that partial classes are one of the best things that happened to code generation. Modifying generated code has been a problem in the past and partial classes go a long way in solving that particular problem.



    And like it or not, code generation is going to become increasingly popular IMHO...

  • One of the main problems with the designer-generated code from windows forms designers was the vulnerability to random editing. Code as a serialization format is fragile; not really a good format. In my discussions with MS people it is clear that partial classes are only an attempt to hide generated code further, to make it less likely to be edited.



    There is one other use: giant classes that should be broken into multiple files. You may say, that code should not be all in one Type. But for usability of public Types, and performance (less allocated objects) it is sometimes necessary. Witness the windows form Control class, for example.

  • I think it's unfortunate that MS has gone to such lengths to try to make solving common problems easier by creating more IDE/wizards, which his how I take the implementation of partial classes. I don't know about 'yall but I tend to do nearly all of my asp.net programming in code, using placeholders to build up my control hierarchy. I've learned to do this the hard way because trying to do things in the cannonical ASP no-code paradigm simply hits a wall--you have to turn to code at a certain point, and the mixture of stuff on the ASP side and the code side is confusing and difficult to follow.



    One of the things that I appreciate most about the .net way of web development is that you can treat a web app in many ways like a 'real' app (i.e. the event handling paradigm). The more I can program that way, the better and more in control I feel. The smoke/mirrors 'no coding required' stuff rarely solves the kinds of tasks I'm assigned w/o getting into underlying code.



    All this to say that I wish MS would push the professional development curve instead of trying to make it 'easy'. .NET is the most powerful of the web languages, IMO, and should exploit that end of the market, not the lower end. If I wanted easy (and not professional or powerful), I'd use Coldfusion ;0)

Comments have been disabled for this content.