|
|
|
|
|
by qu4z-2
4878 days ago
|
|
I believe the Java equivalent is something like passableF = new NotAClosure() {
public void execute(int i) {
return f(i);
}
}
But maybe someone knows better than me. I've had thankfully little to do with Java recently.EDIT: Which I guess defeats the purpose of "without an object", but... |
|
For me, these are the things Java sucks at.
1) There is no easy way to create lists or maps. Look at python; how easy it is to create a dictionary. In Java, you have to "write code" to put elements in a map.
2) Reflection is very weak. It is not type checked at compile time. You have to write a lot of garbage just to run the show.
3) The getters/setters are a hell. Not to write them mind you, but the amount of cruft that creeps in, that you have to filter out to get to the heart of the problem during reading.
4) The constructors: A a = new A() (wtf....)
5) piss-poor Generics.
6) File Operations are pure crap.
7) One class per file? Omg.. For a long time, I thought i sucked at OOPS. The single biggest reason it took me long to get acquainted with OOPS is because of one class per file. Any other class is a new file, a context switch in my mind. In Java, Objects are first class entities; it should be cheap(in terms of things i need to look at) to define, create, and switch between them.
Finally, I think Java sucks because of its verbosity. And a subliminal style that it supports. There are a lot of programmers in Java who think the best way of multiplying two numbers is to add one of them other number of times . Somehow, everything should be drawn out.