Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"Java: too verbose, too many FactoryFactories, painful to tune"

Paintful to tune... Maybe. But I don't understand why so many people say patterns like FactoryFactoryFactories are inherent to Java!

I can write Java code with NO factories at all. Writing shitty and unflexible code is really easy. When you understand why a factory is used in a particular piece of code, you start to appreciate it!

It's also very possible to write C++ or Python code with too many overengineered components.

Also, I like a language to be verbose, I don't think it is an issue. As long as the code is clear and easy to read... And it's often the case with Java programs. For my eyes, Java is way more readable than, let's say, Perl, Scala or Clojure. I couldn't care less about the number of lines required to achieve the same result!

I'm getting tired of this Java bashing... The only thing that really sucks about Java is Oracle!



In fact, since go does not have explicit constructors, it encourages the factory pattern all over the place. You'll find static factories everywhere in the go library.

http://golang.org/doc/effective_go.html#composite_literals


In modern languages, you don't need to write a class when all you need is a first-class function.


Modern languages?! This has been possible since FORTRAN.


And LISP, but not in Java... :(


Even Java bashers would concede that Java is a brilliant language, certainly for its time. And the JVM is the most impressive programming environment to this day.

But the language has become a little dated. Oh, you don't need to go as far as Scala to fix it (to me Scala feels like a deranged, haphazard combination of javascript and Haskell), but something like Kotlin could really be a "better Java" (it also happens to be a better Scala, but that's a different point).


I guess when you talk about a language, you usually also end up talking about the platform, libraries, community and the whole environment. It is hard to escape from this when talking about Java.

For those that are not in the Java land - the whole Java ecosystem is heading in an interesting direction.

Not just the platform (with all the other jvm languages), but the java language itself. Using Java 8 and some of the new features, suddenly standard Java code starts looking more and more modern. Add to this some interesting developments in the framework land, like NIO with Netty, Gradle combined with maven repositories for dependancy management, even new developments in entrenched stuff like Spring or JavaEE...

The community and the ecosystem is slowly evolving outside the whole enterprise monstrosities. It will be interesting to observe the platform in the next couple of years.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: