C# and the Compilation Tax

Unfortunately, I work in a place that prohibits the use of C#. So we use VB.Net.

And I don’t have the luxury of changing jobs just to use a certain skill-set.

But, we are also not your standard programming house. We write lots of small utilities and report tools for a hospital. shrug

If the language keywords are ASCII, why not restrict the identifiers (variables and function names, etc) to ASCII as well

I realize it’s an edge case, but…

Having spent several years teaching programming in Cambodia and Uganda, I am thankful that C# doesn’t restrict identifiers to ASCII. Programming in .NET is a real possibility for the billions of people who don’t speak English, precisely because there are only a handful of English keywords to learn.

We use ReSharper where I work and it is extremely helpful with one exception. It is absurdly slow! It slows down Visual Studio a lot in my opinion, but I love its features, so I continue to use it.

I think the root cause of the issue is that you’re a weak-minded baby who is upset that you can no longer make do with the pablum that is VB. Background compilation is not a language issue. Stating that case sensitivity is a “religious issue” is a nice way to cover up for the fact that you’re basically whining about having to change. Did you while all through school when some poor lecturer wasted his time trying to teach you functional programming? Why not just title this post “I’m Narrow-Minded” so people have a better idea of the basic thesis?

This is a comment about both the article and the other comments.

Yes, developers are religious about what they use, however, as one of your last articles stated, there isn’t any real Microsoft “fan base”.

That makes me wonder why I keep constantly hearing that Visual Studio is “the best IDE”. I tried it (C#, Visual Studio 2005) and although I really gave my best to stay fair and don’t judge it based on specific features I had in other IDEs that were missing in VS, the OVERALL experience was more than disappointing.

Aside from the bad code completion, lack of refactoring tools as well as code inspection, I was impressed by it’s ability to actually mark a class as good when it contained obviously invalid method calls and made the compilation process break.

I’m a Java developer and have been using IntelliJ IDEA for years. It beats VS is nearly every aspect - and I never encountered a situation where IDEA said a class was OK but didn’t compile.

Although I might start a flame war: VS is nice compared to coding C in VI, but it definitely isn’t the best IDE.

My biggest complaint with C# is its very very strong typing. I’d like to be able as a programmer to be smarter than the compiler and allow me to use an object that I know has these methods/properties even it the compiler doesn’t. A perfect example of this is if you are doing Office automation. If you reference the excel libraries in you C# application you are locking the client into having that version of Excel. I program all of my Office automation in a separate VB class so that I can late bind the objects.

Eclipse is really the best IDE out there

I strongly suggest you try IntelliJ IDEA.

the best IDE:

Visual Studio
Eclipse
IntelliJ

Come on guys, which is it???

Case insensitivity allows me (and I suspect most others) to have similarly named private variables as their accessor methods. What I hated about VB was that you couldn’t do this, nor could you prefix variables with an underscore.

What C# means to me is that I can undo 6 years of bad habits forced onto me by an inflexible language. Just as I was forced into learning VB to get a job, the VB programmers are having to learn another language in order to stay relevant in the industry.

Case in-sensitivity is bad when a sloppy code writer cannot keep the casing consistent in their code.
Case sensitivity is bad when two variables are different because of casing.

Makes sense to me to flag both as errors…
one to force consistency,
the other to flag two items as too similar.

As with any language to hang yourself, these should be warnings…

Or will you be writing about the USELESSNESS OF COMPILER WARNINGS next?
(hint hint)

I have to agree with most people who’ve posted comments. The background compilation in VB is annoying, it will highlight things and distract me while I’m still typing a line.

IMHO it’s a crutch I will gladly do without (same thing with case sensitivity).

Put another vote up for “no background compilation”. Anyone who wants VB background compilation has never worked in a solution with more than 5 or so VB projects. Period. We got to the point where it was IMPOSSIBLE to develop in the solution that held all of our projects. I spent days looking for ways to turn background compilation off because it costs me so much time in daily development, just waiting and waiting for the IDE to respond.

As someone who has developed large scale (~20 projects) solutions in VB and C#, I can attest that no developer in their right mind would choose to be subjected to the kind of torture it is to develop in VB.NET with large solutions. It’s not just difficult, it’s not merely annoying, it’s flat out impossible. Unfortunately, by the time we got up to the ~20 project level, it was far too late to switch to C#.

Background compilation is nice for small solutions, but ReSharper does it 10 times better for C#. So be kind to your developers, choose C#.

To me case sensisitivity makes things much more readable.

getMethod() as opposed to getmethod()

I cannot understand someone disliking case sensitivity. And yeah, I am a C guy.

I always get a kick out of the Mac-vs-PC holy war that VB vs C# has become. I am an old VB6 developer, moved to ASP, then to VB.NET and ASP.NET in VB. I never really felt the need to move to C#. Yeah, there are a few things that C# can do that VB.NET can’t do, but those things are NOT the bread and butter programming that pays my bills. I can write C# as well, but I can’t see paying the 25% verbosity tax. When I spend a day working in C# my hands just ache from all of the extended shift typing. It’s not nearly so bad in VB.NET. And if I need to incorporate C# code into my project then I can do so, or I can run it through a C# to VB converter. I don’t need to grok the imported code, that is why it is imported code. If it does what it says it will do, I don’t need to open the hood.

I would rather that MS let you mix C# and VB.NET code together more closely in the p-code than worry about pushing the expiration of a language that (good or bad) has eased the learning ramp for many programmers. Heck, even the accountants are using VB as their Excel macro language. Do you think they would write custom macro functions if they had to learn C# first?

Jeff,
I am curious. Do you have experience with large VB.NET solutions and projects? If so how did the size of the solution and projects effect performance of the IDE? If you experienced slow performance what did you do to address the situation?

In my experience VB.NET is crippled by the background compiler. It is relegated to solution/project sizes that your hardware does not puke out on. I am sure that C# has limits as well. The point is that I know, expect, and control when I will pay that performance hit by telling the IDE to compile.

I think that both C#'s and VB.NET’s offering on this stink. They are both extreme. There is a need for intelligent autonimous compilation. Notice I did not use the word background as the background compiler is a hog.

Think about having Norton Antivirus and a VB.NET solution of 600KLOC. The IDE will crawl at best. Try watching it in ProcessMonitor. You will be amazed at the # of IO operations.

What about C++/CLI? Not that I’d endorse it or there’s a huge gap between C# and C++/CLI but still…

I swear by Resharper now its a great tool.

Also once the ruby.net compiler is really up and going with ruby on rails support then i think it will become a two horse race. Not just C# but c# and ruby.

It’s fascinating to me how people post with no idea of what they’re talking about.

Case-insensitivity in a language does not mean that you can type

int banana = 3;
Banana = 4;
bANANA = 5;

It means that when you type that, the IDE will correct your code to

int banana = 3;
banana = 4;
banana = 5;

This is what VB .NET does. I find in these discussions that an extraordinary number of C# programmers rip on VB .NET despite having never used it, and having absolutely no idea what it can and can’t do.

(As for me, I use both. Generally at home I try to use whichever one I’m not using at work.)

@Martin Vilcans:

If only it were as easy as “switching to Java.” If you write software for customers, you’re going to write in whatever language(s) that customer supports. If they’re a .NET house, then you’re not writing in Java, whether or not that’s your preference.

Furthermore, taking a 250,000+ line mature application and just “switching to Java” involves costs that no one wants to pay, and which could never be justified because “the IDEs are better.”

“Switching to Java” might be easy for hobbyists, but those of us who put food on the table by doing custom development for large companies simply can’t mandate those sorts of changes for personal convenience.

C# or VB.net? Coding for .NET. What are the member functions for this class, and what are their arguments?. Compilation tax for programming in C#.

I say to heck with it all, and just program everything in Perl.