Link Details

Link 78600 thumbnail
User 284025 avatar

By jexenberger
via dotneverland.blogspot.com
Published: May 01 2008 / 10:17

Things Java can take from .Net
  • 12
  • 20
  • 5184
  • 0

Comments

Add your comment
User 111696 avatar

bloid replied ago:

1 votes Vote down Vote up Reply

I look forward to a "Things I like in Bacon that I miss in Salad" article...

NB: I am not saying Java or .NET is either bacon or salad, but that they are different things... Why do people want everything to be identical, of have all the features of everything else... How boring a world would be...

Maybe a better sarcastic response would have been "Things I like in French that I miss in English", then you could have stuff like:

1) Accents
2) Objects having a gender

etc

User 205784 avatar

cbegin replied ago:

0 votes Vote down Vote up Reply

Bloid:

I don't think comparison is without its value. I think comparing JSE/JEE to .NET and Java to C# is a perfectly valid comparison for one big reason: many Java developers don't know what they're missing (and likewise, many C# developers may not fully understand the value of Java for example).

Comparisons are a way to drive interest in a new or different technology. Otherwise people may just stick their head in the sand of The Java Desert and never grow as developers.

That said, I'm surprised this guy only posted 5. I'd have a hard time choosing 5 things about C# that I like better than Java. Furthermore, I'd find it hard to choose more than a few that have any good reason for NOT being implemented in Java....

It's really quite ridiculous how far behind Java (JSE+JEE) has fallen. I feel bad for developers who have never looked outside of their purple coffee cup, and envy them at the same time. Ignorance is bliss.

Clinton

User 210207 avatar

karaznie replied ago:

0 votes Vote down Vote up Reply

Ok - I know a lot things that are better in .NET than in java, but above are just radiculus. Guy!, clear leadership? You mean dictatorship? Do think that having one, single dictator like Heilsberg is good thing! Oh man, java developer fought for years to free java from the single SUN umbrella - and, last Year, with java being GPLed we finally achieved it. Before java community established JCP just to *overcome* single person leadership. I respect Heilsberg, but, c'mon dou You really think that what he says is the only right way to solve things? I actually like the situation where we do discuss alternatives - like closures. You know is little bit like comparing comunism (where I used to spend my childhood - so I know what it's all about:) with democracy. Believe me, nobody invented anything better so far, though nobody says democracy is the best thing uder the SUN.

About overriding operators. I'm completely against it - having 10+ in professional C++ development experience I can live without it perfectly.

User 205784 avatar

cbegin replied ago:

0 votes Vote down Vote up Reply

>> Do think that having one, single dictator like Heilsberg is good thing!

Yes. We're not talking about a country or human rights here. This is software. And in this case, having a single unified vision is not a bad thing. Calling Anders Hejlsberg a dictator is just childish and insulting. He is a fantastic leader and steward of the language. And he's brilliant too.

If you need ANY proof whatsoever:

Compare C# attributes to Java annotations.
Compare C# generics to Java generics
Compare C# delegates to anonymous inner classes
Compare C# namespaces to Java packages
Compare C# "autoboxing" to Java autoboxing
Compare C# assemblies and versioning to Java JAR files (and soon modules/OSGi)
Compare C# properties and events to JavaBeans (bring tissue to wipe your tears)
Compare C# extension methods to Java static imports (!!!?)
Compare C# reflection to Java reflection (two words: parameter names)
What about simple things? Multiline strings? Throw me a bone here...

Should I stop? What have you got?

I'll take an intelligent leader who judiciously listens to customers and builds an effective team over an ineffective "board" any day.

Clinton

User 210207 avatar

karaznie replied ago:

2 votes Vote down Vote up Reply


Thanks God Your're not mentioned Enum's there...

>Compare C# attributes to Java annotations.

What's wrong with annotations? At lease in java it is possible
to have annotation on annotation itself...

>Compare C# generics to Java generics

They, at least preserve backward compability.

>Compare C# delegates to anonymous inner classes

What's wrong with anonymous inner lasses vs. delegates?

>Compare C# namespaces to Java packages

What's wrong with this? Beg to explain?

>Compare C# "autoboxing" to Java autoboxing

Again - whats wrong with this?

>Compare C# assemblies and versioning to Java JAR files (and soon modules/OSGi)

Sure let's compare.

>Compare C# properties and events to JavaBeans (bring tissue to wipe your tears)

The properties is, in my opinion the single ugliest features I've ever seen. I like
to be explicit. If something *is* function it should have function semantics.

>Compare C# extension methods to Java static imports (!!!?)

Java doesn't have comparable feature - like c# doesn't have static import...

>Compare C# reflection to Java reflection (two words: parameter names)

>What about simple things? Multiline strings? Throw me a bone here...

Using any decent IDE I've no problems with multiline strings. Do You have?

Look, as I said - in some areas c# is clearly ahead of Java. But talking that's because of single
person - it's ridiculous...

User 205784 avatar

cbegin replied ago:

0 votes Vote down Vote up Reply

First, you read a C# 3.0 book. Then we'll talk, I promise. There's no point in us discussing it until you can at least answer those questions for yourself. Those are just the basics.

Clinton

User 210207 avatar

karaznie replied ago:

0 votes Vote down Vote up Reply

What for should I read C# book? I will not use C# in the future I see - and have a lot beter books to read :). I asked simple questions and would expect reasonably simple answers, if You disagree - we can discuss then. You know you just listed few points, and nothing more. Some are true, for sure - but, with others I can and have discuss. I should not read C# 3.0 book to know that properties, operator overloading are bad things. Also disagree with some other points - for instance how delegates are better than inner classes - it's mostly matter of a taste.

User 205784 avatar

cbegin replied ago:

0 votes Vote down Vote up Reply

You should read the C# book so that you CAN discuss it. How are you going to discuss these points when you're completely unfamiliar with them? You know who I am. Drop me a line if you feel like discussing it after you have some exposure to it. In the meantime I'll try to get a blog post up that directly compares these points that I've laid out. This message board isn't designed to host a debate.

As a side note, you should learn other languages even if you don't intend to use them. Learning C# and Ruby has made me a better Java developer.

Clinton Begin

User 281050 avatar

cbang replied ago:

0 votes Vote down Vote up Reply

I don't see how they are much different. Nevermind that .NET focus on interoperability while Java focuses on platform independence, other than that, they are both general purpose, managed OO languages! There are more similarities than differences, especially as Java the past years slowly are becoming feature complete with C# (Enum, vararg, annotations, closures etc.).

,
,
,

User 205784 avatar

cbegin replied ago:

-1 votes Vote down Vote up Reply

>> Java the past years slowly are becoming feature complete with C#

The devil is in the details here. Compare the actual implementation of any of these features (with the exception of enum perhaps), and you'll see that Java is far, far behind C#.

BTW: For anyone who thinks I'm a C# pimp, I'm not. I'm a full-time Java developer of 10 years. A disappointed one for the last 4 years, where at some point Sun ran out of money or the will to compete... or something. ;-)

Clinton

User 281050 avatar

cbang replied ago:

0 votes Vote down Vote up Reply

Clinton, you don't have to convince me. You are right in every aspect. I've pointed these things out for years and as you may know, all it does in the community is earn you the brand as a troll. I LIKE Java, but to anyone who actually worked with both, C# very much is "Java done right". I don't know what it is about the Java community, but they appear to be very much in love with themselves. And Microsoft is of course pure evil, who's technology isn't even worth looking at according to many. And the closure controversy appear to be stealing focus away from everything else that we could wish for Java 7.

User 205784 avatar

cbegin replied ago:

1 votes Vote down Vote up Reply

Luckily the Java devs don't have to love C# to see what they're missing. They could also look to Groovy or Ruby. I think Groovy is Java done right and is possibly better than C# in many respects (especially the fact that it's dynamic --- see Groovy-WS for applicability).

Groovy just needs to be a bit faster. I'm willing to eat a 3x - 5x (fixed or linear) price for a dynamic language. But currently I think it can be far worse. For a some apps (SOAP clients) I'd eat whatever the performance cost is no matter what. :-) But as a language, I really like Groovy (optional typing is important).

This is yet another area though, where we see Microsoft responding to customers and trends far faster than Sun. Microsoft has released a special runtime specifically for dynamic languages like Python, Ruby and even VB! Where's ours, Sun?

Clinton

User 281050 avatar

cbang replied ago:

0 votes Vote down Vote up Reply

Sun is busy making yet more fancy RIA demo's for their JavaOne marketing show. They do have the Da Vinci Machine project (http://openjdk.java.net/projects/mlvm/) and an invokedynamic instruction on the table, but I get the feeling that Sun is afraid to touch the JVM and would rather build languages op top of what they have and expand on tool support - which we've seen with NetBeans over the last couple of years.

User 246736 avatar

jlawmi replied ago:

0 votes Vote down Vote up Reply

I have 10+ years in java land, and admit I drool for a lot of features that are in the latest C#...
type inference... the "partials"... the ability to put long strings in source code... closures.. java is falling behind...If c# had spring 2.5 and hibernate 3.2 I might just jump ship...

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Debugging JavaScript
Written by: Ashutosh Sharma
Featured Refcardz: Top Refcardz:
  1. Design Patterns
  2. OO JS
  3. Cont. Delivery
  4. Java EE7
  5. HTML5 Mobile
  1. Java EE7
  2. Spring Annotations
  3. Git
  4. Java
  5. REST