5 ms·
With 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
by steveklabnik 14y ago
With 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.
- benatkin 14y agoIt's amazing for newcomers who like elegant code that can't be shipped. I'm that way. Or, rather, I was, and I look back on that time fondly. Other people who get into web development aren't impressed by such things, and would rather see something like rails or WordPress which is shippable right away and then can be built on top of. Some programmers, especially the kind to hang around on HN, would rather not work with people who don't understand the entire system they use. I often hear people say they wouldn't touch WordPress with a 10-foot pole. They are avoiding a huge part of the web development industry. This is a valid choice, but some people don't even realize they're making this choice, and I wish they would realize it so they could make sure that it's really what they want.
- epochwolf 14y ago> Some programmers, especially the kind to hang around on HN, would rather not work with people who don't understand the entire system they use. There's a reason for this. I've worked with people that don't understand how things work and don't really want to learn. These people cause enormous amounts of damage in any system that contains architecture beyond php in the webroot and algorithms beyond brute force. You let one of those people on a large production database, it's game over. They will run queries that miss all the indexes. They will remove constraints because they don't understand why they exist. They will use flat files in place of a database because the database is scary and then not understand why stuff goes missing in the multi-server production environment. These people are a liability in a project beyond small scale. They are the same people whose wordpress blogs are repeatedly hacked.
- 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.