Jump to content

Ruby On Rails


unsider

Recommended Posts

Anyone use it? I'm reading about it now, and I'm frankly loving it.

 

Opinions, comments...?

I haven't looked very much into it, but based on the little amount of time I've spent with it, it seems really good framework.

 

The only thing the ruby(the language) has that i like it i believe better OOP support(not 100% sure tho).

That depends on what you're looking at. Although "everything is an object" and such, there is no support for interfaces or abstract classes for instance.

 

I am just wondering, what about ruby on rails do you like that PHP can not do?

That question doesn't make sense. What can a car do that a banana cannot?

Link to comment
Share on other sites

I have been working with rails for almost two years total and the past year almost exclusively. The ruby language and the rails framework are, for lack of a better term, elegant. However, one of the biggest draw backs is the performance. As with most things, you end up giving up performance for convenience.

 

One of the main things that attracted me to rails was the fact that it is extremely easy to scale an application up/down depending on the current load requirements. As with most frameworks, it will also drastically cut back on the overall development time for an application. With experienced developers, you can develop complex applications in a relatively short period of time. With hardware being cheaper than man hours it makes a lot of sense from a business point of view.

 

 

btw, checkout http://railscasts.com

Link to comment
Share on other sites

Anyone use it? I'm reading about it now, and I'm frankly loving it.

 

Opinions, comments...?

I haven't looked very much into it, but based on the little amount of time I've spent with it, it seems really good framework.

 

The only thing the ruby(the language) has that i like it i believe better OOP support(not 100% sure tho).

That depends on what you're looking at. Although "everything is an object" and such, there is no support for interfaces or abstract classes for instance.

 

I am just wondering, what about ruby on rails do you like that PHP can not do?

That question doesn't make sense. What can a car do that a banana cannot?

 

first of all do you mean ruby does not support abstract classes and interfaces?

 

my last question is really what can ruby do that php can't?  why would you want to use ruby over php?  why use ruby on rails compared to a similar php framework?

Link to comment
Share on other sites

Example:

 


<?php
$array = array('my list', 'of', 'items');
for ($index = 0; $index < count($array); $index++) {
  echo "$index. $array[$index]";
}

// RAILS

$array = array('my list', 'of', 'items');
foreach ($array as $index => $item) { echo "$index. $item"; }
?>

 

Saves you hours of development time, and effecient code structure.

Plenty of comparisons, google: rails vs. php

I'm sure there are things that you can do with one an not the other, vise-versa, but that I do not know at this moment.

The biggest pain in the ass would be switching over, and essentially rewriting your code/learning a new language. This switch is where the time truly is a factor, but after you figure it out, true effeciency begins.

 

Although opinion could be a factor here.

 

Link to comment
Share on other sites

Plenty of benefits though:

 

such as ActiveRecord’s ability to dynamically introspect all the fields of a table and have all the functionality needed to create, update, delete, and read any row of data automatically with one line of code ... PostgreSQL, MySQL, Oracle, etc

 

concept of organization - MVC

 

Less repetition.

 

etc...

 

Just do some reading, if you're not impressed then there is no reason to explore, but to write it off because you think there nothing better than PHP out there is just nieve and foolish.

 

;)

Link to comment
Share on other sites

Plenty of benefits though:

 

such as ActiveRecord’s ability to dynamically introspect all the fields of a table and have all the functionality needed to create, update, delete, and read any row of data automatically with one line of code ... PostgreSQL, MySQL, Oracle, etc

 

concept of organization - MVC

 

Less repetition.

 

etc...

 

Just do some reading, if you're not impressed then there is no reason to explore, but to write it off because you think there nothing better than PHP out there is just nieve and foolish.

 

;)

 

my php framework is MVC and provides ActiveRecord capability like $model->save();  I am not saving that ruby is better than php nor php is better than ruby(however the php syntax is a lot clean imo but i come from a C++ background), if you know one a like it than stick with it but i see not reason from going from php to ruby or vice versa if you know one but not that other.

Link to comment
Share on other sites

That's the problem, I'm not far enough into it yet. I don't know exactly what you can/cannot do PHP/Rails. As much as I know both have their positive/negative, most pretaining to databases, classes, and objects, and shear repetition. I can't fully support my arguement yet, but give me time, I'm still exploring.

 

Link to comment
Share on other sites

my php framework is MVC and provides ActiveRecord capability like $model->save();  I am not saving that ruby is better than php nor php is better than ruby(however the php syntax is a lot clean imo but i come from a C++ background), if you know one a like it than stick with it but i see not reason from going from php to ruby or vice versa if you know one but not that other.

 

It's cool, I'm not saying you should switch, but atleast giving it a look is a MUST, but I 100% agree with: 'stick with what you know'. I personally love PHP syntax, but the repetition can be a pain, and my current organizational method is less than suffecient. Either way, I'm drifting from  my point, check it out if you haven't.    

Link to comment
Share on other sites

Anyone use it? I'm reading about it now, and I'm frankly loving it.

 

Opinions, comments...?

I haven't looked very much into it, but based on the little amount of time I've spent with it, it seems really good framework.

 

The only thing the ruby(the language) has that i like it i believe better OOP support(not 100% sure tho).

That depends on what you're looking at. Although "everything is an object" and such, there is no support for interfaces or abstract classes for instance.

 

I am just wondering, what about ruby on rails do you like that PHP can not do?

That question doesn't make sense. What can a car do that a banana cannot?

 

first of all do you mean ruby does not support abstract classes and interfaces?

Yes.

 

Example:

 


<?php
$array = array('my list', 'of', 'items');
for ($index = 0; $index < count($array); $index++) {
  echo "$index. $array[$index]";
}

// RAILS

$array = array('my list', 'of', 'items');
foreach ($array as $index => $item) { echo "$index. $item"; }
?>

A better example would be:

arr = ['my list', 'of', 'items']
arr.each { |item| print item }

or

arr.each do |item|
  print item
end

In this instance

print arr.join

would be better though.

Link to comment
Share on other sites

A better example would be:

arr = ['my list', 'of', 'items']
arr.each { |item| print item }

or

arr.each do |item|
  print item
end

In this instance

print arr.join

would be better though.

 

That code is why i don't understand why people say ruby is more elegant.  I guess it is more of a preference but

foreach($arr as $item)
{
    echo $item;
}

is much easier to understand than

arr.each do |item|
  print item
end

 

one thing i do like about ruby that pisses me off about php is that both strings and array are object in ruby.  That also leads to the all the string/array functions with not standard naming/parameter order but that is something i have learned to deal with.  With php 5.3 I will also having some of the features i wanted that ruby i believe has(late static binding and name spacing mostly).

Link to comment
Share on other sites

Although I love ruby and the rails framework this has almost nothing to do with php. btw, you could also do:

 

arr.each {|item| puts item}

 

That example does the exact same thing as the first and only contains 24 characters. The php example is well over 30. That is a very simple example but overall I find that I write 30%(or so) less code.

 

Anyone that says "Show me what ruby can do that php can't" simply doesn't understand ruby. Several of the most popular php frameworks were based off of rails. That has to mean that they did something right, right? Most things in ruby can be replicated with php(checkout cakephp's credits and php on trax) but most of the time they will result in 20% to 30% more code.

 

With that being said this is not a ruby or a rails forum. Maybe this discussion would be better served else where. If you really want to find out what can be done with ruby/rails, drop by #rubyonrails on irc.freenode.net and ask them "What can ruby do that php can't" :P.

 

Link to comment
Share on other sites

Anyone that says "Show me what ruby can do that php can't" simply doesn't understand ruby. Several of the most popular php frameworks were based off of rails. That has to mean that they did something right, right? Most things in ruby can be replicated with php(checkout cakephp's credits and php on trax) but most of the time they will result in 20% to 30% more code.

 

Well I would rather do some extra coding once to get a "RoR Feature" than having to read code that a is bit more cryptic.

Link to comment
Share on other sites

Anyone that says "Show me what ruby can do that php can't" simply doesn't understand ruby. Several of the most popular php frameworks were based off of rails. That has to mean that they did something right, right? Most things in ruby can be replicated with php(checkout cakephp's credits and php on trax) but most of the time they will result in 20% to 30% more code.

 

Well I would rather do some extra coding once to get a "RoR Feature" than having to read code that a is bit more cryptic.

 

Like Daniel said, you know the language well, it's not cryptic. It is very similar to Python, if any one here has ever coded in that.

Link to comment
Share on other sites

Anyone that says "Show me what ruby can do that php can't" simply doesn't understand ruby. Several of the most popular php frameworks were based off of rails. That has to mean that they did something right, right? Most things in ruby can be replicated with php(checkout cakephp's credits and php on trax) but most of the time they will result in 20% to 30% more code.

 

Well I would rather do some extra coding once to get a "RoR Feature" than having to read code that a is bit more cryptic.

 

Like Daniel said, you know the language well, it's not cryptic. It is very similar to Python, if any one here has ever coded in that.

 

http://xkcd.com/353/

Link to comment
Share on other sites

Anyone that says "Show me what ruby can do that php can't" simply doesn't understand ruby. Several of the most popular php frameworks were based off of rails. That has to mean that they did something right, right? Most things in ruby can be replicated with php(checkout cakephp's credits and php on trax) but most of the time they will result in 20% to 30% more code.

 

Well I would rather do some extra coding once to get a "RoR Feature" than having to read code that a is bit more cryptic.

 

 

Like Daniel said, you know the language well, it's not cryptic. It is very similar to Python, if any one here has ever coded in that.

 

http://xkcd.com/353/

 

Oh yeah, one for Rails:

 

http://poignantguide.net/ruby/chapter-7.html

 

The author is clearly insane.  ;D

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.