Ruby v Python ... I've been asked for a comparison!
• Both are object oriented scripting languages - or rather claim to be scripting languages, but are really compile-and-run via their own virtual machines, in just the same way as Perl and Java are.
• Both are modern, Open Source languages with a wide range of standard classes and methods provided as standard, and lots of other libraries available too.
• Python is a clean, minimalist language which is not cluttered with lots of alternative syntax and special characters @ and $ and the like used in conjunction with variable names, whereas Ruby uses a number of those specials to indicate variables, scope, etc.
From the programmer's viewpoint, this means that Python code may be a little longer, but will be easier to read and maintain by a programmer who doesn't spend large amounts of time coding in the language.
• Ruby also provides capabilities such as topicalisation which allow the knowledgeable programmer to shorten code to the confusion of the novice maintainer.
No bad thing if you have a small team of Ruby pogrammers who will be responsible for the whole life of the application, but an issue if you use other people to maintain.
• Python's typical applications can be regarded as being very wide ranging. We have trained user on all sort of applications, some (but a minority) of which are web based. Ruby is, to date, very much used in "Ruby on Rails" - a Web framework - so it tends to be very much a language that's associated with web content applications.
Which would I choose for a new project? Given the artificial choice of just these two languages, I would probably go Ruby if I was looking at a web-based content system / shopping cart / on line application, and I would go Python otherwise.
But with existing code in either language, or a support team who knew one language but not the other, I would be very comfortable with either language for either type of application.
Oh - and I would be happy to run a
Ruby Course or a
Python Course for you!
(written 2007-10-02, updated 2009-08-31)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
Y101 - Introduction to Python [317] Programming languages - a comparison - (2005-05-20)
[380] Bridging to the customer requirement - (2005-07-16)
[382] Central London Courses - Perl, PHP, Python, Tcl, MySQL - (2005-07-18)
[444] Database or Progamming - which to learn first? - (2005-09-13)
[629] Choosing the right language - (2006-03-01)
[710] Linux training Glasgow, Python programming course Dundee - (2006-05-05)
[712] Why reinvent the wheel - (2006-05-06)
[745] Python modules. The distribution, The Cheese Shop and the Vaults of Parnassus. - (2006-06-05)
[753] Python 3000 - the next generation - (2006-06-09)
[834] Python makes University Challenge - (2006-08-15)
[846] Is Perl being replaced by PHP and Python? - (2006-08-27)
[909] Python is like a narrowboat - (2006-10-30)
[949] Sludge off the mountain, and Python and PHP - (2006-11-27)
[950] Python and the Magic Roundabout - (2006-11-27)
[1663] Python in an afternoon - a lecture for experienced programmers - (2008-06-01)
[4118] We not only teach PHP and Python - we teach good PHP and Python Practice! - (2013-06-18)
[4298] Python - an interesting application - (2014-09-18)
[4590] Progress on moving from Python 2 to Python 3 - training for both versions - (2015-12-01)
R202 - Ruby on Rails [1050] The HTML++ Metalanguage - (2007-01-22)
[1302] Ruby, Ruby, Ruby. Rails, Rails, Rails. - (2007-08-13)
[1745] Moodle, Drupal, Django (and Rails) - (2008-08-08)
[2605] Ruby on Rails - a sample application to teach you how - (2010-01-30)
[2607] Answers on Ruby on Rails - (2010-01-30)
[2609] Scope of variables - important to Ruby on Rails - (2010-01-31)
[3624] Why do we need a Model, View, Controller architecture? - (2012-02-25)
[3756] Ruby on Rails - how it flows, and where the files go - (2012-06-08)
[3772] Hello World - Ruby on Rails - a checklist of each step - (2012-06-22)
[3777] Multiple views in a single appication - sharing common parts of the template - Ruby on Rails - (2012-06-23)
[3778] Providing a form to allow the user to add data to the model - Ruby on Rails - (2012-06-23)
[3779] Adding validation to form entries and sticky fields - Ruby on Rails - (2012-06-23)
[3780] Ruby of Rails - cleanly displaying model data in the view - (2012-06-23)
[3919] What is a web framework? - (2012-11-10)
[4010] Really Simple Rails - (2013-02-17)
[4013] Web Frameworks - nested templates - (2013-02-22)
R101 - Ruby - Introduction [550] 2006 - Making business a pleasure - (2006-01-01)
[664] Ruby course - oops - it's not happening - (2006-04-01)
[1027] Cue the music, I'm happy. - (2007-01-09)
[1041] Learnt in London - Ruby, Martini, Coral and the Core - (2007-01-17)
[1887] Ruby Programming Course - Saturday and Sunday - (2008-11-16)
[2286] New to programming? It is natural (but needless) for you to be nervous - (2009-07-14)
[2287] Learning to program in Ruby - examples of the programming basics - (2009-07-15)
[4369] Ruby - the second rung of learning the language - (2014-12-28)
[4498] Ruby - where one statement ends and the next begins - (2015-05-26)
G998 - Well House Consultants - Newsletter Highlighted Box [1011] Well House Manor and Beechfield House, Hotels, Melksham - (2006-12-29)
[1068] ls -l report, Linux / Unix - types and permssions - (2007-02-06)
[1132] Well House Manor, Melksham, Art Gallery - (2007-04-02)
[1237] What proportion of our web traffic is robots? - (2007-06-19)
[1307] Troy, up state New York - (2007-08-17)
[1475] Tcl/Tk - updating your display while tasks are running - (2007-12-16)
[1521] Evening drive across the roof of Wiltshire - (2008-01-27)
[1621] Linux and Java Course in London - (2008-04-24)
[1629] A short introduction to our courses - (2008-05-03)
[1751] Public Training Course Dates until July 2009 - (2008-08-13)
[1843] How many cups of coffee? - (2008-10-17)
[1967] LinkedIn - Thrice Asked, and joined. - (2008-12-30)
[2050] Why the Pony Tail? - (2009-02-21)
[2125] We have lost a regular business guest - (2009-04-10)
[2222] A (biased?) comparison of PHP courses in the UK - (2009-06-07)
[2385] Reading all our recent news from a single source - (2009-08-29)
[2400] Are you wanting to learn PHP? - (2009-09-08)
[2520] Global and Enable - two misused words! - (2009-11-30)
[3168] Web Sites - Subject to Advertising Standards from 1st March - check your sites - (2011-02-13)
Some other Articles
Simple page password protection - PHPEtag in http headers - what is it?Load Balancing with Apache mod_jk (httpd/Tomcat)Choosing between mod_proxy and mod_rewritePython v RubyMaidenhead Coffee ChallengeNew Month, New Quarter, New LawsA taster PHP expression ...Hotel in Melksham at ChristmasApache Tomcat Performance Tuning