Slashdot Mirror


Java 1.5 vs C#

SexyFingers writes "Sun released Java 1.5. The non-API stuff that they've added made it finally "catch-up" with C# - since both languages are built to support OOP from the ground-up, their constructs become almost identical as additional OOP "features" are supported. So if you're doing C# and your foundations in OOP are rock-solid, there really isn't any difference whether you're coding C# or Java."

Here's the list of enhancements to the Java Language:

  1. Generics (C# 2.0 already supports this)
  2. Enhanced For-Loop (the foreach construct in C# 1.0, duh!)
  3. Autoboxing/Unboxing (C# 1.0 already has this, everything is an object, even the primitives - not really, but they do it so well...)
  4. Typesafe Enums (again C# 1.0 already implemented this, but I think they've added a little bit more twist in Java, that its actually a better implementation)
  5. Varargs (C# 1.0's params construct, ellipsis construct in C++)
  6. Static Import (I don't know if C# 1.0 has this, or C#2.0, but C# has a construct for aliasing your imports - which is way cooler. Static Import, actually promotes bad coding habits IMHO)
  7. Metadata/Annotations (this is C# 1.0's Attributes, Sun's upturned noses just gave it a fancier name - also, C#'s implementation is better and more intuitive)

They've beefed up the API some, and integrated several packages with the regular JSDK that used to be a part of a separate package or installation ---in my NSHO, the Java API has become bloated...

At this point (even before Whidbey) the deciding factor (as always) for Enterprise work, when choosing a language platform, should be the support it has behind it, in terms of IDE, tools, api, and longevity of the vendor pushing it (forget the OpenSource crap argument, those guys are too in love with Perl, Python, and Ruby - Java could become the child nobody wants to talk about if Sun dies) - right now that's C# and the .NET Framework ---

If you ask Paul Graham though, both language would be utter crap and fit only for idiots :) http://www.paulgraham.com/gh.html [I'm exaggerating, so hold off on those flames.]

5 of 790 comments (clear)

  1. supported overtime? by gregarican · · Score: 0, Offtopic

    Does this mean the code developers get paid for working overtime?

  2. If sun dies... by johansalk · · Score: 0, Offtopic

    IBM will then pick it up... it's so clear.

  3. Obligatory by DrSkwid · · Score: 0, Offtopic



    object-oriented design is the roman numerals of computing.

    -- Rob Pike

    others

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  4. Re:All in it together by counterplex · · Score: 0, Offtopic

    Best.. sig.. in a long time!

    --
    $x = ($x * 10) % 10 >= 5 ? 1 + int $x : int $x
  5. OT: by SirTalon42 · · Score: 0, Offtopic

    Before I found out it was 'C Sharp' I thought it was 'C Number'.