5 ms·
How do these two options stack up to just not using Rails and using something like Sinatra instead for beginners? When I started with Rails, I spent 2 days fig
by natural219 14y ago
How do these two options stack up to just not using Rails and using something like Sinatra instead for beginners? When I started with Rails, I spent 2 days figuring out the standard web framework functions / workflow, and then I gave up. When I picked up Sinatra, the pieces were small enough that I could learn them individually, master them, and learn how they were put together. Then, when I came back to Rails, I had a better understanding of the underlying technology and I was able to be much more productive.
Just my two cents.
- steveklabnik 14y agoWith Sinatra you have absolutely no guidance as to what's good and what's not: there's no stack at all. I, too, am a bottom-up learner, but most people (in my professional experience) are not. Look at the success of Rails Girls, for example: beginners get waaay more excited and engaged by Getting Something Up There than they do learning the intricate details of HTTP.
- natural219 14y agoI suppose there are different types of beginners to Rails. I can appreciate that I'm not the standard beginner -- I come from a web development background, so certain aspects of learning Rails were frustrating to me because I just wanted to see what was going on under the hood.
- learc83 14y ago>beginners get waaay more excited and engaged by Getting Something Up There Yes! That's why... require sinatra get '/hi' do "Hello World!" end ...is so amazing for newcomers. Even the file structure of rails is a bit too much for begineers. Everything in one file is so much simpler for trivial beginner "get excited" apps. Introducing someone to rails, they have to learn MVC, a templating system, an ORM, and more.
- steveklabnik 14y agoThis breaks down as soon as you have a form, which is basically the next step. While the 'hello world' might be smaller, you outgrow it immediately. Whereas $ rails new my_app $ rails g scaffold post title:string body:text is still easy to copy/paste/type from a screen, and gives you a lot more to start with.
- learc83 14y ago> gives you a lot more to start with. I realize there are differences in opinion, but I started programming seriously about 6 or 7 years ago, and I started with ruby/Rails. For me the scaffolding generated too much to easily digest. And separating everything into models/controllers/views is fantastic for a production app, but almost incomprehensible for a newbie. Veteren developers still argue about whether something should go in a model/controller or some other layer, how is a newb supposed to handle it? In addition you can build sinatra apps without even talking about hooking up a database. If you're trying to jump in on the deep end and build an MVP, rails is probably the way to go. However, if I really wanted to teach someone to understand what they were doing without being intimated, I'd start with sinatra.
- steveklabnik 14y agoIt's all about the amount of time you have. If I'm doing a 3 day engagement, we don't mention scaffolds until after they've hand-built all the code. If you're doing a 8-hour introduction, then yes, you need to use the scaffold.
- kyllo 14y agoBut MVC, a templating system, and ActiveRecord/ORM are not obstacles to learning Rails, so much as they are the whole point of learning Rails. Rails exists because these design patterns are so powerful and well-established that we all wanted a way to get them "out of the box" instead of having to roll our own implementations of them. Rails is not a good starting point for beginner web developers who don't understand these software design patterns and aren't interested in learning them. If your goal is to just start making websites, like right now, then clearly something like Sinatra is a better choice.
- Argorak 14y agoThere is no stack for sinatra, but there are certainly stacks on top of sinatra that don't take the Omakase-approach[1]. This has several benefits: they expect users to make decisions early on and to get informed about the components they use. With Rails, you generate a default stack and have to find your way around and then - potentially - have to learn the replacements. The upgrade from "basic" to "prime" is costly and often - just for that reason - is avoided. This is much to the harm of components that might be a better fit for a project: I still believe that Sequel is a much better ORM for people that care about their SQL database and I frankly find it underused in the Rails world. Outside of Rails, its actually rather common, because it has a lot of merits. I found teaching Padrino strictly better than teaching Rails (I do both), because you can teach it component by component and the missing "standard" stack is one of the reasons. Its much easier to teach it "the hard way". [1]: Obvious, shameless plug: http://padrinorb.com http://padrinorb.com , now with more development speed.
- anarchitect 14y agoWhen I decided to bring Rails into my team recently, I decided we should produce some prototypes in Sinatra first. With a single file it's easy to introduce some of the key concepts that are needed to understand Rails (especially for those coming from PHP).