
The Guide to Cuba, a Ruby Micro Framework - redman25
http://theguidetocuba.io/online.html
======
vinceguidry
Micro-frameworks are a great way to get into web development if Rails is too
intimidating. I cut my teeth on Sinatra. As I got more comfortable I started
using Rails.

I now use Sinatra only if I'm absolutely sure that the project is not going to
need anything more than a single page of code. I've re-implemented Rails
functionality, poorly, way too many times.

Cuba looks much leaner and meaner than even Sinatra. Can't see many use cases
for it, maybe if I were implementing a non-standard API for, say, a game
engine. But who wants to use Ruby for a game? Pure HTTP applications, I can
definitely see the appeal. But the second you need to serve HTML, you're gonna
want Rails.

~~~
glassx
> I've re-implemented Rails functionality, poorly, way too many times.

It's been a looooong time since I last touched Rails, but I never really
missed it when using Sinatra, mainly because of plugins/gems... I even wrote a
few. (Currently I'm mostly using Go and C#, though).

Honest question, just so I know what I'm missing: what kind of functionality
did you have to reimplement yourself?

~~~
vinceguidry
The biggest thing I missed was separation between routes and controllers. In
Sinatra they're combined, it takes a lot of hackery to implement Rails-style
routes. But you're gonna need them more and more as your web app increases in
complexity.

Rails takes everything involved in web applications, breaks it apart, and
figures out how to best implement it, then writes a nice guide to help you
navigate the convention. If you learn how Rails does it, you're pretty much
learning how to 'best' do it. So you can, for sure, re-implement it in
Sinatra, but why? Rails already has a one-liner that will do exactly what you
wanted it to do.

Generators is another big win. Once you learn how that system works, and
granted, right now it's really hairy and not nice at all, but when you wrap
your head around it, you can really turbocharge your webdev workflow, giving
you Lisp-like superpowers without having to suffer the pain of debugging your
own tools.

The sheer amount of knowledge embedded into StackOverflow is another huge
plus. Something not working? Chances are someone has figured it out, and has
documented it on SO.

I take pragmatism very seriously as a coder. I don't want to spend hours
trying to figure out weird little things. I've got better things I could be
doing. Rails gives me superpowers I never even knew I needed. If you've used
Sinatra to build anything more complex than a dead-simple API, which is the
only thing I would use it for these days, then you've probably worked hard to
implement something Rails has already figured out and turned into a one-liner.

I get this spidey-sense when I'm developing in Rails, I'll be like, "surely
somebody has done this already" and I'll search around on Google. Sure enough,
most times I find the exact code I needed. Rails is the Rome of webdev. All
roads lead to it. Just swallow your pride and use it, and you'll have the
might of its legions at your back.

------
theoracle101
How does this compare to grape ? Interested in mainly REST API's for things
like mobile API

------
jqm
Skimming over the headlines the name Marco Rubio jumped out at me. Cuba, Ruby,
Micro...

Eh, Too much politics in the news lately....

