SitePoint Sponsor

User Tag List

Results 1 to 22 of 22

Thread: Ruby vs PHP

  1. #1
    SitePoint Enthusiast Kanustep's Avatar
    Join Date
    Jul 2005
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Ruby vs PHP

    I'm a newbie in this topic of Ruby programming, I would like to know the main diferences about Ruby and PHP.

    Which one has more features?
    Which one is more fast to learn?
    Which one is more fast? Or prevent overload of server?
    Which DB works for Ruby?
    What are the main advantages to all the rest of the web languages?

    Have anyone installed Ruby and PHP in your server and can both run great on a normal server?

    Anything you want to say about php or ruby I would like to know, if this new language will be a great deal to learn.

    Thanks in advance!

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    1. They have about the same feature set, but PHP started out as a mostly-web language whereas Ruby started out as a more general-purpose scripting language (like Perl).
    2. Either one is pretty easy to pick up. You can have something simple working in a matter of hours.
    3. PHP is faster for now, but Ruby will catch up.
    4. MySQL, SQLite, PostgreSQL, SQL Server, Oracle, and DB2 are all currently working, with others coming aboard soon.
    5. I find Ruby pretty intuitive, and the Rails framework eliminates a lot of manual coding you'd do in other languages and even with other frameworks like Java's Struts.
    6. Yes I've installed both. They can coexist peacefully. Case in point: most hosting companies that run Ruby hosting also have PHP, Perl, and Python available on the same server.

  3. #3
    SitePoint Enthusiast Kanustep's Avatar
    Join Date
    Jul 2005
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you!
    Could you tell me a nice server specifications that you have to run both without much trouble?

  4. #4
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I seriously think you should read the "What is Ruby..." thread otherwise this one is going to start treading much trodden ground very quickly!

    Vinnie makes the main points. Its important to remember that Ruby isn't a "web" language, its a general purpose scripting language that can have many languages, but it can be used for websites, either embedded into HTML (like basic PHP) or using a full web framework, the best and most well known of which is Rails (there are others, but Rails is THE web framework for Ruby).

    If you are running a linux/unix-based server, Ruby is a cinch to install if your distro has good package management, though getting up and running with a web server (either Apache or lighttpd) is a little trickier. When it comes to Rails though, it has the built in Ruby Webrick server which can be started from the console and is great for development/testing.

  5. #5
    SitePoint Enthusiast Kanustep's Avatar
    Join Date
    Jul 2005
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where is that thread?

  6. #6
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.sitepoint.com/forums/showthread.php?t=301870

    Off Topic:

    (No, I'm not using Ruby (seriously), I seem to have just gotten lost on the downtown streets of SP and ended up in the Ruby forum.)

  7. #7
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by someonewhois
    Off Topic:

    (No, I'm not using Ruby (seriously), I seem to have just gotten lost on the downtown streets of SP and ended up in the Ruby forum.)
    Off Topic:

    It's a bad neighborhood. Can I interest you in 20.times do { happiness }?

  8. #8
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vgarcia
    Off Topic:

    It's a bad neighborhood. Can I interest you in 20.times do { happiness }?
    Off Topic:

    I can't say I'm too interested in Ruby at the moment, in all honesty. It sounds as if it's an amazing language that was built with.. you know.. logic? PHP's disgusting with the argument calls.

    I think it's a tad bit overhyped. I don't like jumping on the bandwagon so early. Plus there really aren't many jobs asking for Ruby, and the way I learn languages, I shouldn't have too much difficulty picking it up when I need to.

    Enjoy your little forum though.

  9. #9
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by vgarcia
    Off Topic:

    It's a bad neighborhood.
    50% anyway.
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  10. #10
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by someonewhois
    Off Topic:

    overhyped
    Guys, he's obviously been using Ruby because that's the only way he could know if it is overhyped or not.
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  11. #11
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    Oklahoma
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by samsm
    Guys, he's obviously been using Ruby because that's the only way he could know if it is overhyped or not.
    I don't think Ruby has really been hyped that much at all, it's all about Rails. For good or bad Rails has done some serious amounts of marketing for an open source project. Now that some of that is settling in, a lot of people are looking past Rails and seeing Ruby for what it is. I'm really excited to see what this influx of new people will contribute to the already impressive Ruby community.

  12. #12
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree. Rails has had a lot of hype. Most of it is justified. But outside of the Rails camp, where is all the Ruby hype?

  13. #13
    SitePoint Member
    Join Date
    Mar 2002
    Location
    Chicago, IL USA
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    I've programming PHP for 5-6 years and have just started to learn Ruby.

    I'm a blogger on CodeSnipers and I've written my experiences contrasting PHP and Ruby and others have opinions as well:

    http://codesnipers.com/?q=taxonomy/term/15

    If you wonder if you should switch to Ruby read Duane Gran's article entitled
    A Guide for Changing Programming languages
    http://codesnipers.com/?q=node/30&&t...ming-languages



  14. #14
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    For me, Ruby was very quick to set up. I made my first "Hello World" app in about 10 minutes. The installation was really easy and came with a pre-configured IDE which is a good idea for somebody just starting out. Earning my Ruby badge was easy.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  15. #15
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    Alkmaar, Netherlands
    Posts
    710
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ruby is beautiful language (yeah I know I talk as if it is my gf and with RubyOnRails it becomes such a joy to write programs.

    Attached: part of business logic for members
    Attached Images Attached Images

  16. #16
    SitePoint Wizard Young Twig's Avatar
    Join Date
    Dec 2003
    Location
    Albany, New York
    Posts
    1,355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by someonewhois
    Off Topic:

    Plus there really aren't many jobs asking for Ruby
    And there are a lot of jobs asking for PHP? Everything I see is .NET or Java.


    Quote Originally Posted by someonewhois
    Off Topic:

    and the way I learn languages, I shouldn't have too much difficulty picking it up when I need to.

  17. #17
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Young Twig
    And there are a lot of jobs asking for PHP? Everything I see is .NET or Java
    That's because companies hire .NET and Java programmers and then place them on PHP jobs I'm not kidding. It happens at the company I work for.

  18. #18
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Young Twig
    And there are a lot of jobs asking for PHP? Everything I see is .NET or Java.
    Mostly true. However, I know one company in town that does PHP almost exclusively, unless a client has another type of system in which case they contract out the work.

  19. #19
    SitePoint Wizard Young Twig's Avatar
    Join Date
    Dec 2003
    Location
    Albany, New York
    Posts
    1,355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vgarcia
    Mostly true. However, I know one company in town that does PHP almost exclusively, unless a client has another type of system in which case they contract out the work.
    Oh, I'm not denying there's PHP work out there. I've seen the occasional PHP opportunity in Texas or somewhere. I'm just saying if you're picking a language based on job requirements, PHP isn't the best choice, either.

    Maybe it's different in Canada.

  20. #20
    SitePoint Wizard mark_W's Avatar
    Join Date
    Mar 2004
    Location
    West Midlands, United Kingdom
    Posts
    2,631
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Young Twig
    Oh, I'm not denying there's PHP work out there. I've seen the occasional PHP opportunity in Texas or somewhere. I'm just saying if you're picking a language based on job requirements, PHP isn't the best choice, either.

    Maybe it's different in Canada.
    Ive seen loads of PHP jobs around over here but I agree with what you are saying about PHP not being the best to pick on job requirements.

  21. #21
    SitePoint Wizard Young Twig's Avatar
    Join Date
    Dec 2003
    Location
    Albany, New York
    Posts
    1,355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm... I should move.

  22. #22
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Young Twig
    Hmm... I should move.
    Miami/Fort Lauderdale seems to have a pretty big PHP market too. A look on monster came up with quite a few jobs last week, maybe 1/3 to 1/2 of the numbers for Java or .NET.


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
  •