Saturday, July 08, 2006

Java vs C# .. take 42

I just spent the last few weeks back in the depths that are C# development with VisualStudio. I've spent most of the last year doing Java development in Eclipse (after almost 3 years of C# development at Microsoft) and bouncing back and forth has really called out some of the differences between the platforms and communities.

Lets start with tools: VisualStudio... VisualStudio is a mammoth application, that predates the Java platform. Modern VisualStudio installs are huge and include an immense set of tools and documentation. The downside is that having so much legacy and such a huge feature set, the application no longer feels cohesive. Despite having many of the same features and being more responsive than Eclipse (since it is mostly c++ code), VisualStudio comes across as less modern, less current. Also, strangely, VisualStudio development seems to sap battery much faster than Eclipse development does. The plug-in community is virtually non-existent. I tried to find CVS (and Subversion) support, and found nothing that didn't look like a weekend hack. There is no real community around extending VS, although there are a number of commercial vendors whose products integrate. As VS is a C++/COM app, building extensions is more complicated than extending Eclipse.

Eclipse also suffers from cohesion issues, but for different reasons. The 'perspectives' modalities feels like it creates more problems than it solves. There are annoying pauses as the GC tries to keep up with the UI. The live compilation is amazing, and the run/debug menu is possibly my favorite recent IDE innovation. I find the development environment noisy and the context menus over-busy, but basic functionality is easy to adjust to and amazingly productive. Also, the plug-in community is lively and moderately organized, and as Eclipse is a Java app, extension development is much easier and more productive than VisualStudio. Finally, the CVS support is excellent and the Subversion support is comparable.

One of the big difference I notice between the 2 communities, which is also reflected in the tools themselves, is how open they are. Eclipse is open-source, and actively encourages others to develop extensions. VisualStudio is proprietary and the SDK for building extensions is not well documented. Eclipse is all about anyone and everyone being able to build an extension. VisualStudio is all about companies selling their extensions.

Java's community has included a strong open source trend since before open-source was even trendy. The java community has produced some very strong community sites that support the Java developer. Microsoft's C# platform has never managed to engender the communal spirit that Java has. Part of that can be blamed on C#'s relative youth. Partly it is the result of a general Microsoft attitude to prioritize the corporate client. Eclipse does nothing to stop someone from charging for their extension, but it makes it so easy to build an extension that the bar is set rather high for a commercial entrant. The strong community has also meant that developing an good extension can be an excellent career strategy. Microsoft may have it's MVPs, but I feel that the community just isn't there. Microsoft products aren't designed to make you want to extend them, they are designed to themselves be the end-all-be-all.

The net effect, is that I prefer java development. This surprises be, as I prefer C# as a language, and I find many of Microsoft's libraries easier to use than the Java equivalent. Eclipse just feels friendlier and more open to me. If I didn't already have too many unfinished projects, I'd be contributing to one of the C# extensions. But that is part of the draw, the open-source lure. "Don't like it? Come help make it better!" There are a number of things I'd love to tweak in VS (mostly copying Eclipse) but ... well, I can't. Worse... I really just don't want to. I did some C++ development recently and after spending an evening tracking down a crash related to a typo while implementing a custom resizing array, I came to remember how productive I am in Java and C#. Sure I can write code that has 2x faster inner loops in C++, but it takes me 4x as long to get it all working!

As a close, here is my feature request to the VS team:
- 'run' menu like Eclipse. I often am building cmd-line apps to test an algorithm or library and need to be able to run multiple configurations. I love that this is just 2 clicks. In VS I need to get to the debug properties page for the project and change the args each time.
- Better interactive error reporting (background compile). The C# gives me red squigglies for some things, but it seems that there are still _many_ errors it does not catch.
- Faster build. This ties to good incremental errors. The build should be happening incrementally in the background all the time with only the final link steps happening when I invoke 'build' or 'run'.
- Better help integration. This especially bugs me when I'm developing win32 code. There are often multiple hits for a given keywork, but MSDN picks one and just jumps there. It should give me a choice, and it should remember what I've lookup up recently, so that when I am doing Win32 development, it defaults to the win32 match, and when I start doing C# development it should just start noticing and default to the CLR match. Currently, I can manually do this by selecting the appropriate filter in MSDN, but since I often program in C# during the day and win32 at night (on the same machine), that doesn't really solve my problem.

5 Comments:

Anonymous RichB said...

> - 'run' menu like Eclipse. I often am building cmd-line apps to test an
> algorithm or library and need to be able to run multiple
> configurations. I love that this is just 2 clicks. In VS I need to
> get to the debug properties page for the project and change the args
> each time.

No you don't - simply create a new project configuration, and then it's available from the drop-down combo on the toolbar.

> - Better interactive error reporting (background compile). The
> C# gives me red squigglies for some things, but it seems that there
> are still _many_ errors it does not catch.

VB.Net background compiles.

> - Faster build. This ties to good incremental errors. The build should
> be happening incrementally in the background all the time with only
> the final link steps happening when I invoke 'build' or 'run'.

I don't know how good Eclipse is with this, but VB.Net 2003 was slated for it's poor performance due to the background compile when project size got large.

> - Better help integration.

Some things Microsoft do defy belief. The help system in VS.Net 2005 is an order of magnitude worse than 2003. I can't understand how any team can develop a feature so bad.

11:03 AM  
Anonymous Anonymous said...

Java is far more better than C#..
intentional copy cat c#
C # for Copy cat

4:55 AM  
Anonymous Winni said...

You like the openness of Eclipse but prefer the C# language. This sounds like you should use SharpDevelop instead of Visual Studio...

Check it out: www.icsharpcode.net

1:36 PM  
Anonymous Anonymous said...

only dickheads says java is better than c#. (response to a noob comment seen earlier)

There is nothing like visual studio, its obvious from ur article, u are not even familiar with the VS ide.
Extension? The macro support is enough for you to write most of the extensions that you can only dream in eclipse.

5:01 PM  
Anonymous Anonymous said...

I used to split my time between writing java and ruby in eclipse and C++ and C# in VS. I liked each for it's purpose.

As of late (6.0.1) I have been using netbeans for everything and couldn't be happier. As I write many applications that are cross platform and I develop on multiple platforms, I like having a single IDE that I get to use for whatever I'm doing.

I like that CVS and Subversion (along with local history control) are built right in. I like the editor over eclipse, it feels slightly more responsive for me. The collaboration module has proved to be absolutely amazing for the couple projects I work on with others.

As for language, tool for the job. Only pathetic fanboys and college freshman pick a language and refuse to consider others.

8:34 AM  

Post a Comment

<< Home