|
|
User Controls
|
New User
|
Login
|
Edit/View My Profile
|
|
|
|
ActiveMac
|
Articles
|
Forums
|
Links
|
News
|
News Search
|
Reviews
|
|
|
|
News Centers
|
Windows/Microsoft
|
DVD
|
ActiveHardware
|
Xbox
|
MaINTosh
|
News Search
|
|
|
|
ANet Chats
|
The Lobby
|
Special Events Room
|
Developer's Lounge
|
XBox Chat
|
|
|
|
FAQ's
|
Windows 98/98 SE
|
Windows 2000
|
Windows Me
|
Windows "Whistler" XP
|
Windows CE
|
Internet Explorer 6
|
Internet Explorer 5
|
Xbox
|
DirectX
|
DVD's
|
|
|
|
TopTechTips
|
Registry Tips
|
Windows 95/98
|
Windows 2000
|
Internet Explorer 4
|
Internet Explorer 5
|
Windows NT Tips
|
Program Tips
|
Easter Eggs
|
Hardware
|
DVD
|
|
|
|
Latest Reviews
|
Applications
|
Microsoft Windows XP Professional
|
Norton SystemWorks 2002
|
|
Hardware
|
Intel Personal Audio Player
3000
|
Microsoft Wireless IntelliMouse
Explorer
|
|
|
|
Site News/Info
|
About This Site
|
Affiliates
|
ANet Forums
|
Contact Us
|
Default Home Page
|
Link To Us
|
Links
|
Member Pages
|
Site Search
|
Awards
|
|
|
|
Credits
©1997/2004, Active Network. All
Rights Reserved.
Layout & Design by
Designer Dream. Content
written by the Active Network team. Please click
here for full terms of
use and restrictions or read our
Privacy Statement.
|
|
|
|
|
|
|
|
Time:
20:41 EST/01:41 GMT | News Source:
Builder.com |
Posted By: Bill Roach |
Builder.com invited some current and former CNET developers, Dan Seewer, Norris Shelton, and Kevin Cobb, to weigh in on the C# vs. Java debate. Does the much-hyped line in the sand between these two languages and their respective platforms really exist? Builder.com: Well, who’s going to take "I like Java," and who’s going to take "I like C#"? Kevin: It’s probably worth saying from the start that we're all big Java users. So from the standpoint of three Java users who are just now starting to look at C#, this is sort of our opinion on what C# is trying to do—good or bad.
|
|
#1 By
665 (64.126.91.172)
at
3/7/2003 9:40:17 PM
|
That's the attitude!
|
#2 By
8273 (4.47.72.198)
at
3/8/2003 1:03:04 AM
|
Next week on C|Net: We will debate which is the better server operating system, Solaris or Windows. Arguing for Solaris will be SUN CEO Scott McNeely, and arguing against Windows will be SUN chief scientist Bill Joy.
|
#3 By
2332 (65.221.182.2)
at
3/8/2003 1:04:37 AM
|
The debate is meaningless. The differences between C# and Java are minimal because they're both simply languages, at least when referenced in this context.
If you instead said debate .NET versus Java, then we could have some fun.
Nonetheless, I prefer C# (surprise, surprise, right?) over Java for several reasons. Many of these should be left out of the debate because they're really .NET-centric advantages, not C# centric... so the short list is:
1.) More elegant and refined event model.
Sorry Mr. Gosling, not everything should be a class. Java's event model is clumsy in comparison to C#'s. C#'s has all the flexibility and none of the bloat.
2.) Properties.
Properties rule. It's as simple as that. Have you ever seen a mildly complex Java class that has lots of member variables? Take the number of member variables, multiply it by 2, and that's the number of methods you now need to just manage those members. It sucks. In C#, you define one property for each, and you're done. Much nicer on the eyes, more organized, easier to use the class, less code bloat.
3.) Indexers.
Another great idea. Simplify access to collection classes by providing a way to access the collection inside that class in an intuitive way. myCarsCollection[2] versus myCarsCollection.Cars[2]. Easy answer.
4.) Explicit declaration of virtual methods.
If I want a method of my class to be available for overriding, I'll say so thank you. In Java, all methods are virtual, and unless you seal your class, there is nothing you can do about it. In C#, you have to mark the method with the virtual keyword to allow for derived classes to override it. That's the way it should be.
5.) Operator overloading.
While some may think this is a minor point, I don't. It's obviously useful and intuitive, despite what Sun says. Ask yourself this: how do you concatenate strings in Java? Wait, with the + operator? That means that Sun felt it was a good idea to override the operator to allow for easy concatenation... but doesn't that contradict what they say the reason for them not including it in Java? Uh huh. Please Sun, let the developer choose, don't choose for them.
Continued in next post...
This post was edited by RMD on Saturday, March 08, 2003 at 01:06.
|
#4 By
2332 (65.221.182.2)
at
3/8/2003 1:04:55 AM
|
Continued from previous post...
6.) Enums.
Case closed. Don't even try to argue. Enums are VERY useful... even a VB programmer knows that! :-)
7.) Parameter arrays.
I love being able to have a variable number of method parameters. A great example of this being used is in the string format functions exposed by many platforms and languages. Things like myString = string.format("Hello {0}, my name is {1}", theirName, yourName);.
8.) Parameter modifiers.
I love being able to say that parameter is by reference, or output only. In Java, there is no way to pass a value type by reference into a method. You must either use an object type, or do it in a return value. For methods that have multiple primitive return types, this is very awkward in Java, but easy as pie in C#.
9.) The @ thingy.
I'm not even sure what this is called, but you can prefix any string in C# with the @ sign (outside of the quotes), and all elements within that string are automatically escaped for you. This is VERY helpful when dealing with large amounts of unescaped text that you already have and you want to embed it into your application. In Java, you would need to go through and escape everything by hand. This sucks!
10.) The foreach statement.
I loved it in VB, and I love it in C#. Makes iterating through a collection of items a lot less error prone and more simple. It's not the best way in all scenarios, but at least I have the option... can't say that for Java.
Obviously, I'm missing quite a few things, but I classify them as .NET versus Java, not C# versus Java. Things like the unified object hierarchy, unsafe methods, attributes, versioning, assemblies, generational garbage collection, multi-language design, structs, code access security, and many others.
A great comparison of the two languages / platforms can be found here:
http://genamics.com/developer/csharp_comparative.htm
My conclusions are very similar to theirs.
This post was edited by RMD on Saturday, March 08, 2003 at 01:09.
|
#5 By
7826 (68.100.63.48)
at
3/8/2003 11:22:28 AM
|
Real man uses C++. C# or Java is for beginners. j/k.
Arguing over a language is pathetic. The real difference lies in the framework underneath. .NET vs JRE, now that is something worth the debate.
|
#6 By
1845 (12.209.152.69)
at
3/8/2003 2:58:12 PM
|
I'm not trying to pick a fight here....
I was thinking about the two debates - language vs language or platform vs platform. Perhaps this is oversimplifying, but I was thinking along these lines - the language vs language debate speaks of the productivity of the develooper while the platform vs platform debate speaks of the performance of the application.
For Windows developers the debate used to be - which do I value more productivity or performance? If you valued productivity more, you'd choose to develop your apps in VB. If you chose performance, you'd develop your apps in C++.
I think if C# enables a developer to be more productive than he would be if he coded in Java, then it is worth taking a look at C# if productivity is important to you. I realize that you have to balance this with performance, so you must also evaluate the execution environment of both C# and Java. I think that both the language and the execution environment need to be evaluated.
Do I have a flaw in my thinking?
|
#7 By
7826 (68.100.63.48)
at
3/8/2003 6:10:19 PM
|
#11,
There probably aren't much (significant) differences between Java and C# in sense of productivity. After all two languages are strikingly similar.
|
#8 By
1845 (12.209.152.69)
at
3/8/2003 11:02:22 PM
|
.NET works all across my Windows platforms. :-)
|
|
|
|
|