Live data from Hacker News

Rails has Two Default Stacks

words.steveklabnik.com

81–90 of 93 posts

Re: Rails has Two Default Stacks

#81
post #13

Earlier quoted context omitted.

One of the things that got me thinking about this was the recent security issues. I was helping people on Skype upgrade their apps, because they were new, and they got into Gem Version Hell. Only pulling in fancy gems when you need it helps when you _really_ need to upgrade, and you're not stuck figuring out why twitter-bootstrap-rails, therubyracer, and libv8 (in this example, obviously, it could be any combination…

> twitter-bootstrap-rails, therubyracer, and libv8 Those three gems recently caused me a world of pain. I've been in and out of Rails development since the 1.x versions (more hobby projects than professional development), and once getting going was as simple as 'gem install rails'. Getting the asset pipeline to work changed that totally - I get the advantages of the asset pipeline, and once you get it working and all…

Same here. In aggregate, I must have spent at least a two full days getting therubyracer and libv8 working in various environments.

As a recent Java refugee, one of the things I find most painful about Rails is its dependence on native code libs. It's really a lot of work to get the dependencies sorted out, especially if you have several platforms to support (say OSX for dev, and multiple Linux flavors for staging/prod).

One thing I learned (the hard way) is to heed the advice that "rvm requirements" offers. If you install the libs that it recommends before trying to install your gems, things will go more smoothly. This may sound obvious, but when you're installing Ruby, RVM, Rails, Apache, etc, it's easy to overlook the instructions.

Re: Rails has Two Default Stacks

#82
post #44

Earlier quoted context omitted.

We've taught hundreds of beginners new to Rails, and we've found that beginners want to learn about all the alternatives - it's like they have to survey the entire landscape before starting. No matter if we're teaching TestUnit or Rspec, someone will ask about the alternative. It's so easy to get side-tracked into evaluating alternatives and just get overwhelmed with the options. What we've found works is this: 1. Be…

> 1. Beginners need a curated stack by someone they trust. "Here, this is the stack to learn from; stop wasting time evaluating and get started." That's supposed to be what Rails itself IS, right? Isn't that the point of it being "opinionated", it's supposed to BE the curated stack from someone you trust. If it's failing, that's a problem. It certainly is frustrating when you're trying to get the actual Rails stack t…

My point is that it doesn't matter much which stack you pick. The default stack is not failing. The fail is being overwhelmed by choice, when it doesn't matter in the beginning. What matters most is having a good teacher, who choses a stack for you to learn with.

Once you develop your own taste, then you can refine the specifics. But don't get stuck with analysis paralysis in the beginning.

Re: Rails has Two Default Stacks

#83
post #60

Earlier quoted context omitted.

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?

Consider "Rails for Zombies"[0].

[0] I teach/tutor Rails programming, and my students have found this resource particularly helpful.

Re: Rails has Two Default Stacks

#84
post #60

Earlier quoted context omitted.

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?

Consider "Rails for Zombies"[0].

[0] I teach/tutor Rails, and my students have found this resource particularly helpful.

Re: Rails has Two Default Stacks

#85
This is a good post showing me once again how Rails evolved. I am also using rather the so called prime stack and I am wondering that the prime stack is not the default stack. For me it's total obvious to use HAML over ERB and Postgres over MySQL and I don't get why these choices aren't recommended by being default. Even CoffeeScript which has a wide acceptance and adoption is something where no clear opinion arose if it should be in the default stack or not. It offers many benefits but can bring also some heavy implications to your web app (I don't want to start a discussion about CoffeeScript here).

However, I think that Rails is not a good start for beginners in web development. On the one hand it's guiding you very well through its strick conventions and teaching you very good structuring your app (MVC- and OO-wise) but on the other hand all those abstractions and magic make you dumber. Without a big framework like Rails you try to think yourself how to solve a problem like getting the data from A to B. With Rails instead you just have to follow the respective Rails convention and voila you are ready to go. Finally, you learn Rails design patterns and best practices (or conventions) without understanding why you are doing this. And since the default stack is by far not the recommended stack makes it even worse. Because the newbie is in the beginning too afraid to leave the default track. Giving him the option "to just remove one line" to get to his preferred stack is the wrong answer because if there's a default stack people in particular the beginners assume that this must be the right way to do stuff and spent too much time fiddling around with ERB, MySQL, CoffeeScript, etc. Instead it would be better to offer a modular approach like Express, Sinatra, Web.py. I know that I can have the same modularity with Rails too but a beginner gets another message and Rails also wasn't meant being a full stack framework where -- we remember -- "convention is always over configuration" and thus also over modularity.

And even for advanced programmers I believe that Rails' time is over: the monolithic approach is so 2005 and I realize nowadays that I just want to start quickly something without an ORM, Coffee, etc. and decide later if I add those amenities.

Maybe we are facing a new generation of web development where full stack frameworks have no space anymore and David should rethink his Rails approach.

Re: Rails has Two Default Stacks

#86

Someone told me earlier today that 'Starting Rails today is like starting to watch a soap opera in the 7th season.' Like most witty statements, there’s both truth and falsehood here. But, as a newcomer, how do you pick between the 37signals Stack and the Prime Stack? How many parts of Rails can you swap out before it stops being Rails? Maybe the simplest solution here would be to call the Prime Stack something differ…

Edit: I don't to sound like a contrarian or prove anyone wrong or something. I'm certainly not the person to do that. I just read some of the comments here that seem to overestimate the distance between the two stacks in the article.

The stacks in the article aren't very different and few of the comments here seem to reflect that.

Erb vs Haml? Not much of a switching cost, especially since they can be used in the same project without sweat. One is HTML with tags, the other is a less familiar nested syntax to generate markup.

Mysql vs Postgres? For most CRUD, the same Active Record queries pretty much work, and the shortcomings are due to Active Record being underwhelming compared to its alternatives. Someone that cargo cults Mysql vs Postgres probably isn't locking their schema/queries into one or the other because staying close to Active Record doesn't really let you do that.

Minitest vs Rspec? Tests would be annoying to rewrite, but testing layer differences don't really distinguish a Rails app. Especially since you can write almost line for line equivalent code in Minitest and Rspec.

Fat models & skinny controllers vs skinny models&controllers + service layer? Here's the first real difference on the list because it actually changes the design of the system, not some ancillary component.

So,

    > How many parts of Rails can you swap out before it stops being Rails?
I think we can stow this question away until there are more divergent, popular alternatives to the default stack which I'm looking forward to in time.

For instance, I think we will start seeing more deliberate functional designs that decouple models from Rails (to make testing not suck, for one). And I wish Active Record alternatives were far more popular in the Rails community.

Re: Rails has Two Default Stacks

#87
post #85

This is a good post showing me once again how Rails evolved. I am also using rather the so called prime stack and I am wondering that the prime stack is not the default stack. For me it's total obvious to use HAML over ERB and Postgres over MySQL and I don't get why these choices aren't recommended by being default. Even CoffeeScript which has a wide acceptance and adoption is something where no clear opinion arose i…

"all those abstractions and magic make you dumber"

It was the opposite for me. I had been doing java and php web dev for a few years before rails was created. The first time I used rails (before the 1.0 release), all those abstractions were a revelation. I realized, oh, I've never seen software structured this well before, and it immediately expanded my understanding of how code should be structured.

"the monolithic approach is so 2005 and I realize nowadays that I just want to start quickly something without an ORM, Coffee, etc. and decide later if I add those amenities"

Software isn't fashion. First, in rails you can start quickly and not use an ORM or coffee. I've written a whole lot of web apps in ruby over the years. Many in rails and many in sinatra. In my experience, most of the times I used sinatra I eventually wished I had just used rails because I nearly always wanted many of the rails features over time and putting all the pieces together myself was not the best use of my time. There has only been one case where a rails app I wrote should have been a sinatra app.

Re: Rails has Two Default Stacks

#88
post #87
post #85

This is a good post showing me once again how Rails evolved. I am also using rather the so called prime stack and I am wondering that the prime stack is not the default stack. For me it's total obvious to use HAML over ERB and Postgres over MySQL and I don't get why these choices aren't recommended by being default. Even CoffeeScript which has a wide acceptance and adoption is something where no clear opinion arose i…

"all those abstractions and magic make you dumber" It was the opposite for me. I had been doing java and php web dev for a few years before rails was created. The first time I used rails (before the 1.0 release), all those abstractions were a revelation. I realized, oh, I've never seen software structured this well before, and it immediately expanded my understanding of how code should be structured. "the monolithic…

Regarding your first point: but you weren't a beginner anymore when you discovered Rails. You knew before how to control a raw DB without an ORM, you understood the basic structure or components of a webapp. And I still believe that those abstractions are also for a pro too heavy, hiding too much away, making web apps unnecessary complex.

"First, in rails you can start quickly and not use an ORM or coffee."

But a beginner can't and even for advanced people I wouldn't call the rampup time for a Rails app "quickly" anymore, those times are gone for a long time.

"I used sinatra I eventually wished I had just used rails"

Maybe you should give Express/Node a try -- the ecosystem paired with Node's modularity makes me much faster than with Rails and maybe you realize how slow you have been Rails, before.

Re: Rails has Two Default Stacks

#89
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…

Micheal's Rails Tutorial was my first step in to Rails. I took Micheal's suggestion in the tutorial and spent a few days getting the basics of Ruby.

What Micheal focuses on is teaching you a few things he considers essential to the Rails ecosystem - git, Heroku and RSpec ( He mention the Test::Unit alternative too). I have learnt a lot from his tutorial and this is where I point others new to Rails to go to.

Also, it is better to get acquainted with git while working on a (dummy) project than trying its commands in a vacuum where one doesn't understand its power.

Re: Rails has Two Default Stacks

#90

The prime stack is going to have some real problems as Rails 4 goes threadsafe by default, as haml isn't threadsafe. I guess this won't be a problem for those on process-based servers, but it's going to be an issue for those embracing multi-threaded app servers.

In all fairness, Haml should be rewritten one day. It is fantastic to use, but its internals are not so clean.
Post reply on HN