Ruby Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesRuby Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old December 21st, 2005, 04:08 PM
ecit12's Avatar
ecit12 ecit12 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 411 ecit12 User rank is Corporal (100 - 500 Reputation Level)ecit12 User rank is Corporal (100 - 500 Reputation Level)ecit12 User rank is Corporal (100 - 500 Reputation Level)ecit12 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 12 h 42 m 14 sec
Reputation Power: 6
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?

Reply With Quote
  #2  
Old December 21st, 2005, 04:17 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,336 Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 12 h 46 m 43 sec
Reputation Power: 674
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

Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month

Reply With Quote
  #3  
Old December 28th, 2005, 08:28 PM
mdaoust mdaoust is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 182 mdaoust User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 10 m 38 sec
Reputation Power: 5
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).

Reply With Quote
  #4  
Old December 29th, 2005, 12:43 PM
DevCoach DevCoach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Feb 2004
Location: London, England
Posts: 1,174 DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 6 h 3 m 45 sec
Reputation Power: 207
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

Reply With Quote
  #5  
Old January 25th, 2006, 03:17 PM
beachguy82 beachguy82 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 162 beachguy82 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 17 m 55 sec
Reputation Power: 5
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!

Reply With Quote
  #6  
Old January 26th, 2006, 03:38 AM
LinuxPenguin's Avatar
LinuxPenguin LinuxPenguin is offline
fork while true;
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: May 2005
Location: England, UK
Posts: 5,535 LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)  Folding Points: 11590 Folding Title: Novice Folder
Time spent in forums: 1 Month 3 Weeks 1 Day 19 h 23 m 58 sec
Reputation Power: 999
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.

Reply With Quote
  #7  
Old January 26th, 2006, 07:34 AM
unity100's Avatar
unity100 unity100 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Location: Antalya
Posts: 71 unity100 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 38 m 23 sec
Reputation Power: 3
Send a message via ICQ to unity100 Send a message via MSN to unity100 Send a message via Google Talk to unity100 Send a message via Skype to unity100
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.

Reply With Quote
  #8  
Old January 26th, 2006, 11:19 AM
LinuxPenguin's Avatar
LinuxPenguin LinuxPenguin is offline
fork while true;
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: May 2005
Location: England, UK
Posts: 5,535 LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)  Folding Points: 11590 Folding Title: Novice Folder
Time spent in forums: 1 Month 3 Weeks 1 Day 19 h 23 m 58 sec
Reputation Power: 999
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

Reply With Quote
  #9  
Old January 26th, 2006, 12:47 PM
Conundrum's Avatar
Conundrum Conundrum is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jan 2004
Posts: 1,108 Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level)Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level)Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level)Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level)Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level)Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level)Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level)Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 12 h 46 m 55 sec
Reputation Power: 123
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.
__________________
Dev411 | Grokbase | Compare CPAN Modules

Last edited by Conundrum : January 26th, 2006 at 04:01 PM.

Reply With Quote
  #10  
Old January 26th, 2006, 01:27 PM
LinuxPenguin's Avatar
LinuxPenguin LinuxPenguin is offline
fork while true;
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: May 2005
Location: England, UK
Posts: 5,535 LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)  Folding Points: 11590 Folding Title: Novice Folder
Time spent in forums: 1 Month 3 Weeks 1 Day 19 h 23 m 58 sec
Reputation Power: 999
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

Reply With Quote
  #11  
Old January 26th, 2006, 01:35 PM
Conundrum's Avatar
Conundrum Conundrum is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jan 2004
Posts: 1,108 Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level)Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level)Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level)Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level)Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level)Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level)Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level)Conundrum User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 12 h 46 m 55 sec
Reputation Power: 123
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.

Reply With Quote
  #12  
Old January 26th, 2006, 02:11 PM
xlordt's Avatar
xlordt xlordt is offline
Only the strong survives!!.
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Feb 2003
Location: A World of wonder.
Posts: 5,516 xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 103339 Folding Title: Super Ultimate Folder - Level 1Folding Points: 103339 Folding Title: Super Ultimate Folder - Level 1Folding Points: 103339 Folding Title: Super Ultimate Folder - Level 1Folding Points: 103339 Folding Title: Super Ultimate Folder - Level 1Folding Points: 103339 Folding Title: Super Ultimate Folder - Level 1Folding Points: 103339 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Weeks 1 Day 14 h 51 m 14 sec
Reputation Power: 378
Send a message via ICQ to xlordt Send a message via AIM to xlordt Send a message via MSN to xlordt Send a message via Yahoo to xlordt Send a message via Google Talk to xlordt Send a message via Skype to xlordt
Facebook
i honestly think catalyst is sorta crapy in its class.

</
Reply With Quote