News for hackers. Stuff that matters.
Re:Why Ruby? by jiggy2011 on Friday March 22, 2013 @05:06AM (#5421963)
The problem is choosing a framework for Java. Most of them are just big , unwieldy and force overwrought abstractions and 1000+ line XML files on you.

The big exception is Play! Framework but that seems to have mainly shifted over to the Scala side of things.

Re:Why Ruby? by bad_user on Friday March 22, 2013 @06:55AM (#5422217)
> The big exception is Play! Framework but that seems to have mainly shifted over to the Scala side of things.

Dude, Play 2.x is perfectly fine for Java and will always support both languages.

Re:Why Ruby? by jiggy2011 on Friday March 22, 2013 @07:07AM (#5422254)
True, but it's clear that Scala is the preferred language.
Re:Why Ruby? by bad_user on Friday March 22, 2013 @07:17AM (#5422279)
I view that as a good thing, as cool concepts like Iteratees have been inspired by functional programming and Scala. There aren't many frameworks out there that make it easy to develop traditional websites and web services and do comet/websockets with ease. There aren't many reactive frameworks out there, period.

I also hated Play 1.x because it relied on its own half-baked build system, making it hard to import Maven modules and because the templates were written in Groovy, which for me was a big turn-off, because I like the JVM for its potential for performance and using such a slow dynamic language for its templating was a big no-no (Groovy may have gotten better in the meantime, I don't really know). It also relied on many runtime hacks and bytecode generation, things that have been moved at compile time in Play2 with the help of its SBT integration.

There's many things to like about its preference for the Scala way of doing things. Don't let that stand in the way, as otherwise it's a nice framework.

Re:Why Ruby? by vorg on Friday March 22, 2013 @08:24AM (#5422493)
> Groovy may have gotten better in the meantime, I don't really know

Last year Groovy 2 was released which provides a @CompileStatic annotation which directs the compiler to statically compile the tagged code which runs faster. Not many people seem to be using it though, e.g. Grails and Gradle only use dynamically compiled Groovy code (afaik). And it's still quite buggy, e.g. just yesterday this serious bug was reported: http://groovy.329449.n5.nabble.com/BUG-in-CompileStatic-mode...

Re:Why Ruby? by RyanZAG on Friday March 22, 2013 @05:30AM (#5422008)
Java has moved from XML files to @Annotations now. Most frameworks are providing support for it now, too.
Re:Why Ruby? by lazyjones on Friday March 22, 2013 @05:43AM (#5422040)
You mean they have added @Annotations to XML file editing. Many frameworks still require you to edit XML files too in some places (Maven/Ant/Tomcat config etc.).
Re:Why Ruby? by moondowner on Friday March 22, 2013 @06:48AM (#5422198)
In the application code, you can use either annotations or XML, or both, it's up to the developer.

And regarding editing XML in some other required places - you can use Gradle instead of Maven or Ant (thus no XML files). But that's not the point, to get rid of all XML on your server. The point is that in the application code you are not obliged to use XML.

Re:Why Ruby? by cgh on Friday March 22, 2013 @11:17AM (#5423445)
If you are doing much beyond simple bean injection - Camel, Quartz, OSGi, etc. - then you will be up to your armpits in XML. But it's not so bad, if you prefer configuration to convention.
Re:Why Ruby? by moondowner on Friday March 22, 2013 @05:29AM (#5422006)
And don't forget Spring MVC, my favorite choice. Since Spring 3 it supports complete annotation based configuration. And it's completely configurable to leave you choose whichever templating solution (e.g. Thymeleaf)
Re:Why Ruby? by pmahoney on Friday March 22, 2013 @09:56AM (#5422887)
I have found RESTEasy (and likely any JAX-RS implementation) to be very nice for creating simple services. With various annotations and static typing to automatically convert various parameters into function arguments, it's easier than Sinatra on Ruby. (Of course, there's a bit of config overhead to hook it into a web.xml, but it's not terrible)
Re:Why Ruby? by thebear on Friday March 22, 2013 @06:35AM (#5422171)
I've heard great things about Play. When I had to choose a Java framework about 2 years ago, I chose Stripes, and I've been very happy with it. But I notice that it doesn't even get mentioned in discussions like this one. Wonder why that is.
Re:Why Ruby? by RyanZAG on Friday March 22, 2013 @10:35AM (#5423139)
One of the biggest (maybe the biggest?) contributions to language and framework adoption is marketing in the form of blog posts, training sessions and quality tutorials. This is why RoR is so popular even when it isn't all that great (there are many technically superior alternatives across many languages) - it has amazingly good marketing for a framework.

So to answers your question: you don't hear about Stripes because Stripes is bad at marketing. Just look at their website - it looks like its from the 90s. A small bit of CSS work is probably the best thing Stripes could do to increase user base.

Re:Why Ruby? by oinkgrr on Friday March 22, 2013 @07:52AM (#5422388)
I dabbled in Stripes a while back(moved job, now on Spring3), and I liked it as well. Lightweight and easy to use but lacked decent support and user traction. No reason it's not used more, and I don't know why either.
Re:Why Ruby? by khein11 on Friday March 22, 2013 @06:53AM (#5422211)
Play is a great framework, a breath of fresh air for Java community!
Re:Why Ruby? by Proleps on Friday March 22, 2013 @12:35PM (#5423973)
Spark is a micro framework for Java[1]. I plan on trying it some time in the future.

[1] http://www.sparkjava.com/why.html

Re:Why Ruby? by mbell on Friday March 22, 2013 @02:25PM (#5424666)
Ug...that is some ugly code. I can't believe they are arguing that this (Spark):

    get(new Route("/") {
        @Override
        public Object handle(Request request, Response response) {
            Integer age = request.queryMap("user").get("age").integerValue();
            //do stuff
        }
     });
is cleaner and easier to read than this (JAX-RS):

    @GET @Path("/")    
    public Response get(@QueryParam("user[age]") Integer age) {
        //do stuff
    }
It gets far worse if you think about what it takes to marshall a JSON response in spark...