Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Jamny
Jun 15, 2001

Flux Regulated

epswing posted:

I just want to make a quick note here.

RonaldMcDonald's php code is less than 15 lines of simple, easy-to-follow php.
Novo's ruby/rails code is almost 30 lines spread across 4 files (and ends his post with "Simple." :v: ).

If you've never heard of MVC or haven't used any web frameworks before you may think that Novo is nuts. He's not. Although the ruby he posted is definitely more complicated structurally than the equivalent non-framework php, this is actually how anything larger than a very simple dynamic website should be done, with presentation (html) separate from logic (db access et al).


Edit: I know almost nothing about ruby or rails, but something that keeps me from diving in head first is...well, the concept of automated db access in general. Am I really going to let something write my sql for me? I really enjoy hammering out a nice query that does exactly what I need it to do, complete with inner/outer joins, unions, subselects, likes, ins, and whatever else is necessary with the appropriate indexes. For simple "select * from table where col=value" queries fine, do it for me, I won't mind. But for anything complex, can I take over? I know Hibernate allows me to take over when necessary. I don't yet trust the efficiency of a cruise controlled database.

Yes, there is a Person.find_by_sql method, among other things you can do to tweak the underlying SQL queries.

In general you don't need to, as long as you use sensible indexes for the types of queries you know rails will be doing for you.

Adbot
ADBOT LOVES YOU

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply