Developer

C# vs. Java: Debate the difference

CNET developers join the debate over the differences between C# and Java and what that means, if anything, for a developer's career. Join the discussion and add your two cents' worth.


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. Dan has more than 17 years of experience in software development, including Perl, C, Java, and C#. Kevin has more than five years of experience and is a Sun-certified Java programmer. 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.

Norris: We can probably justify our opinions, and they’ll be true. C# is much closer to Java than it is to C++. If there’s something in Java, there's something similar to it in C#, and vice versa.

Dan: And to me, [Microsoft] looked at C++, and they kind of went down the C++ aisle and said…

Kevin: What can we pull back?

Dan: Yeah, what can we pull from the other setup that we think will attract and bring over C++ users?

Kevin: What strikes me when getting into C# is that it’s more like people wrote this to see what kind of bells and whistles and flashy items they could throw into C# to make it attractive—not to actually make it a better language. Maybe that’s unfair….

Dan: No, I think that is true.

Norris: I mean, they have C++, and then they had Java. And certain things were taken off C++ to make Java easier.

Dan:  Right. And then if some [C++ folks] don’t like it, they see these changes in Java as walls.

Norris: I would say that doesn't necessarily apply to people who use Java, because if you use Java, you don’t feel hindered by anything.

Dan: Right.

Norris: But some people who don’t use Java see all walls. If I'm a C++ programmer, and I don't want to learn Java, and I took C# up, well, [Microsoft] added some more things back, but in some cases, they just added complexity. Like indexers—that doesn’t give you anything that you didn’t have. [Java programmers] don’t feel a loss for that, but I’m sure there’s added complexity because of it.

Dan: It’s the same deal about operator overload.

Norris: Right.

Dan: You bring operator overloading back into the mix, which is a big C++ thing. I used it when I was coding in C++, but I always felt that it made things more complicated than they needed to be because you're looking, you see a plus or minus, and you have to look at it and see what the variables were. "Okay, are those variables objects?” They are objects. Now I’ve got to track down the actual method, the overload that took place. If you came into something that you didn’t write, you were kind of left high and dry.

Norris: Yeah. Here’s how that's a problem: I'm reading Programming C# (Second Edition), which notes that, “If you do this in C#, and you want this library to be used by someone in VB, you’ve got to do it this other way, which is about equal." That's because VB, even the new VB.NET, won’t do the operator overload. It's an issue because if they try to use your library, it won’t work since VB.NET won’t let them do that.

Builder.com: So, you’re saying that they’ve added things into C# that doesn't make it cross-compatible with VB.NET, even though both are .NET languages?

Norris: Yes. They're all supposed to obey the common language runtime (CLR), yet C# has its own thing where you do operator overload, and you can’t do that in VB.NET. So if you tried to use those objects, which VB.NET does let you use because it is in the CLR, you can't use that library right there, that function, because it won’t work.

Dan: This is with your C# function?

Norris: Oh, yeah.

Dan: See, I'm reading .NET Development for Java Programmers, and it includes a chapter comparing Java and C#, but it wouldn’t cover those sorts of issues with VB.

Builder.com: Well, you're all Java programmers. Why are you running C#?

Norris: It’s not that we’re Java programmers; we're Java programmers in Louisville, KY, and in Louisville, there aren’t enough Java jobs.

[Laughter]

Builder.com: But there’s a logical appeal to it other than just "other people use it" and "for employment reasons."

Kevin: The way I look at it, we're Web developers. That’s what we’ve chosen to do. So I’m interested in learning any tool that has to do with Web development, and C#, .NET, Java, and JSP are all Web development. If I leave here, I’m hoping it's going to be for another job in Web development, so I make myself more marketable by at least familiarizing myself with C#, .NET, and that type of stuff.

What debate?
Do you think that the debate between C# and Java is overrated? Post your comment below or drop us an e-mail.

 

Editor's Picks