From: raims@... (Lawrence Oluyede) Date: 2007-03-10T21:15:05+09:00 Subject: Re: A couple of questions from a Ruby neophyte gga wrote: > Ruby has the One-click installer, which you can get from www.rubyforge.org > (it's usually at the top of the download list). > > Perl and Python have ActiveState versions of the same. > They all use a a microsoft-like installer... with the benefits (easy > to install on machine), and the drawbacks (a pain to install on > hundreds of machines, without some replication tool). Don't understand the difference here. Anyway the official Python distribution has an installer of its own: http://www.python.org/ftp/python/2.5/python-2.5.msi http://www.python.org/ftp/python/2.5/python-2.5.ia64.msi http://www.python.org/ftp/python/2.5/python-2.5.amd64.msi > Perl and Ruby are rather similar. Albeit they both can use that MySQL > backend directly (which mimics the MySQL api), you often use it a > module called DBI For the record, with Python you can connect with mysqldb-python > Also, Ruby has stuff like ActiveRecord (like CakePHP), which basically > shields you pretty much completely from writing any SQL, at the price > of performance. Take a look at SQLAlchemy for your Python stuff It's really good and follow a rather different approach than AR > Python has something akin to DBI called the Python DBI API, albeit, > imo, it is not quite as comprehensive or elegant (some people even use > pyperl to get to Perl's dbi module). I don't think python comes with > any database backends in their default installation. The correct name is "DB API" which is an API dictating how interfaces for various DBs should be so ideally you can change the underline API and don't change your business layer. Python does ship with database backends. There's the SQLite 3 backend from the 2.5 version and there's support for Unix DBM from day one I think and Berkeley DB since ages. > Python > ------ > arr.append(value) # OO, parenthesis NOT optional > len(arr) # non-OO, albeit it can be overridden There's a bit of misunderstading of what's called OOP in regard of "message(object)" or "object.message" but I don't want to start a religious war here. Suffice to say that arr or an object who wants to mimic that behavior must implement a __len__ method so I don't really understand why that's not OOP. Smalltalk does use a similar syntax and I will not be the one stating that ST is not OO ;-) > arr += [value] # Ruby gets brownie points over python and perl > because it can do additions and intersections > arr & other # among arrays easily, too. > arr - other You can use set() in Python for such insiemistic operation. HTH -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to understand something when his salary depends on not understanding it" - Upton Sinclair