Re:A Full Web Service with HTTP caching in 7 lines
by m_eiman on Tuesday February 24, 2009 @02:37PM
(#493471)
Am I the only one who's tired of these "X in Y lines of code!" things? It's obviously always many more lines of code, just hidden away from view, so meh!
Come back when you've actually done some REAL WORK in insanely tight code, not just imported this and that lib.
Re:A Full Web Service with HTTP caching in 7 lines
by aaronblohowiak on Tuesday February 24, 2009 @04:17PM
(#493610)
Rack::Cache is neato for development, but you're better served using Varnish for production -- it acts as a caching reverse proxy to multiple machines, is insanely fast and battle-tested, it can be configured to serve stale content if the backend becomes unreachable, it supports ESI, and more!
Re:A Full Web Service with HTTP caching in 7 lines
by lsb on Tuesday February 24, 2009 @03:01PM
(#493493)
I'm using Sinatra et al for my thesis project, for a Master's in Latin, and minimizing the non-interesting bits of infrastructure helps a lot.
It's interesting to me for the same reason PHP is interesting: it helped me wrap an HTTP interface over an executable in Ada with its own homegrown database, and (sociologically) it's a social commentary on the bits of plumbing we've agreed upon as useful.
Re:A Full Web Service with HTTP caching in 7 lines
by juliend2 on Tuesday February 24, 2009 @03:58PM
(#493584)
I love Sinatra. I find it very easy to use. I did a little web service that scraps the usage stats off an ISP page with it and Hpricot. I never had so much fun with Ruby!
Re:A Full Web Service with HTTP caching in 7 lines
by lsb on Wednesday February 25, 2009 @07:20AM
(#494275)
That was the interesting thing for me: not that you couldn't do it in a shorter number of characters, but that it was 7 lines of code written for people to read, and incidentally for machines to execute.
Re:A Full Web Service with HTTP caching in 7 lines
by jonursenbach on Tuesday February 24, 2009 @02:24PM
(#493448)
How about we all stop boasting about how many lines we can write something in, and go back to writing quality software? Who gives a fuck how many lines it is, only thing we should care about is if it's good or not.
Re:A Full Web Service with HTTP caching in 7 lines
by alecst on Tuesday February 24, 2009 @02:47PM
(#493475)
Uh, novice here, and although I'm sure we all agree that quality of code > lack of lines of code, there's no reason to bash clever programming. Who cares if it's pragmatic -- that's obviously not the motivation.
Re:A Full Web Service with HTTP caching in 7 lines
by rfunduk on Wednesday February 25, 2009 @12:55AM
(#494076)
Because we shouldn't ever have any fun? We shouldn't check out Blake's cool little micro-framework? We shouldn't use our own blogs for things we find interesting?
Come back when you've actually done some REAL WORK in insanely tight code, not just imported this and that lib.
1. Sinatra and Rack are amazing lightweight alternatives (especially for web services) compared to the giantness that is Rails.
2. Rack::Cache is seriously awesome (http://tomayko.com/src/rack-cache/) and deserves more attention...
And yes, Sinatra & Rack are super cool.
It's interesting to me for the same reason PHP is interesting: it helped me wrap an HTTP interface over an executable in Ada with its own homegrown database, and (sociologically) it's a social commentary on the bits of plumbing we've agreed upon as useful.
I can get to +1 character left if I just make the route '/:n'! :)