• Senior Software Engineer • Focused on Customers and Craftsmanship • Leader of the Phoenix Software Engineering Reading Group Mike is a DZone MVB and is not an employee of DZone and has posted 20 posts at DZone. You can read more from them at their website. View Full User Profile

Your Programming Language Sucks?

06.15.2012
| 4896 views |
  • submit to reddit

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.

 

 

 

 

 

 

Published at DZone with permission of Mike Christianson, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Erik Post replied on Sat, 2012/06/16 - 5:28am

Hi Mike,

I'm sure you'd agree that for whatever it is that you're trying to achieve by programming, Malbolge would suck. COBOL too, perhaps. Yes, that says something about you, but let's not pretend as though it's impossible to make qualitative assessments about programming languages, especially given a set of criteria. Who knows, your problem domain might be such that it would be wildly impractical not to have operator overloading. (For example, I've found it irritating that I couldn't use + on Java's BigIntegers. If you're doing a lot of matrix computations, syntax like MatLab's is nice.)

If the person you're referring to made his 'Java sucks' case based solely on the impossibility of comparing two Dates, especially without mentioning why this might be important to him, then yes, that might make for a somewhat feeble argument. (I mean, everybody knows how swell Java's Date API turned out, don't we?) That's not to say there aren't a lot of things wrong with Java, as there are with most programming languages. 

I personally don't have the things you mentions very high up on my list of reasons for not using Java, but I always find it instructive to learn about other people's criticisms. Surely you have your own list of Java peeves and secret wishes?

On a side note, I don't recall a CS class mentioning why operator overloading is bad. Perhaps you've had some problems with the C++ interpretation? The question of when to use it is quite a subjective (and orthogonal) one, as you hinted.

Cheers,
Erik 

Jonathan Fisher replied on Sat, 2012/06/16 - 9:56pm

COBOL is probably the most expressive language in existence:

DISPLAY "Enter student details using template below." 

ADD YEARS TO AGE 

 It's also can be faster than C/C++.

"Expressive" is a dumb argument. You need a level of it, but beyond a certain level it's pointless.

Erwin Mueller replied on Wed, 2012/06/20 - 8:12pm

I've yet to find any meaningfull example for op-ov. All I see are examples that are either only in mathematical context or does not make sense. For example: date = date + 5 What does it mean? Add 5 days or 5 minutes? Even the Java's string+string operator does not make so much sense and is not used as much (or better it should not be used).

In my opinion, op.ov is not such an important feature and almost all op.ov examples are better done with a meaningfull named method.

Except in a mathematical context, in which operators are well defined, op.ov. does not make so much sense.

Erik Post replied on Fri, 2012/06/22 - 8:19am in response to: Erwin Mueller

I'd have thought mathematics to be fairly 'meaningful', as well as rather wide-ranging. So... thanks for making the case for operator overloading. I was also under the (possibly mistaken) impression that adding dates was a mathematical operation. If so inclined, one could model dates and date intervals as tuples and add those.

Java's choice of '+' as the string concatenation operator is simply a mistake.

Mike Christianson replied on Mon, 2012/06/25 - 1:04pm in response to: Erik Post

Erik, thanks for your comment. Rather than reply point-by-point, I would ask you to read my follow-up post, Revisited: Your programming language sucks? 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.