On Sat, Aug 2, 2008 at 1:16 PM, schruthensis [email protected] 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
Rails is the fastest way to develop a site that I know of.
Since you’re a PHP coder, look here:
http://www.phpwact.org/php/mvc_frameworks
Look at the entries in the “Modeled after” column, do you see all the
“Ruby on Rails” entries? There’s a reason for that.
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.
The reasons:
- I don’t know Ruby
I’m not aware of anyone who is born knowing Ruby. Like any other
programming language, it must be learned.
- A bad experience with ruby 1.8.6 p 230 (STILL!? the most prominent
link on the rails download page)
So try another version. Does your Linux distro not provide a stable,
secure version of Ruby? Mine does. And if you’re unhappy with your
distro’s offerings you can switch distros or compile from source. A
single bad experience with a single version of Ruby seems pretty small
potatoes to me.
- Unstable documentation
a) old 1.x tutorials that don’t work with the recent 2.x downloads
And? This seems a non-problem to me. If you’re using a 2.x Rails,
then look for the 2.x series tutorials.
b) not as much of a community/following in my areas (linux,
postgres, academia)
Blather. I use Linux and I work in academia and I haven’t ran into
any real show-stoppers. PostgreSQL works fine with Rails. Rails even
plays nice with Oracle.
c) language barriers to entry (despite the appeal of ruby’s and
rails’ internationality)
Your English seems fine to me.
d) the fact that the current best documentation is a soon-to-
obsolete book (and $54 at that!)
“The Rails Way” is the current best documentation in my opinion, and
it can be had for much less than $54, online. There’s nothing forcing
you to use the latest not-yet-released version of Rails.
http://pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition
e) the api documentation http://api.rubyonrails.org/ is
overwhelming and ugly
Overwhelming perhaps to you but it works really well for me and
thousands? of others. There are other versions of the Rails docs and
different ways to navigate it:
http://railsmanual.org/
http://start.gotapi.com/
There is also Ruby’s ri to lookup individual methods and classes.
f) contentious, contradicting and out of date wiki-ing
Wikis are a community effort. If you find a mistake please correct it
for the next person who comes along.
- Auto renaming: I thought it was cool (and I obliged) until rails
renamed my “people” table to “peoples”
Rails makes assumptions about naming conventions, but all of them can
be overridden. Learning the conventions is well worth the effort as
they will help you, otherwise you will find working against them to
be, well… work.
- Too much abstraction? Call me old fashioned but I’m kind of
missing get and post and html forms
Here’s a basic form:
<% form_tag do -%>
<%= text_field :foo, :bar %>
<%= submit_tag %>
<% end -%>
What questions do you have about it?
- Difficult integration with existing technologies.
b) apache: a million steps (including fastCGI) and it still
doesn’t work. (I’d been using WEBRick)
Mongrel is very simple to setup and works really well under Apache.
Before I used that I used Lighttpd and it works equally well. I
recently began using mod_rails and it works ok for how young it is.
Most any setup you choose can be proxied under Apache. It’s been an
overall pleasant experience for me with any setup I tried. If you
prefer a simple mod_php-like setup then try mod_rails.
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?)
We successfully wrapped a Rails app around a 4 year-old genetics
database at work, on Oracle no less. It was work, but there were no
show-stoppers to speak of. What specific problems are you having?
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
Don’t use scaffolds for anything more than dazzling your clients
during meetings.
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.
I learned Ruby reading a number of books about it. Mucking around in
classes prior to having a basic understanding of the language seems a
waste of time to me. Everyone learns their own way I guess, but I
like books.
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.
Rails does automatically create relationships for you, as you define
them in your models. The data I feed to my drop-down selects works
fine. Again, what specific problems are you having?
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.
If that’s what you want to do. After more than a decade using PHP,
and then several years with Rails, I couldn’t imagine the pain of
having to build a new site with PHP again. Rails is really that good.
Thanks for letting me rant,
Letting you? I don’t recall being asked
–
Greg D.
http://destiney.com/