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

140

u/karlhungus Feb 22 '15

I have no love for java.

While it performs pretty well nowadays, it still isn’t competitive with C or C++ and, with a little love, Haskell and OCaml can or will eclipse it in that domain.

I didn't think this was true, i thought it was somewhat close to C (excluding startup).

For real-world production servers, it tends to require a fair amount of JVM tuning.

This is really seems like reaching for something to be a problem that isn't.

because it objectively sucks.

If people can't even define OO, it can't objectively suck. If you were making a pun i forgive you.

culture is one of mediocrity and bad taste, with MetaModelVibratorVisitorFactory

These kinds of strawmen make me feel like "I don't have to read another word this person writes."

0

u/[deleted] Feb 22 '15

[deleted]

13

u/slavik262 Feb 22 '15

Yep. Cache misses are a huge and "hidden" cost on modern CPU architectures. Everything being a heap-allocated object in Java means that unless you're iterating over an array of primitives, you're going to be doing a lot of bouncing around in memory. See: http://gameprogrammingpatterns.com/data-locality.html

1

u/nqd26 Feb 22 '15

Everything being a heap-allocated object in Java

But this is not really true anymore. Java does escape analysis (IIRC from Java 6 with some option, from Java 7 by default) and puts short-lived (i.e. those which don't escape method scope) objects on stack.

2

u/[deleted] Feb 22 '15

[removed] — view removed comment

1

u/nqd26 Feb 22 '15

Are you talking about "growability" of collections? If so, it can be solved by preallocating the necessary number of elements (if known), e.g. new ArrayList(1000) or even new ArrayList(otherColl.size())