"Prepare to be assimilated.... Resistance is futile."
- Borg, "Q, Who?", Startrek: The Next Generation
Why should a Java developer switch to C#? Here are the major reasons in alphabetical order:
1. "C Style" memory access
Rather than forcing developers to write code to access application programming interfaces (APIs) in other languages in order to access specific memory locations (e.g. hardware-mapped memory), C# allows developers to use "C style" memory management and pointers when necessary. Of course, one of the major design goals of the Java language and other object-oriented languages is specifically to outlaw such access. A fact which Microsoft acknowledges by forcing the C# programmer to label such accesses with the unsafe keyword.
2. Extensions for component-oriented development
Visual C# provides developers with a powerful component-oriented development language that includes support for properties, indexers, delegates, inheritance, versioning, and attributes, without the need for esoteric or rigid naming patterns and companion classes.
3. Familiarity
Java developers will immediately find Visual C# to be familiar and comfortable. C# is like Java on steroids. There are some extra keywords; and, Visual C# supports some extra constructs. But, a Java coder can learn the C# language in a day or two. Learning the APIs is a different matter.
4. Interactive XML Web services
Visual C# allows developers to deploy and consume rich, interactive XML Web services that reduce development time by enabling software aggregation from any platform. Microsoft is famous for hiding the details from the developer: This is both good and bad. New developers may not actually know or understand what is going on under the hood. On the other hand, it does increase productivity. Of course, Java developers have a variety of IDEs such as Eclipse to choose from. All of which provide some degree of support for Web services.
5. Leverage the .NET Framework
Visual C# provides developers with access to the Microsoft .NET Framework--a robust, thread-safe library of collection classes, data access classes, networking functions, etc. Recently, however, various bridge software offer .NET access from Java programs as well as access to the rich Java libraries from .NET languages.
6. Object-based type system
Visual C# provides developers an object-based type system that eliminates the need for complex, verbose data marshalling code commonly required by Java applications.
7. Standards-based language
Visual C# provides developers with a standards-based language (ECMA) with all its advantages. This is a significant advantage over the Java language.
8. Target any device
Visual C# lets developers target desktop computers or a variety of handheld and wireless devices using identical tools and skills. True, but all the devices must be Windows based.
9. Visual Studio .NET IDE
Visual C# provides developers with the Visual Studio .NET integrated development environment (IDE) which includes support for task lists, property editors, Microsoft IntelliSense®, Forms designers, etc. For development on Windows platform, Visual Studio is king. However, Visual Studio lags Eclipse and other IDEs except in Microsoft-specific features.
10. XML comments
Visual C# allows developers to use eXtensible Markup Language (XML) Comments to provide useful and customizable source code documentation. Of course, so does Java although Microsoft does add its own twists to it.
Conclusion
A form of this top 10 list originated with Microsoft. But, because both Java software and Visual C# evolve competitively, non-Microsoft oriented features tend to be matched by each competitor in turn. There is no real reason to use Visual C# instead of Java in general; because, each has its own advantages and disadvantages which may or may not be important in specific situations. Unless you work in a Microsoft-only shop, the requirements of the project should dictate both the language and other software employed.
"Ducunt volentem fata, nolentem trahunt." - Seneca

Rajesh SharmaPosted Oct 14, 2006, 6:16 AM
Hi I am a student of Computer Science who is ready to enter the world of IT industry. I am doing MCA and at present I am in 5th Sem. I had got a job in a company to which I am going to join in January 2007. I started learning C# and I liked it very much. Actually I am very much impressed by Microsoft Technology's. My question is that in future what is the scope of C# and what role C# is going to play in the world of IT and particularly in the development of applications. Also at present C# and .NET applications run only on Windows Platform , so how to run .NET applications on platforms other then Windows, is there any framework being built which will enable C# applications to run on other platforms too inorder to achieve complete platform independence? Thank you
Ran KornfeldeditedPosted Jun 4, 2006, 4:15 PMEdited Jun 4, 2006, 4:17 PM
I am a long time Java developer who has just moved to .NET and C#. I must say that I do not agree with all of your points. Although I do not have much experience with C#, I can name a few things that Java just do better, for example: enums - in Java you have better control over your enums, which enables you to add methods, constructors and fields. Javadoc - XML docs are nice but Javadoc just seem easier to use. IDEs - you can't compete with the amazing FREE java IDEs that are available today and their power. I must say that IntelliJ and eclipse are better than Visual Studio. Why do you say the C# is standard and Java is not? I didn't get this one... I did find some great stuff in C# that can just make you smile: The great @ symbol before strings that eliminates the escape characters The #region and #endregion markers (how come no one thought of that before) Great use of attributes (Java annotations) for all kind of things partial classes!!! and some more.. Ran.