Skip to content

Comment on The Modern Java Ecosystem (for the Sinatra or web.py lover)parent

Comments

> For example having a single file with methods annotated with @GET or @POST is so much cleaner to me than having routes.rb open in another editor window

URL mapping is a framework detail, not a language detail — although the framework can be limited by the language. In Sinatra you'd write:

    get 'someroute' do
        # do stuff
    end
http://www.sinatrarb.com/intro.html#Routes

each style (these and half a dozen others) has its advantages and inconvenients. For instance, separate urls mapping (Rails, Django) give a starting point laying out the structure of the site and make views/controllers easier to reuse (as they're not coupled to URLs)[0], whereas annotating the handler directly gives a better view of where they're involved and how.

[0] They also make it simpler to "graft" sub-sites in

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.