C# and the Compilation Tax

We made the switch from vb6 to .Net about 2 years ago. At the time it was a toss-up between Java and .Net as far as we were concerned. The thing that swung it for .Net was having VB.Net as the perception was that it would be an easier transition. In practice I believe that it allows people to bring along their original bad habits. I would have been happier going straight to C#.

If you want good IDE:s, you should consider switching to Java and check out IntelliJ IDEA and Eclipse. They got what you’re asking for and much more.

you seem to be mixing together “language” and “IDE” in your article

Indeed, sometimes I wonder if they should be considered different things:

a href="http://www.codinghorror.com/blog/archives/000195.html"http://www.codinghorror.com/blog/archives/000195.html/a

am i the only one noticing that this is just a cry of frustration more than a legitimate complaint?
Jeff, you’re a nice guy, but if you have to build an app to check for SYNTAX errors, that just seems lazy. i compile alot, too, but that’s to find runtime errors, or incorrect output.

As far as case sensitivity goes, i’m of that camp that it’s simply personal preference. I’d be nice if that were just a compiler switch, something like “\case”, but i don’t think that would happen any time soon.

Also, i for one have never claimed or even thought that vb.net was equal in any way to c#. i always thought the ‘equality’ was in the fact that they both have access to the same .net framework that all the other languages in .net do. isn’t that what the CLR is all about?

“Over the last four years, I’ve basically given up on the idea that .NET is a multiple language runtime.”

Sorry Jeff but your comments here don’t add weight to that assessment. It rather seems to say “Jeff isn’t a multiple language developer” which is a very different thing especially when part of your rant seems to be that the languages are so different…

The .NET runtime supports multiple languages so people who like language X can move to the .NET platform with relative ease and start taking advantage of it. Maybe they’ll switch to C# later, maybe they won’t but they have the option and can even start small by perhaps making a class library project in C# and adding it to their VB.NET solution.

As for some languages being second-class IDE citizens, a lack of background compilation or the one-language-per-project restriction well these are all limitations of Visual Studio and not .NET itself.

[)amien

I have given up on Resharper, too many bugs and it takes too many resources. Not every company provides top$ machines. I miss some of the features, but when you use 3-4 instances of VS2005 at once, it just gets too costly.

My last job required me to write vb.net, and I did so for 9-10 months. Although I argued heavily against the language, I think it went quite ok. It should be the same but I still feel that the OO programming is lagging in vb.net and the reason for “AndAlso” and “OrElse” is beyond my understanding and so on.

But when all comes down to getting the job done, it doesn’t matter that much in .Net. It is more important how the IDE and the framework act.

but if you have to build an app to check for SYNTAX errors, that just seems lazy.

If you have to rely on a spellchecker to find your SPELLING errors, does that make you lazy, too?

I fail to see the difference between red-squiggly-underline background spell checking, and red-squiggly-underline background compilation checking. (Well, performance considerations notwithstanding)

The best I can do is to repeat what Scott said on a href="http://www.codinghorror.com/blog/archives/000195.html"this post/a:

I am a VB.NET guy so naturally I use VS.NET. I code in VB because thats what makes sense to me personally. With the evolution of the .NET CLR I am glad that VB has finally become the full fledge OOP language that we always knew it could/should be. I refuse to swtich to C# just because its the trendy thing to do. I have always been, and will continue to be a VB developer. Code in whatever language comes naturally to you. Keep it real.
Scott Schecter on January 28, 2005 11:03 AM

I’ve worked for companies which use C# and then I’ve worked for companies which use VB.NET. They both have very happy homes and I’m not sure why the C# people keep attacking the VB.NET people. The fact is that there is DEFINITELY a market for it. There are loads of companies which use it successfully. Mostly what I’ve seen is that each company chooses a language and sticks with it, so the translation between them does not happen so much. The VB.NET IDE has always been better than the C# one anyway.

If they just listen, There is also the XML embedded in the code feature that only VB.NET devs benefit from.

I’ve been using C++ CLI to write managed code and, I have to say, I love the power of freely using either Win32 or .NET calls and the power to intermix managed and unmanaged code anywhere in your source. I’m not saying that doing so is advisable, but C++ does give you that power. You know, that time when you realize that there isn’t a .NET way to do something that the Win32 API offered.

Recently, I needed to write software that made use of some legacy DLLs and also some third party COM/COM+ objects (which came without any type libraries). Neither C# nor VB offered the flexibility of using .NET and doing COM and DLLs at runtime. C++ CLI was, at the time, the obvious choice for me.

An article on MSDN is even titled:
"C++: The Most Powerful Language for .NET Framework Programming"
http://msdn2.microsoft.com/en-us/library/ms379617(vs.80).aspx

@Damien - I think Jeff is talking about how .NET is done in practice. My experience jives with his. Most projects I work on stick to one language and one language only- C#.

The notable exception of course, is DotNetNuke. I’ve done a lot of DNN work and simply write all new code in C#.

Dont want to sound like a broken record. But Eclipse is really the best IDE out there, it has background compilation, which makes refactoring very quickly. With VS2005 I have to sit and wait for 3-4 windows with progress bars to show up after Ive choosen to refactor something. VS2005 is nice if you are making prototypes,etc. But to be productive I would always choose Eclipse over VS2005. I should not even mention the lack of unit testing in VS2005 (yes, it has UT BUT the people that implemented the feature do not eat their own dog food. Check out my blog for more comments about UT in VS2005)

In my eyes Eclipse is made by developers for developers, whereas VS2005 is made by someone else for everyone.

Eclipse is (still) mostly for Java development (except that I use it for Python code also) and I guess C# support is never going to happen.

I read that when you wrote it, and completely disagreed, but that might be because I use Eclipse a lot which supports a lot of languages, so for me there is no big IDE change when I switch to another language. And when it comes down to it, you almost always have choices when it comes to IDE, even if you have to use a specific language.

And to claim a different IDE is like using a different language sounds like saying that a story chiseled in marble is a different story from the same words typed down on a keyboard. Your IDE is a tool, don’t put too much stock into it.

ps.: I liked your comment about case sensitivity. I’d like to see something different in the future: a compiler that automatically adjusts the case of your code. One of the main reasons I prefer case sensitivity in praxis is because it ensures that my variables and function names look the same everywhere. How nice would it be, if the compiler wouldn’t complain about me writing UDPCONNECTOR.BConnected but instead correct it to UDPConnector.bConnected ?

In the spirit of what you said before, that programming languages should be more forgiving, how about starting by auto correcting case. Because really, who ever actually uses the same name for a variable but with different case ? Brrrr.

"Most of the community has settled on C# as the de-facto standard, "

Then why is it almost every .NET job I interview for wants VB.NET? :frowning:

“What’s particularly sad about this is that, in my experience, most C# developers think manually compiling all the time is a natural state of affairs. Well, it isn’t.”

Actually, it pretty much is. How many languages can you name that automatically compiled in the background before VB.NET did it? I can’t think of any… it certainly wasn’t a C, C++ or Java thing and that’s where most of us started anyway. I hit Ctrl+shift+B almost as compulsively as I hit Ctrl+s in MS Word.

Lastly, if C# has a complation tax then VB.NET has a verbosity tax. Anything you save by not using ctrl+shift+b you lose by typing DIM…AS every time you declare a variable. :wink:

I jumped into some Java work in Eclipse about a year ago for a brief period and noticed the background, real-time compilation. I’d just hit debug and it would run instantly.

I always wondered why, if VS is considered the best IDE, that it didn’t provide this feature. Hell, edit-and-continue was in VS 2003 for VB.Net.

I agree with you on the background compilation need in C#.

However, about the “evil case sensitivity”: I don’t agree with you, actually I think it’s excellent. Why?

Well, first of all it’s a good way to ensure a programmer is thorough throughout the whole code. I find insensitivity troubling because in my opinion only sloppy programmers would actually use it.

Second, it’s about code re-usability. So far, 90% of the programmers I met criticize the way another programmer wrote something. Add the case-insensitivity to that and tell me how it helps.

Thirdly, it’s an easy way to impose coding standards. We are already familiar with these kind of standards, i.e. when writing: Capital letters for names , first letter of the first word in sentence,…, other words lowercase,…
Would you write your CV “case-insensitive style” ?

To be honest, I can’t really see the advantage :slight_smile:

Yeah, Resharper definitely eliminates this tax, but I understand the point you’re getting at. If resharper can do it, clearly it can be done, so why not put it in?

Personally though, I’ve taken a different world-view of background compile. I like to be able to bang out a bunch of code, busting out ctrl_shift_b and feeling a great sense of accomplishment when it builds. the squiggly lines distract me. I’d rather be coding while the inspiration hits and not worrying about whatever stupid little thing I typed when my fingers were acting of their own accord until later. /shrug

“How many languages can you name that automatically compiled in the background before VB.NET did it?”

Actually, Emacs had it way before Visual Studio. There has been background syntax checking in Emacs, for multiple languages, including C, C++, C#, XML and Perl, at least since 2003.

http://flymake.sourceforge.net/

I have recently started using C# (been a java and VC++ developer for the last 6 years). I found quite a few things that were strange.

Automatic building, is such a simple, common feature. I am surprised that it isn’t even available as an option in Visual Studio!! Java IDEs have had it since the last 5 years atleast!!