SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Ruby Derailed

  1. #1
    SitePoint Member
    Join Date
    Aug 2005
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Ruby Derailed

    So, I was wondering what is all this hype about Ruby on Rails ? What are the exact benefits of using this compared to other languages like PHP e.t.c

    Also who is this kind of language best suited for ? Businesses ? Or is it fit for personal use on sites as well ?

    I have heard it is much more secure than PHP and other languages. What about speed though ? Is it fairly fast or slow in your opinion ?

    Sorry for all these begginer questions just interested .

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2005
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rails if a framework, if you're going to compare it to PHP compare it to a PHP framework like CakePHP, PHPOnTrax, or Symfony. There are some benchmarks floating around comparing Django (Python), Rails (Ruby), and Symfony (PHP), Django was the fastest and Symfony was the slowest.

    Define 'secure'.

    Rails shines when it comes to databased backed websites, it powers a lot of small websites (Rails Weenie) and a few large websites (43things).

  3. #3
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ruby = slow, but usually fast enough. It doesn't matter that a script runs in 0.05 sec instead of 0.06 if you can write it in half the time. In Ruby you think at a higher level than PHP. You don't need to think about details that don't matter. Map, for example:

    Code:
    arr.map{|e| e * 2}
    or:

    Code:
    $newarr = array();
    foreach($e in $arr){
      $newarr[] = $e * 2;
    }
    return $newarr;
    The first (Ruby) version is easier to understand and shorter to write. Ruby is optimized for programmer performance rather than execution speed.

  4. #4
    l 0 l silver trophybronze trophy lo0ol's Avatar
    Join Date
    Aug 2002
    Location
    Palo Alto
    Posts
    5,329
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by coconutx
    Also who is this kind of language best suited for ? Businesses ? Or is it fit for personal use on sites as well ?
    Both. A lot of personal sites are using Ruby on Rails now, but there are a lot of bigger commercial sites, too. Though you probably won't see it making a huge splash in the enterprise world, at least not yet. That's typically still the realm of Java, .NET, etc.

    Quote Originally Posted by coconutx
    I have heard it is much more secure than PHP and other languages.
    Security is in the eyes of the beholder. True, some languages might be slightly more secure via its natural syntax and things you can do with it, but in nearly every case the weakest link is the programmer. As a programmer it's your responsibility to make sure your code is safe and secure, and that remains true no matter which language you choose.

    Quote Originally Posted by Fenrir2
    The first (Ruby) version is easier to understand and shorter to write. Ruby is optimized for programmer performance rather than execution speed.
    As my profressor used to say: human time is far more expensive than computer time. In other words, unless you're building something where those hundredths or tenths of a second really matter (which is few and far between), you're far better off picking whatever you're most comfortable and productive coding in.

  5. #5
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    Alkmaar, Netherlands
    Posts
    710
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can tell why I prefer ruby over php;

    I write less code and understable code (so when I go back to my code 6 months later, I do not get lost).
    I can maintain mine(and others code) much better because rails style development.
    I enjoy writing it because ruby( and rails) is a beautiful language(framework).
    Rails makes testing easily(from unit testing to functional testing)

    It is not Rails related but since I started using Rails I started using Subversion and unit testing again which is a fantastic improvement.

    I should not forget Capistrano that makes deployment piece of cake.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •