Ask HN: Ruby on Rails why the hype?
1–10 of 29 posts
Re: Ask HN: Ruby on Rails why the hype?
#2Re: Ask HN: Ruby on Rails why the hype?
#3Re: Ask HN: Ruby on Rails why the hype?
#4Why ROR? Speedy development, fun programming language, easy to build, test, iterate, repeat etc. Easy to migrate DB's, lots of scaffolding to reduce amount of code you need to write. Tons of great plugins written for the stack, very active community, some incredibly talented developers work on the stack.
ROR is perfectly suited for building out a great web app, quickly. And yes, it does scale ;)
Re: Ask HN: Ruby on Rails why the hype?
#5The intention behind the design of ActiveRecord is that the db access logic is done automagically and you can make AR models your domain model.
The recent trend of adding various finders, etc. to AR models blurs the conceptual clarity a bit. Some plugins also blur this clarity.
Generally you should be able to use AR models as business objects, just be aware that there might be a few other behaviors added on that aren't strictly part of the business rules. This might irritate some people.
You are certainly free to write your business logic as separate classes as you see fit. Rails doesn't tell you not to. It just offers a convention that is often very reasonable for most peoples' needs.
Re: Ask HN: Ruby on Rails why the hype?
#6cookies[:remember_token] = { :value => user.id, :expires => 20.years.from_now.utc }
Do exactly what you think they will, without having to define everything. That's the "magic" behind rails. It let's you focus on the application rather than the framework.
Re: Ask HN: Ruby on Rails why the hype?
#7Where they differ, and this is from my experience (feel free to correct me) is that in MVC, the Views have an attachment to the Controllers. Basically a view can only have one controller. Views can have multiple partial views, but ultimately belong to one controller. In the n-tier system, the view can be abstracted to the point where it does not care what is going to be shown.
Once you wrap your head around MVC, it is hard to go back, especially for Web products.
ROR also takes care of a lot of your db schema and logic, so you can focus on programming, not writing CRUD statements.
Re: Ask HN: Ruby on Rails why the hype?
#8Re: Ask HN: Ruby on Rails why the hype?
#9I think the problem is that you're looking at "code samples", which tend to be the simplest possible examples. One of the nice things about RoR is that a model class can be as short as two lines:
class MyModel
and everything else happens by "magic". Our system has a few classes like that. OTOH, we also have model classes with thousands of lines of complicated business logic. But, showing those to someone trying to learn RoR would just overwhelm them.Re: Ask HN: Ruby on Rails why the hype?
#10By the way: the Rails hype was 3 years ago. Now, its just one implementation of the same concept like all others.