Ask HN: Have you seen some beautiful Java Code?
Recently I've been working in Java, on a project started years ago. All the code I see, whether developed inside this project or in external libraries, is horrible.
It is almost devoid of content -- hundreds of classes, each doing a few assignments and logging some data, and then deferring to another class.
I've seen some beautiful C code, e.g. the LuaJit2 compiler written by Mike Pall. I've seen beautiful C++ code in the FLTK project. I've found beautiful Python code e.g. in apenwarr's "bup" and "redo" projects.
But I've never seen any beautiful java code that gets something done clearly. Did you?
(
5 comments
| 8 points
| on HN
)
What do you think of this? http://sourceforge.net/projects/timeandmoney/.
I haven't used the library, but its author (Eric Evans) is an old Smalltalker who wrote a good book, Domain Driven Design, in which the examples are in Java. The book is immersed in OO but also kind of points the way beyond OO into something more like "how to develop domain languages", which I find more interesting.
Whenever we had to write new code, we had to propose to our peers what we intended on doing and how we intended on doing it. Keeping senior members of the team in the loop kept the younger guys (like myself) in check when it came to implementations and design pattern usage.
On top of that, a handful of the people on my team were RELIGIOUS about writing comments first and then coding to the comments. All in all, it was a great experience for me having been fresh out of undergrad.
It was worse when EJB2 was the standard.
Take a look at the Play framework for some modern, non-enterprisey Java.
http://www.playframework.org/