|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
||||
|
||||
|
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? |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
|||
|
|||
|
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). |
|
#4
|
|||
|
|||
|
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 |
|
#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!
|
|
#6
|
||||
|
||||
|
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.
__________________
~James [Not currently seeking freelance work] Like philosophy or interested in spirituality? Philosophorum. Game Dev Experts Forums Foresight Linux - Because your desktop should be cool! Linux FAQ FedoraFAQ UbuntuGuide |
|
#7
|
||||
|
||||
|
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. |
|
#8
|
||||
|
||||
|
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 |
|
#9
|
|||||
|
|||||
|
Quote:
Quote:
Quote:
Last edited by Conundrum : January 26th, 2006 at 04:01 PM. |
|
#10
|
||||
|
||||
|
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
|
|
#11
|
||||
|
||||
|
Quote:
Last edited by Conundrum : January 26th, 2006 at 01:56 PM. |
|
#12
|
||||
|
||||
|
i honestly think catalyst is sorta crapy in its class.
__________________
IE QUOTE | PHP Manual | Google | C/C++ Compiler | Linux Tutorials | General Stuff Game Dev |