Python and Ruby, siblings? 40

Posted by Peter Morris Tue, 29 Dec 2009 11:38:00 GMT

I have written code in many languages (Basic, dBase, C, Sculptor 4GL, Assembler(many flavours) Perl, VBA, Javascript, Ruby and finally, Python.

For much of my experience of Ruby, I viewed Python as a sibling language. I thought Ruby and Python where rough equals in capability and complexity.

It took me about 3 months of Python coding to realise that this is very far from the truth.

Ruby and Python are not compadres, they are not friends, they don't work at the same level.

Ruby is much simpler than Python, it has far less 'language' there. For a start, python is a compiled bytecode language (you do notice all those PYC files all over the place don't you?).

That and its explicit binding mechanism (all those import statements at the head of a python file just make my ruby sensibilities scream!) make for a much quicker language than Ruby.

When you add to that all this stuff about decorators, metaclasses etc, that takes some getting used to. The whole idea that methods associated with an instance are actually method instances that need calling (forgetting @property for the moment).

When I read about that, my mouth started watering, there must be some REALLY interesting uses for that! But then I let it stew for a while.

Really, all that does is force the coder to recognise that there are properties and then there are methods, and to require the user to know the difference.

With ruby, you don't need that. Well, really, with ruby, there are really ONLY ever methods, this forces encapsulation much more completely than Pythons default behaviour does.

Looking more deeply into decorators and metaclasses, I realise that they are trying to give the same sort of versatility to Python that Rubys blocks give to it.

Blocks affect EVERY aspect of Ruby, without blocks ruby is a rather dull, flat language. With them, it is a rich, expressive language that allows for some truely lovely DSL applications. Python tries to get the same functionality from metaclasses, decorators etc, but it just feels that much more forced. Having to use several different but interlocking constructs to ALMOST do what Rubys blocks do. This MIGHT be as a consequence of limitations enforced on the language by its bytecode underpinnings, I don't know enough yet to be able to say.

So, I suppose my final word on the issue is that Ruby is NOT a sibling of Python, its probably more of a teenager to Pythons twentysomething. There is a LOT more depth to Python than there is to Ruby, but thats not because the depth brings anything extra, it's more because Rubys simplicity is sufficient for the task. Python IS faster though, and probably always will be.

The later the binding, the slower the runtime performance.

  1. Hi! XmrMiXHU http://gbfbjd.com/ <a href="http://vxurrv.com/ ">BMVYnzTV</a> [url=http://tyobsw.com/]BMVYnzTV[/url] 20 days later:
  2. oEqTQSJa <a href="http://community.xat.com/member.php?u=38942#7752 ">Buy Phentermine</a> <a href="http://www.telltalegames.com/forums/member.php?u=45641#7752 ">Cialis</a> <a href="http://community.xat.com/member.php?u=38946#7752 ">Cheap Valium</a> <a href 27 days later:
  3. NivmtR <a href="http://www.qmsystems.com/xanax.html#2971 ">Cheap Xanax</a> <a href="http://www.qmsystems.com/viagra.html#2971 ">Viagra</a> <a href="http://www.carmafl.org/tamiflu.html#2971 ">Buy Tamiflu</a> <a href="http://www.qmsystems.com/viagra.html#29 27 days later:
  4. caBeZg <a href="http://community.xat.com/member.php?u=38949#2359 ">Cigarettes</a> <a href="http://community.xat.com/member.php?u=38941#2359 ">Viagra</a> <a href="http://www.telltalegames.com/forums/member.php?u=45642#2359 ">Cheap Tramadol</a> <a href="htt 28 days later:
  5. ENLLdI <a href="http://www.telltalegames.com/forums/member.php?u=45643#6648 ">Buy Xanax</a> <a href="http://www.telltalegames.com/forums/member.php?u=45640#6648 ">Cheap Phentermine</a> <a href="http://www.telltalegames.com/forums/member.php?u=45642#6648 " 29 days later:
  6. QVcRJhJw <a href="http://community.xat.com/member.php?u=38947#4428 ">Buy Ambien</a> <a href="http://www.telltalegames.com/forums/member.php?u=45638#4428 ">Viagra</a> <a href="http://community.xat.com/member.php?u=38948#4428 ">Lorazepam</a> <a href="http:/ about 1 month later:
  7. ZDjjdyC <a href="http://www.carmafl.org/ambien.html#5774 ">Ambien</a> <a href="http://www.qmsystems.com/tramadol.html#5774 ">Ultram</a> <a href="http://www.qmsystems.com/viagra.html#5774 ">Viagra</a> <a href="http://www.qmsystems.com/phentermine.html#5774 about 1 month later:
  8. jOwwPci <a href="http://community.xat.com/member.php?u=38949#8006 ">Cigarettes</a> <a href="http://www.telltalegames.com/forums/member.php?u=45638#8006 ">Cheap viagra</a> <a href="http://www.telltalegames.com/forums/member.php?u=45642#8006 ">Tramadol</a> about 1 month later:
  9. exymfqf <a href="http://www.telltalegames.com/forums/member.php?u=45638#2381 ">Cheap viagra</a> <a href="http://community.xat.com/member.php?u=38949#2381 ">Cheap Cigarettes</a> <a href="http://www.telltalegames.com/forums/member.php?u=45643#2381 ">Xanax</ about 1 month later:
  10. 11 about 1 month later:
  11. 11 about 1 month later:
  12. pehIIJ <a href="http://www.qmsystems.com/ambien.html#6555 ">Ambien</a> <a href="http://www.qmsystems.com/xanax.html#6555 ">Xanax</a> <a href="http://www.carmafl.org/xanax.html#6555 ">Cheap Xanax</a> <a href="http://www.carmafl.org/phentermine.html#6555 "> about 1 month later:
  13. HKZFQH <a href="http://community.xat.com/member.php?u=38946#4282 ">Diazepam</a> <a href="http://www.telltalegames.com/forums/member.php?u=45641#4282 ">Cheapest Cialis</a> <a href="http://www.telltalegames.com/forums/member.php?u=45644#4282 ">Cheap Valium< about 1 month later:
  14. FubcVwh <a href="http://www.qmsystems.com/ambien.html#9890 ">Ambien</a> <a href="http://www.carmafl.org/tamiflu.html#9890 ">Buy Tamiflu</a> <a href="http://www.carmafl.org/tamiflu.html#9890 ">Cheap Tamiflu</a> <a href="http://www.carmafl.org/phentermine.h about 1 month later:
  15. uptown about 1 month later:
    life insurance 7661 car insurance quotes >:DD cheap auto insurance >:DD
  16. McRUNaM <a href="http://community.xat.com/member.php?u=38946#0447 ">Valium</a> <a href="http://www.telltalegames.com/forums/member.php?u=45640#0447 ">Adipex</a> <a href="http://community.xat.com/member.php?u=38948#0447 ">Cheap Ativan</a> <a href="http://w about 1 month later:
  17. special about 1 month later:
    health insurance 227 health insurance quotes =-DD health insurance 9778 auto insurance njfeuu
  18. aiJtTUW <a href="http://community.xat.com/member.php?u=38946#2718 ">Valium</a> <a href="http://community.xat.com/member.php?u=38942#2718 ">Buy Phentermine</a> <a href="http://www.telltalegames.com/forums/member.php?u=45644#2718 ">Valium</a> <a href="http: about 1 month later:
  19. completedstep about 1 month later:
    health insurance ypcfi cheap life insurance zpfmvq health insurance yomdno
  20. aJhYhVWO <a href="http://www.telltalegames.com/forums/member.php?u=45647#2536 ">Buy Cigarettes</a> <a href="http://community.xat.com/member.php?u=38946#2536 ">Diazepam</a> <a href="http://www.telltalegames.com/forums/member.php?u=45644#2536 ">Cheap Valium about 1 month later:
  21. active about 1 month later:
    auto insurance quotes :-[ health insurance 036227 health insurance quotes dlhn health insurance %-DD
  22. GmUAnnF <a href="http://www.qmsystems.com/ambien.html#9935 ">Ambien</a> <a href="http://www.carmafl.org/ativan.html#9935 ">Ativan</a> <a href="http://www.qmsystems.com/tramadol.html#9935 ">Cheap Tramadol</a> <a href="http://www.qmsystems.com/klonopin.html about 1 month later:
  23. verdanafett about 1 month later:
    valium 2002 propecia indw xanax %)) ultram =-P accutane 20860
  24. QFscuOU <a href="http://www.intlgymnast.com/forum/member.php?u=4741 ">Phentermine</a> <a href="http://www.intlgymnast.com/forum/member.php?u=4741 ">Adipex</a> <a href="http://gbxforums.gearboxsoftware.com/member.php?u=44501 ">Cheap Valium</a> <a href="htt about 1 month later:
  25. applytexts about 1 month later:
    xanax without a prescription 3990 health insurance %[[ valium jvy pa health insurance 524859 health insurance 029 accutane 994343 what is valium 807992
  26. fnuzxa about 1 month later:
  27. DZGgatrO <a href="http://www.popdarlings.com/viagra.html ">Buy Viagra</a> <a href="http://www.popdarlings.com/valium.html ">Buy Valium</a> <a href="http://www.popdarlings.com/ativan.html ">Buy Ativan</a> <a href="http://www.popdarlings.com/xanax.html ">Xa about 1 month later:
  28. coriandrum about 1 month later:
    aciphex phentermine pharmacy jobs %)) xanax trtjc phentermine mya aciphex buy online liippd cheap ultram vmimdo accutane 263
  29. operculina about 1 month later:
    valium 8-(( tramadol hcl wmx valium mbtayc
  30. largetext about 1 month later:
    buy levitra >:-[[ ultram qnnaux tramadol :O buy your medicine cheaper ultram viagra 3318
  31. OsRgqNx <a href="http://www.expertlaw.com/forums/member.php?u=104131#6791 ">Cheap Ambien</a> <a href="http://www.expertlaw.com/forums/member.php?u=104128#6791 ">Buy Xanax</a> <a href="http://www.expertlaw.com/forums/member.php?u=104133#6791 ">Cigarettes</ about 1 month later:
  32. ZhtdCk <a href="http://www.telltalegames.com/forums/member.php?u=45643 ">Xanax</a> <a href="http://www.telltalegames.com/forums/member.php?u=45643 ">Xanax</a> <a href="http://community.xat.com/member.php?u=38947 ">Ambien</a> <a href="http://www.telltalega about 1 month later:
  33. BhlOame <a href="http://www.popdarlings.com/phentermine.html ">Buy Phentermine</a> <a href="http://www.popdarlings.com/valium.html ">Valium</a> <a href="http://www.popdarlings.com/ambien.html ">Ambien</a> <a href="http://www.popdarlings.com/ambien.html "> about 1 month later:
  34. moWyEoY <a href="http://community.xat.com/member.php?u=38943 ">Buy Cialis Online</a> <a href="http://www.telltalegames.com/forums/member.php?u=45646 ">Cheap Ativan</a> <a href="http://www.telltalegames.com/forums/member.php?u=45645 ">Zolpidem</a> <a href= about 1 month later:
  35. durango about 1 month later:
    health insurance quotes %-((( health insurance quotes fki auto insurance online gmo a auto insurance 862107
  36. QzfOYJOu <a href="http://www.elysiumcache.com/xanax.html#0976 ">Xanax</a> <a href="http://www.elysiumcache.com/valium.html#0976 ">Valium</a> <a href="http://www.elysiumcache.com/#0976 ">Cheap Phentermine</a> <a href="http://www.elysiumcache.com/ambien.htm about 1 month later:
  37. QHaxyC <a href="http://www.elysiumcache.com/ambien.html ">Cheap Ambien</a> <a href="http://www.kingsfeast.com/viagra.html ">Viagra</a> <a href="http://www.getinvolvedwinstonsalem.org/lucky_strike.html ">Lucky Strike cigarettes</a> <a href="http://www.elys about 1 month later:
  38. VewCYWW <a href="http://www.elysiumcache.com/tramadol.html ">Cheap Tramadol</a> <a href="http://www.johnuseed.com/ ">Viagra</a> <a href="http://www.etopautos.com/viagra.html ">Cheap viagra</a> <a href="http://www.etopautos.com/ ">Cialis</a> <a href="http: about 1 month later:
  39. HTpcxnq <a href="http://www.elysiumcache.com/valium.html ">Cheap Valium</a> <a href="http://www.elysiumcache.com/ambien.html ">Cheap Ambien</a> <a href="http://www.elysiumcache.com/ativan.html ">Buy Ativan</a> <a href="http://www.johnuseed.com/ ">Buy Viag about 1 month later:
  40. xanax about 1 month later: