Over a million developers have joined DZone.

Your Programming Language Sucks?

· Java Zone

Learn more about how the Java language, tools and frameworks have been the foundation of countless enterprise systems, brought to you in partnership with Salesforce.

Update 2012-June-20: Please also read my follow-up post, Revisited: Your programming language sucks?

I met someone recently that declared “Java sucks.” One proffered argument of that “suckiness” was Java’s lack of expressiveness. In point: you can’t compare two Date objects with the less or greater -than operators. Further, you can’t override the operators themselves. (I won’t touch that subject; we covered it in Computer Science 201.)

Date now = new Date();
Date epoch = new Date(0);
assert now > epoch; //won't compile

Nope, that won’t compile. What are we to do?

assert now.after(epoch);

There, that works. But what if we really, desperately wanted to use operators?

assert now.getTime() > epoch.getTime();

Both of these seem perfectly expressive to me. Much ado about nothing? I think it’s a matter of comfort and familiarity.

Saying a programming language “sucks” says less about the language and more about the person speaking.

 

Discover how the Force.com Web Services Connector (WSC) is a code-generation tool and runtime library for use with Force.com Web services, brought to you in partnership with Salesforce.

Topics:
java

Published at DZone with permission of Mike Christianson, DZone MVB. See the original article here.

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 }}