Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ruby on rails
#1
So many threads about ruby but not many about rails? I've been learning it since about 10 this morning (its 9pm) and I already love it =]

As apposed to PHP.

Code:
posts = Posts.where(:name => 'Hi')

posts.each do |post|
  puts post.name
end

That would probably take 4x as many lines to write in PHP.
WhiteHat Hacker, Infection Control and HJT Team Trainee
Poppins™
Originally from: Hackforums.net
Reply
#2
4x? Lets see.

while ($row = mysql_fetch_array(mysql_query("SELECT * FROM posts WHERE name='hi'"))) { echo $row['name'] . "\n"; }

How about .25x

Suck it
[Image: TYzKF.png]
Reply
#3
(12-21-2010, 08:00 PM)Orgy Wrote: 4x? Lets see.

while ($row = mysql_fetch_array(mysql_query("SELECT * FROM posts WHERE name='hi'"))) { echo $row['post'] . "\n"; }

How about .25x

Suck it

Honestly, your reply made me laugh. If I could rep you I would.
[Image: 2dkepur.jpg]
Your girlfriend thinks I'm handsome.
Reply
#4
(12-21-2010, 08:03 PM)SehCure Wrote: Honestly, your reply made me laugh. If I could rep you I would.
Can't you rep?
Reply
#5
PHP and RoR shouldn't be compared.
RoR and SQL just don't work together. PHP is much more useful imo, very efficient.
Reply
#6
Nah you need 100 posts.


I have never heard of This language untill now.
Seems strange.
Reply
#7
(12-21-2010, 08:00 PM)Orgy Wrote: 4x? Lets see.

while ($row = mysql_fetch_array(mysql_query("SELECT * FROM posts WHERE name='hi'"))) { echo $row['post'] . "\n"; }

How about .25x

Suck it

Was about to reply and speak about the fact that you just put it all on one line =s. But its orgy ;)

@solidius -
May you explain why? I've worked with PHP a long time and its no secret its terrible at SQL.


oh and orgy you are echoing the post. The ruby script echos the post.name =]
WhiteHat Hacker, Infection Control and HJT Team Trainee
Poppins™
Originally from: Hackforums.net
Reply
#8
Whoops, fixed and edited my post.
[Image: TYzKF.png]
Reply
#9
(12-22-2010, 06:57 AM)Orgy Wrote: Whoops, fixed and edited my post.

You can still see what I mean =] The syntax is a lot cleaner than PHPs
WhiteHat Hacker, Infection Control and HJT Team Trainee
Poppins™
Originally from: Hackforums.net
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting Started With Ruby eax 7 4,691 12-13-2012, 10:03 AM
Last Post: L-Carnitine
  [Tut] How to install Ruby on Mac, Windows and Linux Jordan L. 13 7,570 12-13-2012, 07:49 AM
Last Post: L-Carnitine
  Ruby eBook sockatobi 7 2,731 12-13-2012, 07:48 AM
Last Post: L-Carnitine
  what is ruby on rails DaUB3R 3 1,822 11-01-2012, 04:20 AM
Last Post: johnnymward
  Should I Start Ruby? BreShiE 13 4,931 11-13-2011, 04:14 PM
Last Post: Speedy

Forum Jump:


Users browsing this thread: 1 Guest(s)