Hi Dave.
schruthensis wrote:
I've just spend the better part of this 60 hour week (yes, at my job:
risking my otherwise productive neck) just trying to get rails up and
running in a way that is as "fast" and "easy" as all the hype
suggests. So hear me out for a bit on my reasons for why I'm giving
up. Perhaps somebody out there will recognize this as a desperate cry
for help and save me from committing platform suicide.
Hm. The first thing I'd say is trying to learn a completely different
language and framework while under pressure is probably always going to
be a recipe for frustration. I don't mean to belittle you, but trying to
jump into Rails in the middle of everything you're doing and expecting
to instantly be productive was pretty naive. I've been developing in one
language or another for about 14 years, and when I started learning
Rails, I took it pretty slow. I didn't thrust it into my job or make my
life depend on it. I picked up Agile Web Development With Rails and
started reading and writing. It took a little while for things to start
sinking in to the point that I was understanding what was going on. That
was almost a year and half ago. Rails isn't perfect (nothing is), but I
am *so* much happier than in any other language I've ever coded in. I
still do some PHP work, but I'd rather write in Ruby and Rails. But it
took some time.
The reasons:
1) I don't know Ruby
Learn it. It's awesome. I know there probably isn't anything that you
can do in Ruby that you can't do in some other language, but Ruby is
elegant and fun to use. In fact, over the past few days, I wrote some
Ruby/ActiveRecord code to merge data from one database into another.
Including whitespace, about 175 lines. Recursive to the point of me not
knowing what my name is, but it works. [For anyone interested, I'll be
making it available to the community soon. Maybe someone will find it
useful.] I really can't imagine trying to do the same thing in any other
language.
2) A bad experience with ruby 1.8.6 p 230 (STILL!? the most prominent
link on the rails download page)
3) Unstable documentation
a) old 1.x tutorials that don't work with the recent 2.x downloads
If you can't find 2.x tutorials (they are out there), there is nothing
stopping you from having multiple versions of Rails installed. Install
the gem for Rails 1.2.6 and generate a new app for it with
$> rails _1.2.6_ my_app
That will tell Rails to create the app using version 1.2.6. Then the
AWDWR book or all of those 1.2.x tutorials will work if you need them
to.
b) not as much of a community/following in my areas (linux,
postgres, academia)
Not sure how this is that big of a deal academia is. People from all
industries interact here and in other forums. Linux, PostgreSQL, etc,
sure, but most deploy to Linux and many use PostgreSQL (I'm one of
them). Lot's of people in this forum are extremely knowledgeable and
helpful. If you have questions/problems, ask here.
c) language barriers to entry (despite the appeal of ruby's and
rails' internationality)
d) the fact that the current best documentation is a soon-to-
obsolete book (and $54 at that!)
Agile Web Development with Rails 7 by Sam Ruby
e) the api documentation http://api.rubyonrails.org/ is
overwhelming and ugly
I use http://www.railsbrain.com and am not having any problems. I also
make regular visits to Index of Classes & Methods in Ruby 1.8.6 (Ruby 1.8.6).
f) contentious, contradicting and out of date wiki-ing
4) Auto renaming: I thought it was cool (and I obliged) until rails
renamed my "people" table to "peoples"
5) Too much abstraction? Call me old fashioned but I'm kind of
missing get and post and html forms
Methinks once the Rails way clicks in your head, you won't miss them so
much. I've been a database developer for many years (in fact, my last
full-time job was as a DBA), so I've always had my hand right in the
middle of the database. But once I got a hold of Rails' migrations, I
don't do very much in the database any more. I still write some
complicated queries every once in a while, but I let migrations hand all
the schema. You might find the same to be true for forms. If not, you
can still hand code them if you want, but boy you'd be missing out on
some ease.
6) Difficult integration with existing technologies.
b) apache: a million steps (including fastCGI) and it still
doesn't work. (I'd been using WEBRick)
FCGI is "old school". As others have noted, most people are proxying
from Apache/nginx/lighty/whatever to Mongrel. The only "challenge" with
that is the proxy configuration and the balancer if running a Mongrel
cluster, but even that isn't so hard. There are plenty of sites with
instructions. If I can figure it out, most Rails developers should be
able to as well. I have recent began using mod_rails, and it seems
promising. If you don't need anything fancy, you can also look at
LiteSpeed, which I had used for a while. But it isn't open source and
the higher performing version is not free.
c) can't use an existing schema or existing database to build
rails classes & forms (am I misunderstanding? I thought this is why
rails was supposed to be so great? Is this not possible?)
It is *possible*, but from what I hear, painful. Rails is very
opinionated. The path of least resistance is to do things the Rails way.
d) foreign keys (and the associated one to many, many to many
relationships) are not created or represented automatically in the
database or web forms when using script/generate scaffold table1
var1:string var2:integer table2_id:integer
This, I believe, is a misconception on your part. Rails will *not*
create associations automatically in the database. All of Rails
associations are enforced in the framework. You can *use* Rails to
create indexes and associations, but it's not going to happen
automatically.
This last one is the big one (the rest I'm willing to forgive for such
an otherwise apparently elegant language and environment). If i can't
easily see a compelling demonstration or working code snippet that
proves this very basic relationship functionality is even possible,
I'm not going to invest time mucking around in classes trying to learn
ruby.
Again, as someone else eluded to, "mucking around in classes" is
probably not the best way to learn Ruby.
Why not use the information present in a variable name like
table2_id? I guess I got the (incorrect?) impression that "if i could
only rename my variables differently rails would understand and create
these relationships for me! Including the corresponding necessary
drop-down/select-box functionality in the views/layouts.
Again, Rails is not going to this stuff automagically. It makes it a lot
easier, but Rails can't read your mind. Just because you have a
relationship between two tables doesn't mean you always want a drop down
list.
If someone can get me going on this last bit I just might give it
another try. If not, Its back to non-object oriented PHP and web
forms for me.
Rails isn't for everyone, but I have not yet heard anyone who gave Rails
a real, honest effort say, "I don't like this. I'm going back to XYZ."
My advice (if you are open to it) is to back up, take a deep breath, and
start over. Don't try to learn Ruby and Rails while under pressure. Work
at it on the side until you get the hang of it. And don't approach it
just like you would PHP (or XYZ). Ruby and Rails are their own beasts,
and they respond to different music than other beasts. Once you learn
the right melodies, you'll be happily soothing the beasts and reaping
the benefits of the Rails framework.
Thanks for letting me rant,
Dave
Peace,
Phillip