Over a million developers have joined DZone.

Is LINQ leaving Java in the dust?

· Java Zone

Microservices! They are everywhere, or at least, the term is. When should you use a microservice architecture? What factors should be considered when making that decision? Do the benefits outweigh the costs? Why is everyone so excited about them, anyway?  Brought to you in partnership with IBM.

Interesting story today asking whether LINQ has given .NET an edge over Java. LINQ is best-known as a way to embed SQL-like statements directly in code. However, it's really a much deeper technology that allows you effectively build DSL-like constructs in libraries that work as if they are part of the language. And that is undeniably powerful.

From what I've seen, the C# code using LINQ also seems to be relatively readable (due to the DSL-like nature of it) and that is a big win from both the power and complexity standpoints.

So, then we have the question of Java, which does not (currently) have the ability to weave structures into the language as elegantly as LINQ. I think the closures work could make that possible in Java 7, but we're talking probably 2010 before Java 7 is in common use.

From a language feature perspective, C# and LINQ are evolving faster and adding more important features than Java.

We have to take a step back though and consider some other things. C#/.NET are not driven by standards or a loose coalition of competing/cooperative companies; they're driven solely by Microsoft. And Microsoft is happy to break backwards compatibility and force platform upgrades as the sole provider of the technology. Things are a bit more bohemian in the Java world and the JCP may be the tortoise to Microsoft's hare in this regard.

But I wouldn't count Java out.

The addition of annotations, static imports, and generics (even crippled generics) has opened some interesting opportunities and I think we've only recently started to see people target and push those features to their fullest. I suppose the poster-child for this in the context of LINQ must be Quaere, which aims to do much the same as LINQ by building an internal DSL. Guice is another good example of pushing these features to their limit.

You might also point to the possibility of dropping into Groovy and using builders or other DSL-friendly tools there. Or moving slightly farther afield, use JRuby or Scala to develop the data access parts where you need more flexibility.

Between a quickly-evolving .NET with a limited community vs a more slowly-evolving Java with a rich community, gimme the Java world any day.

But, I'd like to hear what you think. Are C#/.NET innovations changing your mind? Are they just a call for improvement in the Java world? What can we learn from each other?

Discover how the Watson team is further developing SDKs in Java, Node.js, Python, iOS, and Android to access these services and make programming easy. Brought to you in partnership with IBM.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}