7 points · by snapple · 15y ago · 2 comments
I am kind of stuck and could use some advice from the community.
I have an idea for a larger web app (multiple auth methods, a lot of dynamic pages with forms, etc.) and would like to develop it using ruby as a main language for the backend.
I developed few websites before with PHP, using various frameworks, such as Zend, Kohana, CI. I've also used ruby for small personal projects and tried both Sinatra and Rails. Between the two, I prefer a small micro framework as it gives me a feeling of a more control and less of a glue-together things approach.
I know that Rails would be an ideal framework for this kind of web app, there are a lot of gems that solve most common features (auth, forms etc).
So I wonder if anyone here went with a micro framework route and had no regrets at the end, even if a lot of time was wasted by re-inventing the wheels.
Another issue is the structure of code / files using a micro framework. I would hate to end up having insane amount of folders / files that would end up looking just like Rails, but the idea of throwing everything into a single file is also questionable.
So any thoughts and suggestions are more than welcome.
Since both frameworks are Ruby, I'd hope that it wouldn't be too big of a deal to decide to change from one to the other in the middle of the project, unlike a full blown language change.
Me personally, I came from the Python world and started out with Ruby on Rails. But I didn't spend enough time with it to ever get out of the stage where it felt like I was working with a black box.
I tried Sinatra on a project and quickly "clicked" with it and I haven't used RoR since.
My biggest project runs on Sinatra, but the caveat there is that probably 90-95% of the current code has nothing to do with the framework.
I have seen the number of files grow to the point where I start wondering if I would've been better off with Rails where there would be a specific location for everything. On the other hand, I get to decide where stuff should go, and more important to me is that everything that is there is something I put there. Whereas, with Rails, I found I was wasting time trying to wade through all of the skeleton files to find where I had actually written some code. But again, I chalk that up to the fact that I never moved out of the black box phase.
As to reinventing the wheel, depending on your motivation, reinventing the wheel isn't necessarily so bad as you'd learn a lot along the way. And if you enjoy it, then I'd argue that would be more important than being half hearted on something where gems already exist for what you want.
So again, I'd say to pick whichever one motivates you to get started now.
Good luck.
You have a main Rails app as the glue and these small services can be done in Sinatra fulfilling specific needs of the App.