r/programming • • Feb 22 '15

Java Makes Programmers Want To Do Absolutely Anything Else With Their Time

http://www.forbes.com/sites/quora/2015/02/21/java-makes-programmers-want-to-do-absolutely-anything-else-with-their-time/
35 Upvotes

636 comments sorted by

View all comments

Show parent comments

8

u/ihcn Feb 22 '15

I think the argument is for compile time type inference, something every modern compiled language has, except java of course. Any IDE will tell you what the type is, without you having to type it out.

1

u/[deleted] Feb 22 '15

I mean it's not like it's technically infeasible to infer the type at compile time. The current approach is just a lot clearer (see the second point).

For example, a quick glance while scrolling through the code in a web-based code viewer shows you what type you're dealing with. You don't need to go into an IDE or follow the source code to figure this out. Basically what I'm getting at is that it's a feature, not a deficiency.

Also, IDEs kinda give you coding-time type inference and add the types to the source code for you. So you don't generally have to type it out.

2

u/ihcn Feb 22 '15

I strongly disagree that it's a feature. Java seems to have the mentality that it doesn't give you enough rope to hang yourself with, so it takes away all sorts of crucial features. The ostensible tradeoff is that your code is easier to understand as a result.

But in my experience with enterprise Java, bad developers will write awful code no matter how much you take away from them. The worst codebase I've ever seen, by far, was Java.

1

u/[deleted] Feb 22 '15

Agreed. Bad developers will write bad code regardless. I'm not saying it prevents bad code.

I think it's a feature because of the self-documenting nature of it.

In the end it's just a matter of personal opinion. I won't insist on attempting to change yours.