What is the best framework for start: rails or sinatra? I heard that sinatra is more flexible but rails has a lot of documentation and tutorials. What's your choice?
This question appears to be off-topic. The users who voted to close gave these specific reasons:
- "Questions about what language, technology, or project one should take up next are off topic on Programmers, as they can only attract subjective opinions for answers. There are too many individual factors behind the question to create answers that will have lasting value. You may be able to get help in The Whiteboard, our chat room." – gnat, psr
- "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Community, Community
First off this may or may not apply to you (I'm answering for any future readers who ask the same question), but I'd recommend getting a solid grasp of Ruby before you start learning a framework.
That being said, here's my thoughts on both frameworks for a beginner.
Sinatra is the easiest to get something working. You can get hello world, and very simple sites going with very little code.
However, once you get past that into moderately complex applications, you'll need to start adding stuff that comes baked into Rails. For a beginner that can be a bit daunting.
I'd check out Michael Hartl's Rails tutorial http://ruby.railstutorial.org/ for more hands on Rails information.
I think it's better to start with Rails (BTW I know and like both Rails and Sinatra). Rails is certainly bigger and more complex than Sinatra, but it's easier to use and there's a smaller chance that you get stuck on something (at least from my experience).
Rails handles elegantly most of the common problems you are likely to encounter during application development, in Sinatra the solution will usually require extra effort, searching though documentation and internet. For example: exporting to xml or json.
I'd recommend this tutorial as a a starting point: Ruby on Rails Guides: Getting Started with Rails.
Stick with Rails; you'll learn more overall as a beginner to Ruby. When you've learned enough and/or run into the walls that can happen when working with Rails, then look at a more freeform framework like Sinatra. If you start with Sinatra first, you'll have to do most everything yourself and as a beginner that can be fairly daunting and frustrating.