SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: ruby newbie

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ruby newbie

    Ive been seeing a lot of this web application technology called ruby on the rails being talked about on forums, and have subsequently been trying to find material on the web that explains what exactly is it. I hope that perhaps someone can enlighten me about it



    Q1) If you had to choose between using PHP and ruby on rails which would you choose and why?

    Q2) Can u talk to databases using ROR like PHP, if so what are the advantages over php?

    Q3) If you were to learn an object oriented language for web application development why would you choose ROR over say ASP.net or Java?


    Thanks to all that help me

  2. #2
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My view for what it is worth:

    1. Ruby is an object orientated programming language. Rails is a framework written mainly in Ruby, that provides a structured system to create web applications. You can build Ruby web application without Rails, but Rails provides a number of advantages - mainly by doing the standard repetitive stuff for you.
    2. If it was purely a choice of which system I prefer, I would always choose Ruby on Rails over PHP. I like PHP, but I love RoR. The syntax is straight forward, which makes it easier to write and easier to debug. The Rails framework gets rid of the boring bits and does those for me, leaving me to concentrate on the more interesting business logic (I do my development on a small business intranet).
      However, if performance or ease of hosting were vital parts of the project, I may well choose PHP over RoR. RoR is fast enough for most things, but PHP is still faster in my experience. Out and out performance has to be you primary concern to make the choice for PHP over RoR strong. For me the performance is fine, and the other advantages of RoR far outweigh the performance issue. And with recent clustering developments, the gap is closing.
      At the moment, the number of ISPs that will host RoR is significantly smaller than those that will host PHP. If the place you want to host your site doesn't support RoR, your choice is made for you.
    3. Integration with a database is integral to Rails. It is core to the framework. The advantages are that you only have to configure the database config once, and Rails will manage the network connection for you. You install the database, edit a single configuration file, and then let Rails worry about the database.
      Also, Rails does a very cleaver thing with database fields. Behind the scenes. If you have a table called balls, in Rails you create a Ball object to map to the table. Each field within the balls table automatically becomes a property of a Ball object. So if you want a value from the balls table field "colour", you don't have to write the code to physically get that information from the database. Instead you create a Ball object and simply look at its "colour" property. Rails grabs the information from the database and populates the Ball object seamlessly in the background.
      Rails supports a wide range of databases. MySQL is the common one used, but you can use PostGres, MS SQL, Oracle or many more.
    4. I love Ruby. It makes my programming much simpler and I save a lot of time because I can generate application quickly and maintain them easily. If I had control over the development environment, I'd choose Ruby. However, if I was making a short term career decision, I'd choose ASP.net. In the UK at least, there are a lot of job opportunities in .Net at the moment and few Ruby opportunities. There are also many opportunities for Java developers.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ReggieB View Post
    My view for what it is worth:

    1. Ruby is an object orientated programming language. Rails is a framework written mainly in Ruby, that provides a structured system to create web applications. You can build Ruby web application without Rails, but Rails provides a number of advantages - mainly by doing the standard repetitive stuff for you.
    2. If it was purely a choice of which system I prefer, I would always choose Ruby on Rails over PHP. I like PHP, but I love RoR. The syntax is straight forward, which makes it easier to write and easier to debug. The Rails framework gets rid of the boring bits and does those for me, leaving me to concentrate on the more interesting business logic (I do my development on a small business intranet).
      However, if performance or ease of hosting were vital parts of the project, I may well choose PHP over RoR. RoR is fast enough for most things, but PHP is still faster in my experience. Out and out performance has to be you primary concern to make the choice for PHP over RoR strong. For me the performance is fine, and the other advantages of RoR far outweigh the performance issue. And with recent clustering developments, the gap is closing.
      At the moment, the number of ISPs that will host RoR is significantly smaller than those that will host PHP. If the place you want to host your site doesn't support RoR, your choice is made for you.
    3. Integration with a database is integral to Rails. It is core to the framework. The advantages are that you only have to configure the database config once, and Rails will manage the network connection for you. You install the database, edit a single configuration file, and then let Rails worry about the database.
      Also, Rails does a very cleaver thing with database fields. Behind the scenes. If you have a table called balls, in Rails you create a Ball object to map to the table. Each field within the balls table automatically becomes a property of a Ball object. So if you want a value from the balls table field "colour", you don't have to write the code to physically get that information from the database. Instead you create a Ball object and simply look at its "colour" property. Rails grabs the information from the database and populates the Ball object seamlessly in the background.
      Rails supports a wide range of databases. MySQL is the common one used, but you can use PostGres, MS SQL, Oracle or many more.
    4. I love Ruby. It makes my programming much simpler and I save a lot of time because I can generate application quickly and maintain them easily. If I had control over the development environment, I'd choose Ruby. However, if I was making a short term career decision, I'd choose ASP.net. In the UK at least, there are a lot of job opportunities in .Net at the moment and few Ruby opportunities. There are also many opportunities for Java developers.
    Thanks ReggieB. I might focus on learning ASP.Net for now only because like you said there a more opportunities if you have an ASP background, but ROR sounds like something i will definitely get into later on.


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
  •