Live data from Hacker News

Rails has Two Default Stacks

words.steveklabnik.com

51–60 of 93 posts

Re: Rails has Two Default Stacks

#51
post #33

Earlier quoted context omitted.

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.

>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.

But 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.

Re: Rails has Two Default Stacks

#52
post #11
post #10

Earlier quoted context omitted.

I agree with you, which is the reason why I think PHP is still way more popular than Rails. Cut-and-pasting scripts from Google searches is a terrible way to make code, but it works and it's a lot easier. I agree with DHH that Rails shouldn't be dumbed down (see his Railsconf 2012 talk https://37signals.com/svn/posts/3171-keynote-by-david-from-r... ). Cooking with Rails is like cooking with a real oven, not an easy b…

I think the fact that the starting point for php is an html page is a big deal. Whether or not its a good thing to replicate that (and things like that) is debatable but its not just about cutting and pasting from Google.

You can write PHP-style "the file is the html page" code in Ruby with .erb files and mod_ruby. It's no harder to set up than PHP (granted though, most people who abuse PHP like that can't/don't do their own server configuration).

I can't think of anyone though that promotes that method of building websites anymore though, even PHP proponents advocate some flavor of web framework. It just happens to be an easy entry point for using PHP, and once a new developer has built some project momentum for the first time, they're reluctant to start over with something new.

Re: Rails has Two Default Stacks

#53
post #3

Using Steve's definitions from the article, the tutorial I usually point people to is Michael Hartl's Rails Tutorial http://ruby.railstutorial.org/ which uses the "Prime" stack. I believe I read somewhere that Michael was going to come out with a "37 signals" stack version as well. One message I'd like people to understand when they're starting out with Rails is that it really is confusing, and that being confused an…

I disagree that using Rails Tutorial as a beginner resource is the way to go.

In fact, I used that as my first resource for learning Rails! Here are some problems I found with it:

1. It teaches you Git along with Rails. Who cares about source control at this point? Remember: This is for a newcomer to Rails that just wants to learn how to create websites using rails; don't confuse me even more.

2. It teaches you how to deploy to Heroku. Again, don't care at this point.

3. It teaches you how to deploy your code to Github. Once again, NEEDLESS INFORMATION AT THIS POINT! :P

4. Unit testing; Ugh, I'm 100 pages in and I barely have a grasp of what I'm doing, and I'm STILL barely 1 controller with 2 actions in.

---

There are other alternatives that I think are better for a newbie.

I will concede that Michael's tutorial IS GOOD, but just not good for someone brand new to ruby and rails. I find myself re-reading Rails Tutorial and The Pragprog Agile Rails book every couple of weeks, discovering new things I missed.

That's the way to learn, keep reviewing things.

Re: Rails has Two Default Stacks

#54
This is quite different form the Python frameworks ecosystem: here most "beginners" already know Python, or at least they already know how to program having experience in something like Java, C# or C++. And because they already have this knowledge, they usually ending up doing things "their own way", or they already know what each piece is supposed to do before starting to play with a framework that has all the pieces in it.

And "being explicit" rather than "convention over configuration" really helps people make their own choices. When people bump into the limits of Django's ORM, for example they quickly replace it with SQL Alchemy, when they do something in Flask, they already know what the pieces they are putting together do.

Rails culture seems very "top down", i.e. people start learning and doing things by learning the stack as a whole and then about the options for individual components. This leads to "elegant solutions", but tons of pains for beginners that need to "swallow it whole".

I don't know which way is better, but I've always been attracted to the Python ecosystem because I like learning things "bottom up", e.g. playing with all the different pieces and then assemble them into a whole once I'm confident I understand them.

Re: Rails has Two Default Stacks

#55
Interesting observations. I tried to get back into Rails last year with version 3.1/3.2 after being "away" since sometime when it was still at version 1, and while I've been somewhat successful at it, the choices -- not just between the stacks but between the myriad of different "standard" gems -- can be somewhat paralyzing. Do I use a a Twitter Bootstrap gem that will be easier to manage but might be less customizable than using "pure" Bootstrap? If I switch from ERB to Haml, do I worry about generator gems? Do I want to use Devise for authorization or just use the built-in has_secure_password? Do we love factories now, or hate them? I'm building a CMS-ish sort of thing and it'd be nice to have an automatic admin system like Django does. RailsAdmin or ActiveAdmin? Wait, these expect that I'm using Devise, unless I change something somewhere? Argh.

All of this is pretty simple once you have preferences established, but figuring out those preferences can be enough to drive you back to something that, well, has less choices. (Like the aforementioned Django, although it has its own issues with setup and documentation.)

Re: Rails has Two Default Stacks

#56
post #33

Earlier quoted context omitted.

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.

>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.

It'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.

Re: Rails has Two Default Stacks

#57

the rails community loves to introduce a dsl for every aspect. I couldn't agree more in that, for a newcomer to learn ruby, and the rails framework.. in some stacks they now have to learn haml, sass, coffeescript, and rspec.

Probably why I haven't delved into RSpec yet.

"it should send message to owner and shave whiskers from monkey. also, make my a latte."

That DSL seems like a bit much and I don't feel comfortable letting it do black magic things behings my back.

Re: Rails has Two Default Stacks

#58
post #18

Earlier quoted context omitted.

That's an important point, that Rails presumes database backing, and dynamic sites are inherently more complicated that static pages.

I think the point is that you can ease in to that with PHP - you can be as dynamic or not as you want. Many (many!) people started with PHP just to add a contact form to a site, or make a dynamic copyright date in a footer (or just to do common footers with include()). Rails/Grails/Play/CF/etc assume you want to do a lot more, and force you to do things their way - integrating a tech in to an existing site is really…

We don't disagree.

Re: Rails has Two Default Stacks

#59
post #28

Earlier quoted context omitted.

Out of curiosity, what do you dislike about rspec? While I have more than a few complaints about Rails, rspec certainly has never been one of them.

I don't like the dsl. While admittedly it is entirely a question of preference, I find it more natural to write some ruby code and then assert(something). As an example, from Hartl's tutorial we have a test dealing with microposts: subject { @micropost } it { should respond_to(:content) } I prefer writing: assert @micropost.respond_to?(:content) I haven't looked at rspec in a while and in the rspec example I don't re…

That rspec example looks like some sort of misguided language skeuomorphism. "If I name this method 'it' and this one 'should' and this one 'subject', I get something that sort of looks like English if you read it out loud while skipping the symbols! Isn't that neat?"

Well, no, it's a horrible idea, because in English those words would imply a certain syntax tree, while the actual syntax tree in your DSL is completely different, and those words have completely different roles from the ones they have in English. So you have something that superficially looks like English if you take care to arrange it just right, but in fact works in a completely different way from how you know English to work.

It's like having a picture of a sliding knob in your application, except instead of sliding it you're supposed to click it, and it's actually used as a tab switcher. And you put a denim texture on it.

Re: Rails has Two Default Stacks

#60
post #3

Using Steve's definitions from the article, the tutorial I usually point people to is Michael Hartl's Rails Tutorial http://ruby.railstutorial.org/ which uses the "Prime" stack. I believe I read somewhere that Michael was going to come out with a "37 signals" stack version as well. One message I'd like people to understand when they're starting out with Rails is that it really is confusing, and that being confused an…

I disagree that using Rails Tutorial as a beginner resource is the way to go. In fact, I used that as my first resource for learning Rails! Here are some problems I found with it: 1. It teaches you Git along with Rails. Who cares about source control at this point? Remember: This is for a newcomer to Rails that just wants to learn how to create websites using rails; don't confuse me even more. 2. It teaches you how t…

Interesting. I might be persuaded to recommend something else. What alternatives do you think are better?
Post reply on HN