Hacker News new | ask | show | jobs
by flocial 5453 days ago
Long live the JVM and here we go again comparing Java to Rails the framework. I've seen the pros and cons of both Java and Ruby. From an organizational standpoint it's hard to beat Java. The performance is there and in a team setting statically typed languages really shine. You can argue about the quality of programmers that flock to Java quoting pg ad nauseaum but we don't live in a lisp world. Elegant code is written by good programmers not the language.

Ruby is fun and really nice for exploring ideas though. It doesn't marry you to an IDE and you can go from idea to reality quite fast with a text editor and a command line. Unfortunately, Rails is a lot of meta-programming magic and syntactic sugar that can really obscure the language for newbies. It's changed the landscape for web frameworks and I would even say mobile as well. RoR didn't invent MVC but it certainly refined our thinking of frameworks in general.

1 comments

> Elegant code is written by good programmers—not the language.

But some languages make writing elegant code easier than others (compare C to Python, for example).

For some task-specific definition of elegance. For me, elegance is not just about how terse the syntax is, but how well it solves the problem at hand and responds to changes around it. For me, some problems require a performant solution as well, and the elegant option is the one that does this without requiring a bunch of rewriting or adding hard to discover dependencies.

I can write some terse AND elegant list comprehension code in Python that takes lines and lines of crappy looping in Java, but I can also write some seriously terse code to centralize business logic via a web service with automatic transaction and security management and have it perform an order of magnitude faster than a similar implementation in Ruby or Python (JEE 6). To me, that is elegant.

Likewise, I can do some elegantly maintainable things with .NET generics that I can't do with Java's lame erasure based implementation.

Of course, you could always just takes Einstein's opinion :) "If you are out to describe the truth, leave elegance to the tailor."