The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Ruby Programming
|
Ruby vs Other scripting languages
Discuss Ruby vs Other scripting languages in the Ruby Programming forum on Dev Shed. Ruby vs Other scripting languages Ruby and Ruby on Rails programming forum covering Ruby Tips and Tricks, Best Practices, and agile development with Ruby on Rails.
|
|
 |
|
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

December 21st, 2005, 04:08 PM
|
 |
Contributing User
|
|
Join Date: Jun 2003
Posts: 418
  
Time spent in forums: 2 Days 13 h 53 m 25 sec
Reputation Power: 11
|
|
|
Ruby vs Other scripting languages
Hi,
I'm just wondering what the advantages of programming web apps in Ruby are compared say PHP, Python and Perl?
I did a google search and I can't really find a decent answer.
All O know right now is that Ruby is easy to develop in. Before that it was all about PHP being easier to develop in than Perl, which is why I prefer PHP to perl.
Is Ruby good for text parsing? Computations?
|

December 21st, 2005, 04:17 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
The advantage is not really because of the ruby language itself, but mainly because of the Ruby on Rails framework engine. There are framework engines in other languages (Perl's Mason is what we use (there are others as well) and Python has more than one engine, there's even a couple for PHP) as well, but the Rails framework is particularly impressive in terms of what you can do with it and how quickly you can do it.
http://www.rubyonrails.org/
Efficiency of the framework is assumed to be of secondary importance, of course. On the plus side, look at the speed you can develop things with the Rails framework:
* A Blogger Application in 15 minutes
* A Flickr style album in 5 minutes
http://www.rubyonrails.org/screencasts
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
|

December 28th, 2005, 08:28 PM
|
|
|
|
I do think there is an advantage to the language of Ruby itself (at least over PHP). I am currently only able to develop in PHP and a bit of Perl, but am learning Ruby. It is a much more 'natural' language, has the ability to be organized a bit easier, and makes everything an object.
I am not a programmer by trade, but have learned programming out of necessity. I am really excited to get into Ruby more (even outside of Rails).
|

December 29th, 2005, 12:43 PM
|
|
Contributing User
|
|
Join Date: Feb 2004
Location: London, England
|
|
I cannot speak for Perl and PHP, but IMHO Ruby and Python are pretty evenly matched. Some things are done better in Ruby, some are better in Python. There is a good article by Ian Bickering that lays out a point-by-point comparison between the two languages.
Personally I am sticking with Python until I have a good reason to change, for the following reasons:
1) Python is significantly faster, and has several options for further speedups if required (e.g. Pyrex, Psyco).
2) Python has much better support in terms of libraries, tools, documentation, books etc - it is simply much more mature. Ruby is catching up fast though.
3) Python lets you define default parameters for methods and to name parameters in the calling code. This simplifies a lot of things, and can make the code much more readable.
4) functions and methods are real objects in Python - you can pass them around and get their attributes.
5) I get paid for programming in Python.
Don't get me wrong, I like Ruby a lot. But I like Python more.
Dave
|

January 25th, 2006, 03:17 PM
|
|
Contributing User
|
|
Join Date: May 2004
Posts: 162
Time spent in forums: 16 h 17 m 55 sec
Reputation Power: 10
|
|
|
I've been a full time perl programmer for 5 years. I've helped to develop large stand alone applications and large web applications, all of which were very database intensive. Over the last several years I've had to do alot of maintanece on these apps. This is where perl begins to fall short of Ruby. Perl doesn't force good practices when writing code and if you don't force yourself to do it, you're in for alot of trouble when it comes time to add new features or perform routine maintenece. The Ruby language doesn't force you to write good code either but it definately steers you in the right direction. In Ruby, everything is an object. This helps you to put like code into classes, which in turn makes upkeep much easier. I've only been using Ruby for about 6 months and I was able to take a 20,000 line web app written in perl (and the template-toolkit) to only 8,000 in ruby on rails. The Ruby language in concise and to the point. The biggest problem I have with Ruby is the lack of books on the subject. Rails is solving that problem as we speak. I am now a Ruby enthusiest and will program in it whenever I have the choice, but I will always love perl!
|

January 26th, 2006, 03:38 AM
|
 |
fork while true;
|
|
Join Date: May 2005
Location: England, UK
|
|
|
PERL's strength is CPAN. For quick apps that won't be looked at ever again or that need to be put up quickly, CPAN will have some modules you want (like NET::IRC, would take ages to write that in ruby).
Ruby is a good language for everything though, and rails give it a lot of nice background classes to help simplify programming.
|

January 26th, 2006, 07:34 AM
|
 |
Contributing User
|
|
Join Date: Oct 2005
Location: Antalya
Posts: 80
Time spent in forums: 16 h 34 m 6 sec
Reputation Power: 8
|
|
|
I myself am wondering if RUBY will be having any advantage/ease of use over php. However in the meantime i am also afraid that it will be more a 'higher level' platform and wont offer the flexibility of delving directly into the code ?
Ill be very happy if someone who had experience with ruby detail here what it is, and what it is not.
|

January 26th, 2006, 11:19 AM
|
 |
fork while true;
|
|
Join Date: May 2005
Location: England, UK
|
|
|
it's general purpose, can do whatever php can do really...
it's also more object oriented.
strings are objects, eh.
"blah".upcase
it has hashes, lists and scalars like perl, except they're all objects.
x = {'james'=>'linuxpenguin'}
it also has inline regexps.
And it has rubyOnRails... a Great development framework
|

January 26th, 2006, 12:47 PM
|
 |
Contributing User
|
|
|
|
Quote: | Originally Posted by Scorpions4ever The advantage is not really because of the ruby language itself, but mainly because of the Ruby on Rails framework engine.
[...]
* A Blogger Application in 15 minutes
* A Flickr style album in 5 minutes | For my purposes, the Ruby language looks attractive but the Ruby on Rails framework is too limiting. My current app wouldn't be doable on RoR or it would be very difficult. The Flickr in 5 minutes is misleading and a downer since it's not a Flickr-style album, it's a search interface to Flickr using a pre-built query library. I wasn't very impressed but I've heard it impresses a lot of Java programmers that haven't been exposed to scripting languages. However, I will admit the Blogger in 15 min is pretty nice. Quote: | Originally Posted by beachguy82 I've only been using Ruby for about 6 months and I was able to take a 20,000 line web app written in perl (and the template-toolkit) to only 8,000 in ruby on rails. | The comparison here is Perl with a templating system to Ruby with a framework. People have gotten similar and better results converting from one Perl framework to another: CGI::Application to Catalyst. Anything in Ruby on Rails that's going to be compared to Perl should be compared to apps running on Catalyst. The primary difference between Catalyst and Ruby on Rails is that Catalyst has a default way of doing things but gives you a lot of flexibility to change things while RoR primarily has one way of doing things. That provides different strengths and weaknesses. Quote: | Originally Posted by LinuxPenguin PERL's strength is CPAN. For quick apps that won't be looked at ever again or that need to be put up quickly | If you want to use CPAN and build web apps, Catalyst is a great framework that improves your Perl code. And if you do it right, looking at your code a few months down the line won't give you headaches! Catalyst's example apps provide good tips on streamlining Perl code. Ruby is a great language because it's elegant. Ruby on Rails is great if you don't need CPAN and can live with its constraints. I'd like to use RoR for a project but I tend to love building highly customized features and if you have a large DB, manual adjustment is a requirement.... not sure if RoR is good for that. TurboGears on Python is a more flexible solution than RoR but Catalyst lets me do everything I want and use CPAN.
Last edited by Conundrum : January 26th, 2006 at 04:01 PM.
|

January 26th, 2006, 01:27 PM
|
 |
fork while true;
|
|
Join Date: May 2005
Location: England, UK
|
|
|
The problem i have with catalyst is the verbosity problem, it's $blah->blah.blah() just to print something which i think is ridiculous. Nethertheless i'm downloading one of the videos to compare it to turbogears and RoR
|

January 26th, 2006, 01:35 PM
|
 |
Contributing User
|
|
|
|
Quote: | Originally Posted by LinuxPenguin The problem i have with catalyst is the verbosity problem, it's $blah->blah.blah() just to print something which i think is ridiculous. Nethertheless i'm downloading one of the videos to compare it to turbogears and RoR | Are you comparing setting output in the Controller with Catalyst vs. output in the View (RHTML page) with RoR? If you are, you can do something similar to RHTML in the Catalyst View ( TT, Mason, etc.). Show me a RoR vs. Catalyst print example that you're thinking of.
Last edited by Conundrum : January 26th, 2006 at 01:56 PM.
|

January 26th, 2006, 02:11 PM
|
 |
Only the strong survives!!.
|
|
Join Date: Feb 2003
Location: A World of wonders.
|
|
|
i honestly think catalyst is sorta crapy in its class.
|

January 26th, 2006, 02:13 PM
|
 |
Contributing User
|
|
|
|
Quote: | Originally Posted by xlordt i honestly think catalyst is sorta crapy in its class. | Which ones are you comparing, how would you rate them and based on what criteria?
|

January 26th, 2006, 02:15 PM
|
 |
fork while true;
|
|
Join Date: May 2005
Location: England, UK
|
|
|
no, the text to be output it's
$class->output->write("blah") or something similar for catalyst (i can't remember the exact names)
in ror:
puts "blah"
just the simple ruby print. Why is there a need to be convoluted in catalyst?
|

January 26th, 2006, 02:15 PM
|
 |
Only the strong survives!!.
|
|
Join Date: Feb 2003
Location: A World of wonders.
|
|
Quote: | Originally Posted by Conundrum How would you rate them and based on what criteria? | i rather stick to perl.. its almot alike... also.. check out LinuxPenguin then your question will be answered 
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|