On Sat, 2002-08-31 at 10:16, vegai / nic.fi.GOTSOMUCHSPAMKEEPITCOMING wrote: > Hello. I've been checking into python lately quite a lot, and I > like its clean syntax. > > Then comes Ruby, which I find is inferior to python aesthetically. > > Comments? I've used both Ruby and Python for delivering production applications. My opinion is that Python syntax is more elegant than that of Ruby when your code *uses* existing classes. However, Python syntax is less elegant than Ruby when you *define* new classes, because of all the underscores and explicit self parameters. However, as code evolves, one ends up writing more and more classes, so I find that Python code starts off very readable but gradually becomes less so, while Ruby code stays as readable as it evolves. Python's evolution has left it with a mix of primitive and object types (also fixed in the latest versions), built-in functions that should be methods ("map", for example), reserved words that should be methods ("in" for example), etc. I find that Ruby's model of "everything is an object" makes code more elegant, and it's easier to find the right method in the documentation. Ruby code becomes significantly more elegant when you use blocks to extend the language; To achieve something like the same effect, Python requires lambda expressions, additional functions, or implementations of "magic" methods with lots of double-underscores in them. The lack of lexical scoping is a drawback in Python, because it makes local functions much less useful as an alternative to blocks, although this fixed in the lastest versions if you import scopes from __future__. Cheers, Nat. -- Dr. Nathaniel Pryce, Technical Director, B13media Ltd. Studio 3a, 22-24 Highbury Grove, London N5 2EA, UK http://www.b13media.com