• Welcome to Computer Association of SIUE - Forums.
 

If you program with C# you should read this.

Started by EvilAndrew, 2004-03-05T10:44:26-06:00 (Friday)

Previous topic - Next topic

EvilAndrew

Read all about the changes here.

Microsoft is adding some things to the C# IDE and the language itself.  

Likes:
Generics - I hate having to cast back and forth from Object and it is inefficient.  Generics are C#’s implementation of c++ templates but they have extra type-safety features that c++ templates don’t plus the IDE handles them better.

Static Classes â€ââ,¬Å" You could already create â€Ã...“Staticâ€Ã, classes in C# but you had to do it yourself.  Now there is a language facility.  This is mostly just a convenience, but it does allow compiler errors to be generated if you accidentally misuse a static class.

Refactor â€ââ,¬Å" One thing I like about Eclipse that was missing from Visual Studio is the ability to make sweeping changes to large bodies of code with risking catastrophe.  The Refactor command allows for changes to be enumerated and confirmed before actually performing them.

Expansions â€ââ,¬Å" I love auto-complete.  Expansion is an interesting addition to auto-complete that allows for code generation.  The example they give it a template for loop that is generated in place when you type â€Ã...“forrâ€Ã,.  You can read the article to see how this is done in a convenient way.


Dislikes:
Partial Types â€ââ,¬Å" Allow a single type to be partially defined in several files.  For example you could have the constructor in one file and the destructor in another.  If developers start to use this themselves it could get ugly.  MS says they added this feature to allow code generators like the Form Designer in VS.NET to put their code in a different file from user code.  I think that this might be a good thing, but it gives them the ability to forbid developers from interfering with the Form Designer when they see fit.  Sometimes I fiddle with the generated code, and I like the fact that Visual Studio has been written to accept my changes.  With this separation they might just as well overwrite them the next time I use the generator.

Anonymous Methods â€ââ,¬Å" Java did something called inner-classes that was similar to this and it was confusing as hell.  The problem is that variable scope is baffling for classes defined inside of methods of other classes.  I like the delegate patter that .NET languages use, but this might just be taking it to a place it should not go.  I will have to wait and see how hard code written with these is to follow.
......