
Camping vs. Sinatra - razerbeans
http://librelist.com/browser//hacketyhack/2010/7/20/on-camping-vs-sinatra/
======
draegtun
Always had a soft spot for Camping. Any web framework whose code comes in
around 4k or under gets the thumbs up from me!

* Current code @ 3.499k - <http://github.com/camping/camping/blob/master/lib/camping.rb>

* Last WayBackMachine archive of _why repo @ 3.9k - [http://web.archive.org/web/20080527003153/code.whytheluckyst...](http://web.archive.org/web/20080527003153/code.whytheluckystiff.net/camping/browser/trunk/lib/camping.rb)

------
code_duck
Very lively note! No wonder this fellow was drawn to working an on a project
by _why.

I've never before felt interested in using a Ruby framework, having recoiled
from Rails in consternation (though to be fair, I wasn't quite ready for a
framework). I really like the idea of a mnmlst framework. I've looked at the
Sinatra and camping websites before... now I'm intrigued enough to try a
project in each.

------
mcantor
He's not kidding about the small community increasing the likelihood that your
problem gets looked at. I once had a small issue, and _why himself responded
to my e-mails until I had figured it out.

~~~
dedward
Sure.. but _why kinda up and disappeared, didn't he....

~~~
judofyr
(Disclaimer: I wrote that email)

Oh, don't worry. I know what every single byte in Camping does:

    
    
        $ git-rank-contributors -v | head -n 5
        _why <why@whytheluckystiff.net>: 11384 lines of diff
        Magnus Holm <judofyr@gmail.com>: 10122 lines of diff
        Jonas Pfenniger <zimbatm@oree.ch>: 1829 lines of diff
        Manfred Stienstra <manfred@gmail.com>: 168 lines of diff
        Sean Busbey <sean.busbey@gmail.com>: 116 lines of diff
    
    

Besides, there's plenty of other (techarch, Bluebie, DaveEveritt, zuk and
busbey are the first who come to my mind) who post frequently on the mailing
list and know _plenty_ about Camping.

~~~
netghost
At 4k, it's not exactly huge. It is full of ruby that isn't exactly obvious at
once, which I actually think is kind of enlightening.

------
SlyShy
I'm a big fan of how well demonstrated the code was in this email.

~~~
amackera
It's things like this email that make the Ruby community sparkly and
tantalizing for all of us.

------
philh
This seems a little weird to me. Like if I bought a Pepsi and someone from
Coca-cola came up: "Pepsi, huh? Great choice! That stuff tastes pretty good,
doesn't it? And that's the important thing. But you know, there are some
pretty cool things about Coca-cola..." The opening enthusiasm sounds forced,
like it's to gain my trust and set me up for a conversion. Not saying that's
what's intended, just how it feels to me.

Is there some backstory I'm missing?

~~~
steveklabnik
The backstory is that I'm gearing up for a 1.0 release of Hackety Hack on
Whyday, and while the current site is in Rails, I want the _entire_ project to
be exemplary for learning. So I posted a thread entitled Camping or Sinatra?
where I asked everyone for their opinions... and I decided Sinatra, because I
know it best, and because of a few concerns this email addresses. Then this
thread comes along.

------
mhd
Is expressing your message as a valid ruby program the new YAPH signature?

His arguments are all valid for programs of a more significant size, but
aren't both Camping and Sinatra oriented towards small programs, whereas you'd
use something like Rails or Ramaze for bigger projects? This line gets a bit
muddied by the increasing number of projects built on Sinatra, although I
don't know whether they introduce ways to alleviate the points he made.

~~~
judofyr
The new JAPH signature? I don't know really. I just write, and sometimes weird
stuff ends up on the screen. Sorry!

Let me remind you that it was just _six (unimpressive) reasons Camping is
better than you would imagine_ , not _six reasons Camping is a better fit for
your project_. All I'm saying is that Camping gets so many things _right_. Not
necessarily in very few lines of code or very fast, but nonetheless: I look at
Camping code and nod to myself: "Yeah, this is probably the _correct_ way to
do it".

Of course, this doesn't matter at all! If we cared about correctness, we would
program in Haskell, not some language where monkey patching is acceptable in
production code. As long as you're comfortable in Sinatra, you should continue
doing that. It's that simply.

Interestingly, camping.rb on the other hand is _not_ very pretty or correct:
<http://github.com/camping/camping/blob/master/lib/camping.rb>, and that's
also what makes it so beautiful in my opinion.

Oh well, let me finish with a little quote from _why:

    
    
        On Sun, May 25, 2008 at 02:47:39PM +0200, zimbatm wrote:
        > This is not that hard to do. Maybe I should add some shortening tricks 
        > document. I propose platterizing to be done only before release.
    
        No, let's not have rules.  I don't feel comfortable with having
        coding standards or any protocol on Camping.  The point of Camping
        is to have very ugly, tricky code that goes against all the rules that
        people make for "beautiful" code these days.  To show that ugly code
        can do beautiful things, maybe.
    
        I don't want to demonize anyone here, I just want to express the
        ideas that make Camping different.  Camping's personality is 80x50.
        It is like the little gears of a watch that are all meshed together
        into a tight little mind-bending machine.  The challenge of Camping
        isn't to figure out how to automate obfuscation.  The challenge is
        to bring new tricks into the code that push Ruby's parser and make
        everyone look twice.
        
        Not all code needs to be a factory, some of it can just be origami.
    
        _why

~~~
steveklabnik
> Interestingly, camping.rb on the other hand is not very pretty or correct:
> <http://github.com/camping/camping/blob/master/lib/camping.rb>, and that's
> also what makes it so beautiful in my opinion.

I saw a very interesting comparison between Ruby and Python that sounds like
this. Basically, it went like this: "Python's core language is very simple and
pretty, and Ruby's is very complex and ugly. Yet, the very ugliness that Ruby
allows and Python disallows means that the libraries that are created with the
languages that are the exact opposite: RSpec is a thing of beauty, and
something similar in Python isn't even really possible at the same level. So I
actually like _using_ Ruby, even if I like the Python language more."

Like you said in both your email and here, it's all about what's best for
_you_, not what's best 'in absolute.'

------
DanielRibeiro
My suggestion: make a simple app in both. Try out framework features you want,
such as routing, source reloading, view support, testability, modularity (can
I use MongoDB instead of a SQL for my models?), low level features, anything
else it is important to you. Trying pushing it a little over the edge:
extending and metaprogram the core classes as bit and checking error reporting
(what happens if I pass out a 10000 character url?).

There you go. Two simple apps, that really stress what matters to you. Also,
beware of frameworks that impose too much on you
(<http://news.ycombinator.com/item?id=1534153>).

And most of all: enjoy playing around.

