Pet Peeves about each .NET language

by Jose Mojica

Every so often, while teaching either VB.NET or C# a student will pull me aside and ask me, "ok, just between us two, what language should I learn?" Well, I just wrote a book on the differences and similarities of both languages so I start by recommending my book (hey, I've got to feed my family), then I start telling them some of the differences and similarities of both, and how they should really learn both, and focus on the foundation classes instead of the languages.



People are usually satisfied with that answer. But, when I get back home, and the curtains are shut, and the door is locked, and I boot up my machine and anxiously wait for VS.NET to launch, and finally see that New Project... dialog, then what? What language do I really choose?
OK, you are going to accuse me of being a tease, but the answer is I am not even sure which language to pick and I'll tell you why. Each language has things that annoy me so much about them that they keep me from fully committing to them. So here are my main pet peeves for each.



For C#:
Intellisense, uh um, how do I put this, stinks! (I am ommitting stonger words in fear that kids will read this.) I hate how intellisense does not sync-up in C#, and how you have to compile in order for it to finally sync-up. I thought at first that it would not upset me so much, after all a great DM instructor like me (being sarcastic here all you Wintellect lovers) should have System.Runtime.Serialization.Formatters.Binary.BinaryFormatter memorized, but c'mon can't we use up a few more cycles doing a compile rather than parsing in order to get good intellisense? VB does a real nice job at this. Whenever I want to learn how to do something new, I automatically use VB, the intellisense is wonderful.



VB also has a nice feature for overriding methods, and implementing interfaces. Yes I know C# has that implement interface wizard, but it takes about five clicks to get there whereas VB.NET makes interface methods available right away through the editor's toolbar. I haven't found an easy way to override methods from C#. VB.NET lists the methods in the editor's toolbar and all you have to do is select the method and the wizard adds the override for it. I know, you are thinking, Intellisense stops you from using the language, all I have to say to that is use VB.NET for a little while, its intellisense is addictive. And to make it worse, sometimes intellisense in C# makes it look like you've done the wrong thing until you re-compile, so you waste time thinking about how to fix lines that don't need fixing.




For VB.NET:
The main thing that keeps me from using VB.NET all the time is a major shortcoming that is not related to editor features, it is actually a language feature. It has to do with interfaces. When you inherit your class from a base class and the base class implements an interface, it is impossible in VB to re-implement the interface. The only way that you can re-implement a method in an interface is if the author of the base class made the implementation method Overridable. I've already found several cases, with collection classes and remoting classes in which overriding the way the interface is implemented in the base is required and VB does not allow you to re-implement the interface. In C#, I can easily re-implement the interface in the derived class and override only the methods I care about while leaving the base implementation intact for the others. That is nice!



I have other pet peeves but I've run out of time to blog today, so I'll probably list more later.



Tell me what language you've decided to use and why.


1 Comments

jaelerin
2002-06-28 19:22:28
C# intellisense add in
I agree with you that the native intellisense for C# is hideous. However, there is a wonderful add in I've been using for several years. (With the VC++ 6 version, where it is even more needed as VC++ 6's native intellisense is a joke.) It's called Visual Assist. It's availible at
www.wholetomato.com


It's not too expensive, especially compared to the cost of visual studio itself. (I think like $80) The intellisense it provide is wonderful. Even better is the extra source code coloring it provides, plus a number of little other "tweaks" that end up saving a massive amount of time. (Like a "goto" button, which jumps you to the definition of the symbol that the cursor is currently on, Red underlining of undefined symbols, and so many more.)


I HIGHLY recommend it. (I can't function without it anymore, even VB's native intellisense and source coloring seems poor by comparison). The learning curve is almost non-existant (as all good intellisense should be). It's an incredible tool.


Tito