Is rails for me?


#1

I am a casual user of php, perl, and python. I am trying to learn more
about those languages.

I would like to build some data driven web-apps. I don’t much care for
perl or php. I consider perl and php to be difficult to read and
maintain.

I somewhat like python. But, I have had trouble trying to get anything
actually working with django. For me, deployment, and installation
were difficult, and it seems that the ongoing configuration boarders
on excessive. I need to maintain so many configuration files, and have
to touch each file, or restart the server every time I make a change.

I don’t know if RoR is any better. I have heard that RoR is good for
getting simple CRUD apps up and running. But, I have also heard that
everything in RoR is “magic” i.e. the developer is not really
connected to what is going on beneath the covers. I’m not sure I like
that.

Is RoR a framework, or a code generator?


#2

Django is configuration over convention framework, i.e you tell django
where everything is and where to find it.

Rails is convention over configuration, i.e there are specified places
to put your controllers, models and views, there are specified naming
conventions and methods to use.

So if you don’t like the amount of configuration in Django then you’ll
probably like Rails.

It is a steep learning curve, however, to memorise all the conventions.

Regarding ‘code generator’, the generators exist in Rails to further
speed things up. If all you want is a very basic CRUD app, then script/
generate scaffold will get you up and running in under a minute.

And with Passenger, Rails is becoming much easier to deploy.

But in the end, it is all about how you like to code and how you like
to work. So I suggest having a look at the new Rails screencast
because it gives you a pretty good idea of how things work with Rails
and then giving it a go and try to make a small app and see how you go
with it.


#3

walterbyrd wrote:

Is RoR a framework, or a code generator?

It is a framework and platform that allows you to ignore zillions of
low-level
details. When the high-level methods don’t work, you can easily write
the
low-level details yourself. For example, given an ActiveRecord model
called
Model, you can use Model.find_by_name(…) to generate and run the SQL
query
required to find a model by its name. If you need a more complex query,
you can
write Model.find(…) and put little snips of the target SQL into that
method.
If you need still more complexity, you can write Model.find_by_sql(…),
and
then put an entire customized SQL statement in there.

This concept is called a “Domain Specific Language”. Rails’s authors
have
constructed little languages out of Ruby primitives that let you stay
mostly in
Ruby while creating SQL and HTML code.

RoR offers the best of those data-driven systems you listed. And, unlike
a
Java-based solution, the Ruby language is very flexible and dynamic.
People who
switch to RoR tend not to switch back!


Phlip


#4

walterbyrd wrote:

I don’t know if RoR is any better. I have heard that RoR is good for
getting simple CRUD apps up and running. But, I have also heard that
everything in RoR is “magic” i.e. the developer is not really
connected to what is going on beneath the covers. I’m not sure I like
that.

There are many things you’ll “hear” about Rails, as with any web
framework that’s worth anything. Some may have a grain of truth, but
most are just rumors and hearsay.

Is it true that RoR is good for simple CRUD apps? Sure. But, the reason
it’s good for simple CRUD apps is that it’s good for building web apps
in general.

Ruby is a general purpose language and Rails is a set of classes and
tools build using the Ruby language. Ruby like any general purpose
language can be used to build pretty much anything your mind can
conceive. Rails simply imposes a set of conventions that help keep your
code clean and organized in order to provide a less fragile application
code base.

As far as the developer not being “connected to what is going on beneath
the covers.” The best frameworks are the ones designed to allow a
developer to concentrate on what makes their application unique. As for
me, I care very little about how my data gets translated from objects
and pushed into a database. I want that part to be as natural and simple
as possible. Nearly all application need to do that in some fashion and
is certainly not unique.

My users are going to care even less about how the data gets stored and
retrieved. If I can have a framework give me @people =
Person.find_by_last_name(“Walker”) and give me some Person objects for
anyone with the last name of “Walker” I really could care less about how
that happens under the covers. I figure smarter people than me have
figured out how to make that work well. And, this also applies to the
rest of the framework such as routing and view templates, etc.

Is RoR a framework, or a code generator?

Rails is definitely a framework. More specifically it is a “full-stack
framework.” Meaning it contains everything from the database persistence
and relational mapping to the model objects up to the presentation in
the form of views.

The fact that it has some build-in code generators is just one very
small, but important, aspect of the framework.