3 ms·
>beginners get waaay more excited and engaged by Getting Something Up There Yes! That's why... require sinatra get '/hi' do "Hello World!"
by 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.