Geeks With Blogs
INETA Pakistan Blogs Home of INETA Geeks

 

J2SE 5.0 specs are out. And you know what Java 1.5 has tried to catch up with C#.
Java 2 Platform Standard Edition (J2SE) 5.0 ("Tiger") is the next major revision to the Java platform and language; it is currently slated to contain 15 component JSRs with nearly 100 other significant updates developed through the Java Community Process (JCP).

According to this slash dot post, following is a summarized list of enhancements:

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++)
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)
6- 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)

 

Hammad Rajjoub.

UG Leader and Member Speakers Bureau,
Ineta Pakistan.
http://dotnetwizards.blogspot.com

Posted on Monday, October 18, 2004 11:11 PM | Back to top


Comments on this post: Java 1.5 vs C#

# re: Java 1.5 vs C#
Requesting Gravatar...
C# generics at time of writing are incomplete. The XML and remoting tools choke on them, and List<> is final! You can't override it! Ouch! I'm having to use CollectionBase still for these reasons.

Java enums are classes, C# enums are numbers. Which is better is up to debate. Java's are more flexible, but maybe harder to use.

I like namespace aliases in C#, using AMO=Microsoft.Analysis.xxx. Where there's ambiguity it lets you resolve it more easily.

I've not used Annotations in Java as yet.

I prefer Java's "everything virtual by default" to C#'s "everything final by deafult". Microsoft claim that C#'s approach is better for versioning, as overriding things lets you shoot yourself in the foot if you get it wrong, but so much in C# cripples that goal in other ways.

I'm not a fan of the Dot-Net Framework. It doesn't seem well thought out in many ways - with big interdependencies and classes that look like they're changing behaviour depending on what they're called with (if typeof(param) = XXX) which leads to confusion and uglyness.

Also, support for database independent code is very poor in Dot-Net 1.0, and weak in 2.0, and I'm having a hard time at the moment trying to convert from an ADO.Net DataColumn to an OleDB DataType - its the same info - why should I have to convert it myself?

It also takes a lot of effort to serialise and deserialise complex object graphs which may contain multiple routes to the leaves.

Java's framework seems more complete and better thought out. For someone used to object orientated design it seems just better. It has more collection types, such as Set, which I've had to implement myself in Dot-Net. Model View Controller may sound hard, but once used to it, it's really nice. You don't get big two way depencies or spaghetti dependencies between packages.

Dot-Net looks like a Microsoft Access. It lets you quickly do what must be about 80% of the work - connect forms to databases, but the remaining 20% is hard as it doesn't generalise well.
Left by Richard on Dec 06, 2004 2:05 PM

# re: Java 1.5 vs C#
Requesting Gravatar...
I love C# more than Java!!!
Left by MS Addicted on Mar 01, 2006 7:57 AM

# re: Java 1.5 vs C#
Requesting Gravatar...
Left by Mono Project on Mar 01, 2006 8:01 AM

# re: Java 1.5 vs C#
Requesting Gravatar...
C# is much better and easier than Java. Period.
Left by Pravs on Mar 31, 2006 10:48 AM

# re: Java 1.5 vs C#
Requesting Gravatar...
Viva Java!!!

You guys haven't think that c# (spawned, sprung) was copied from java?

The whole .net framework concept is based in the Java framework... i mean, com'on!

Anyway, the goood thing about this, for me, is that Sun is not sleeping in their bed of roses because they have to admit that c# has very good things too, like XML integration, nice VS IDE that Sun has copied (hey! if you copy things, why can't we?), and some other features i like from .net.

But... what about app servers? hum... that part from Java is far ahead from what .net solutions can bring...

Good day!

And let us hope SUN vs MS still 'cause there have been a lot of changes in Java since .net, for good (of course), always for good.

Left by Jorge Baroudi on Jun 07, 2006 11:04 PM

Your comment:
 (will show your gravatar)


Copyright © INETA Pakistan | Powered by: GeeksWithBlogs.net