[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

A couple of questions from a Ruby neophyte

M Wells

3/8/2007 12:08:00 PM

Hi All,

I'm thinking about learning a new scripting language, and I have a
couple of questions I'd like to ask the Ruby community to work out if
Ruby is the language I should be learning.

A little background: most of my usage will be based around writing
console scripts that connect either to MSSQL (ie SQL Server), MySQL or
Microsoft Access databases to perform imports / exports / selections
etc, or it will be around pulling apart text file reports to identify
valid records etc (and often then importing them into a DB). This will
all be on a WinXP machine.

I'm currently very conversant with PHP and VBScript and moderately
conversant with C#.

What I'm looking for:

- A language that installs easily onto a WinXP machine, including any
libraries required to do the following things listed below as well.

- A language with solid and hopefully well-documented libraries for
connecting to at least MySQL and MSSQL. Being able to connect to
Microsoft Access via ODBC (or even better, natively) would be an extra
bonus.

- A language with a flexible array or array-like object. One of the
things I love about PHP is the ease with which an array can be
populated (eg "MyArray[] = 'a new value';" adds "a new value" as a new
item to the array MyArray).

- A language with strong Regular Expression abilities, and string
manipulation tools / methods.

What I don't (currently?) need:

- Web support. I'm well aware of Ruby On Rails, and perhaps somewhere
down the track I'll build web applications in it, but for the moment
I'm looking strictly for a console scripting language to handle
repetitive yet complex database oriented tasks.

So, would anyone be able to help me work out if Ruby is the language I
need?

Many thanks to anyone who gives these questions some thought.

Much warmth,

pt

22 Answers

Alex Young

3/8/2007 12:27:00 PM

0

Before I start: I've done most of what you need to do successfully with
Ruby before, for a little while now, so the news is good :-)

planetthoughtful wrote:
> Hi All,
>
> I'm thinking about learning a new scripting language, and I have a
> couple of questions I'd like to ask the Ruby community to work out if
> Ruby is the language I should be learning.
>
> A little background: most of my usage will be based around writing
> console scripts that connect either to MSSQL (ie SQL Server), MySQL or
> Microsoft Access databases to perform imports / exports / selections
> etc, or it will be around pulling apart text file reports to identify
> valid records etc (and often then importing them into a DB). This will
> all be on a WinXP machine.
I've handled MySQL and Access connectivity before (MySQL much more than
Access), and they're both easy to get working. MySQL has a native
driver, and you can get to Access via ODBC. I assume that MSSQL will be
similarly convenient, but I haven't used it myself.

> I'm currently very conversant with PHP and VBScript and moderately
> conversant with C#.
>
> What I'm looking for:
>
> - A language that installs easily onto a WinXP machine, including any
> libraries required to do the following things listed below as well.
Yes. The One-Click-Installer (if you haven't already found it) takes
care of this.

> - A language with solid and hopefully well-documented libraries for
> connecting to at least MySQL and MSSQL. Being able to connect to
> Microsoft Access via ODBC (or even better, natively) would be an extra
> bonus.
See above.

> - A language with a flexible array or array-like object. One of the
> things I love about PHP is the ease with which an array can be
> populated (eg "MyArray[] = 'a new value';" adds "a new value" as a new
> item to the array MyArray).
Ruby's arrays aren't quite as feature-packed as PHP's arrays, which are
more like mutant hashes with strange super-powers. A Ruby array is
created like this:

arr = ['a', 2.0, Object.new]

and are addressed only by index:

arr[0] = 'b'

and appended to like this:

arr << 'c'

If you want non-numeric keys, we've got hashes, which work like this:

hsh = {'a' => 'foo', 1 => 'bar', Object.new => 'qux'}

addressed (and also assigned to) like this:

hsh['a'] = 'fob'

Unlike PHP's arrays, Ruby's hashes don't preserve order, but there are
libraries around to do that if you need it.

>
> - A language with strong Regular Expression abilities, and string
> manipulation tools / methods.
Yup. Better than PHP's, in my opinion.

> So, would anyone be able to help me work out if Ruby is the language I
> need?
I guess the thing to do would be to find a simple task you need to do,
and actually try it out, and see how it feels - and check back here if
you need help. That's how I got hooked :-)

--
Alex

SonOfLilit

3/8/2007 12:32:00 PM

0

I think you stumbled on the right language.

Ruby arrays are very powerful, especially in the ways in which they
can be manipulated.


Do try :-)


Also, check out the RubyMentor project:
http://ruby-vpi.rubyforge.org/doc/im...


Aur

Chad Perrin

3/8/2007 6:38:00 PM

0

On Thu, Mar 08, 2007 at 09:27:01PM +0900, Alex Young wrote:
>
> >- A language with a flexible array or array-like object. One of the
> >things I love about PHP is the ease with which an array can be
> >populated (eg "MyArray[] = 'a new value';" adds "a new value" as a new
> >item to the array MyArray).
> Ruby's arrays aren't quite as feature-packed as PHP's arrays, which are
> more like mutant hashes with strange super-powers. A Ruby array is
> created like this:

The only quibble I have with your post is the above characterization of
PHP's array variables. It's more accurate, I think, to say that by
failing to more carefully separate normal arrays and associative arrays
(hashes) from each other, PHP ends up merely pretending to have two
array types while in fact it only has one -- and it's pretty broken in
some annoying ways. The problems with PHP arrays are mostly in
secondary effects, such that the way they're implemented imposes
limitations on the language as a whole, even though looking at the
arrays in a vacuum they don't seem terribly broken at first glance.

PHP handling of arrays isn't really something I've put too much thought
into analyzing, so I'm afraid I can't come up with a succinct
description of my objections to how they work just yet, but suffice to
say that despite the atrocious syntactic gyrations needed to deal with
complex data structures in Perl thanks to the list-flattening problem I
still prefer working with complex data structures in Perl over working
with them in PHP. I think your uses of the terms "mutant" and "strange"
are appropriate to describing PHP arrays, but "super-powers" is a bit
less so, and "feature-packed" is only useful to describe PHP arrays
where "feature" is contrasted with "useful functionality".

Because of its design -- and the way arrays work is a decent
demonstration of this fact -- PHP's usefulness as you get beyond simple
templating development drops off significantly. The more complex the
language gets, the more acrobatic your work-arounds must become.


>
> arr << 'c'

This is a beautiful example of where Ruby handles arrays better than PHP
handles them. Doing it the PHP way:

$arr = 'c'

. . is confusing and limiting. It hinders code readability and
maintainability, and restricts the potential uses of the assignment
operator outside of appending values to an array by essentially
overloading the operator haphazardly.


>
> >
> >- A language with strong Regular Expression abilities, and string
> >manipulation tools / methods.
> Yup. Better than PHP's, in my opinion.

Far, far better than PHP's. In the quartet of commonly cited web
scripting languages (Perl, PHP, Python, and Ruby), PHP's regular
expression handling is by far the worst. It's kludgy, inconsistent, and
unwieldy. I try to avoid it. I don't like Python's much either, but
it's a darn sight better than PHP's.

I think I've been spoiled by working primarily with Perl regexen. PHP's
regex handling is actually better than that of probably 90% of languages
that have regexen at all. I just think you need to be in about the 98th
percentile before you get to the languages that actually have *good*
regex support, and Ruby is definitely in that category.


>
> >So, would anyone be able to help me work out if Ruby is the language I
> >need?
> I guess the thing to do would be to find a simple task you need to do,
> and actually try it out, and see how it feels - and check back here if
> you need help. That's how I got hooked :-)

That's a pretty good take on it.

The languages I'd suggest, off the top of my head, for the tasks
mentioned here include:

Perl
Python
Ruby

Each has its benefits and detriments, of course. I personally am not a
fan of Python, but it's still a great language in (most of) the ways
that matter. Ruby's my favorite, by a long shot, for OOP. Perl may
provide the most comfortable syntax for people who like a unixlike
environment (including me). All three of them handle the needs outlined
in the original post of this thread admirably.

--
CCD CopyWrite Chad Perrin [ http://ccd.ap... ]
"It's just incredible that a trillion-synapse computer could actually
spend Saturday afternoon watching a football game." - Marvin Minsky

SonOfLilit

3/9/2007 9:05:00 PM

0

I mean http://rubymentor.ruby...

On 3/8/07, SonOfLilit <sonoflilit@gmail.com> wrote:
> I think you stumbled on the right language.
>
> Ruby arrays are very powerful, especially in the ways in which they
> can be manipulated.
>
>
> Do try :-)
>
>
> Also, check out the RubyMentor project:
> http://ruby-vpi.rubyforge.org/doc/im...
>
>
> Aur
>
>

7stud 7stud

3/10/2007 3:23:00 AM

0

Chad Perrin wrote:
> In the quartet of commonly cited web
> scripting languages (Perl, PHP, Python, and Ruby), PHP's regular
> expression handling is by far the worst. It's kludgy, inconsistent, and
> unwieldy. I try to avoid it. I don't like Python's much either, but
> it's a darn sight better than PHP's.
>

It seems like regular expressions are slightly different from language
to language, but not so much so that it is much of a problem. Although,
if you are used to using advanced features like negative look behinds,
and they aren't available in the language you are coding in, I guess
that would be frustrating. What deficiencies are there in Python's
regex support?

> I think I've been spoiled by working primarily with Perl regexen. PHP's
> regex handling is actually better than that of probably 90% of languages
> that have regexen at all. I just think you need to be in about the 98th
> percentile before you get to the languages that actually have *good*
> regex support, and Ruby is definitely in that category.
>
>
>>
>> >So, would anyone be able to help me work out if Ruby is the language I
>> >need?
>> I guess the thing to do would be to find a simple task you need to do,
>> and actually try it out, and see how it feels - and check back here if
>> you need help. That's how I got hooked :-)
>
> That's a pretty good take on it.
>
> The languages I'd suggest, off the top of my head, for the tasks
> mentioned here include:
>
> Perl
> Python
> Ruby
>
> Each has its benefits and detriments, of course. I personally am not a
> fan of Python, but it's still a great language in (most of) the ways
> that matter. Ruby's my favorite, by a long shot, for OOP. Perl may
> provide the most comfortable syntax for people who like a unixlike
> environment (including me). All three of them handle the needs outlined
> in the original post of this thread admirably.

I've been looking at Ruby and Python this week, and I am drawn more to
Python. I went through the "Ruby in 20 minutes tutorial" at the Ruby
website here:

http://www.ruby-la...

and the syntax is not that appealing to me. I also started reading the
book "Dive into Python", which targets experienced programmers moving to
Python, and which is also available for free download at the author's
web site:

http://www.diveintop...

It's given a 5 star rating in the python book reviews here(click on the
book names for the full reviews):

http://www.awaretek.com...

How great is that?! A free 5 star rated programming book? It has a
unique format: the author starts each section with a few lines of some
indecipherable code, and then spends the rest of the section introducing
the concepts and language features that make the code crystal clear by
the end. The first two chapters are definitely worth reading, and they
introduce Python's data structures: arrays(called "lists"),
dictionaries("associative arrays, i.e. arrays with non numeric index
values), and tuples(immutable arrays).

The poster might be interested in a quick look at a "python in 10
minutes tutorial":

http://www.poromenos.org/tutori...

Anyway, I was wondering if you could give some further insights into why
you prefer Ruby and don't like Python?

--
Posted via http://www.ruby-....

gga

3/10/2007 7:35:00 AM

0

On 8 mar, 09:08, "planetthoughtful" <planetthought...@gmail.com>
wrote:

>
> What I'm looking for:

To be honest, your list is rather simple so there's going to be a lot
of languages that fit the bill.
As you asked in the Ruby list, and Perl/Python/Ruby were mentioned,
I'll give you answers for them.

> - A language that installs easily onto a WinXP machine, including any
> libraries required to do the following things listed below as well.

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).

>
> - A language with solid and hopefully well-documented libraries for
> connecting to at least MySQL and MSSQL. Being able to connect to
> Microsoft Access via ODBC (or even better, natively) would be an extra
> bonus.

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, which allows you to easily switch database
drivers. The DBI module is very well documented in Perl, not so well
in Ruby.
Both Ruby and Perl ship with MySQL backends by default in their
windows installers, buy MSSQL is probably something you'll need to
install yourself. For Ruby:
http://wiki.rubyonrails.com/rails/pages/HowtoConnectToMicrosof...

Also, Ruby has stuff like ActiveRecord (like CakePHP), which basically
shields you pretty much completely from writing any SQL, at the price
of performance.

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.


>
> - A language with a flexible array or array-like object. One of the
> things I love about PHP is the ease with which an array can be
> populated (eg "MyArray[] = 'a new value';" adds "a new value" as a new
> item to the array MyArray).
>

Here's the syntax for each:

Perl
----
push(@arr, $value); # as you can see, not OO. parenthesis optional.
length(@arr) # non-OO, cannot be overridden.


Python
------
arr.append(value) # OO, parenthesis NOT optional
len(arr) # non-OO, albeit it can be overridden


Ruby
----
arr << value # OO (even if it does not look like it)
arr.push(value) # same as above -- parenthesis are optional.
arr.size # OO, can be overriden and aliased like
arr.length

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


> - A language with strong Regular Expression abilities, and string
> manipulation tools / methods.

Perl has the best (and oldest) regexp engine, albeit the latest Python
and Ruby engines are more or less on par. Perl's syntax is pretty
simple and elegant, albeit since Perl also uses $, @, % and other
symbols for other constructs, it can also get somewhat confusing:

$str =~ /regex/; # match regex against str
sub($str, /regex/, 'repl');
print $1,"\n"; # print first grouped match

Perl has a bunch of global variables that get set as regexps are
executed. These contain last/previous matches, groups, etc.
Perl supports accessing variables within regexps.


Ruby1.8's regexp engine is less powerful than Perl's or Python's as it
does not have backtracking, named groups or unicode (if you don't know
what that is or care, ruby1.8's regexp are perfect for you already).
Ruby1.9 uses a new regexp engine which is on par to Perl's and
Python's.
Ruby's regexp engine syntax is also very elegant and similar to
Perl's:

str =~ /regex/
str.sub(/regex/, 'repl')
m = str.match(/regex/)
puts $1 # first match
puts m[0] # first match
puts m['named'] # named match (ruby1.9 only)


As ruby does not use symbols as much as Perl, ruby's regexps are a
little more readable. Also, some things that in Perl require extra
switches, Ruby's parser can handle them directly (know when to compile
once the regexp for example). Ruby also has the same globals as perl,
but it can also mimic's python's way of working with regexps.
Ruby supports accessing variables within regexps like Perl and
arbitrary expressions, which is very elegant:

var = 'hello'
r = /^#{var}/

obj = []
r = /^#{obj.size}/


Python2 (not 1.5) now has a good regexp engine on par with Perl, but
its syntax is a little more cumbersome, as it is not native to the
language:

import re # this is the regex module

re.compile(r"regex").match(str)
m = re.match(r"regex", str)
re.sub(r"regex", 'repl', str)
print m.group(0) # print first group
print m.groupdict('named') # print named group

Annoyingly, regexps in python often require an additional r""
character to avoid some quotation rules to take over (it is legacy
from 1.5 python, mainly).
Python cannot interpolate variables or run expressions within a
regexp. You often need to do a printf() kind of thing, like:

var = 'hello'
r = re.compile(r"%s" % var )

obj = []
r = re.compile(r"%s" % len(obj) )


>
> So, would anyone be able to help me work out if Ruby is the language I
> need?
>

Sure. It can do all you want.

Chad Perrin

3/10/2007 8:37:00 AM

0

On Sat, Mar 10, 2007 at 12:23:04PM +0900, 7stud 7stud wrote:
> Chad Perrin wrote:
> > In the quartet of commonly cited web
> > scripting languages (Perl, PHP, Python, and Ruby), PHP's regular
> > expression handling is by far the worst. It's kludgy, inconsistent, and
> > unwieldy. I try to avoid it. I don't like Python's much either, but
> > it's a darn sight better than PHP's.
>
> It seems like regular expressions are slightly different from language
> to language, but not so much so that it is much of a problem. Although,
> if you are used to using advanced features like negative look behinds,
> and they aren't available in the language you are coding in, I guess
> that would be frustrating. What deficiencies are there in Python's
> regex support?

If you've ever noticed the way OOP characteristics look bolted-on in
Perl, you might understand how regex support looks bolted-on in Python.
For one thing, regex support is provided only through a library, rather
than as part of the core language -- in other words, it really *is*
bolted on.

It's better than Java's regex support. In fact, it may be in the top
half-dozen languages for regex support, but after extensive use of
Perl's it feels half-baked. So far (which isn't too far yet), Ruby's
regex support is a very close second to Perl's, in my opinion. In fact,
there are a couple things I think Ruby does better.


> >
> > That's a pretty good take on it.
> >
> > The languages I'd suggest, off the top of my head, for the tasks
> > mentioned here include:
> >
> > Perl
> > Python
> > Ruby
> >
> > Each has its benefits and detriments, of course. I personally am not a
> > fan of Python, but it's still a great language in (most of) the ways
> > that matter. Ruby's my favorite, by a long shot, for OOP. Perl may
> > provide the most comfortable syntax for people who like a unixlike
> > environment (including me). All three of them handle the needs outlined
> > in the original post of this thread admirably.
>
> I've been looking at Ruby and Python this week, and I am drawn more to
> Python. I went through the "Ruby in 20 minutes tutorial" at the Ruby
> website here:
>
> http://www.ruby-la...
>
> and the syntax is not that appealing to me. I also started reading the
> book "Dive into Python", which targets experienced programmers moving to
> Python, and which is also available for free download at the author's
> web site:
>
> http://www.diveintop...

You might want to judge Ruby syntax on something other than a
demonstration of irb.

One of the problems I have with Python's syntax is that it always looks
unfinished, somehow, to me. I realize that the footnote-like
construction of Python source code might be more appealing to some
people, but not to me. The way things look in irb examples isn't really
representative of Ruby code in general, though.


>
> It's given a 5 star rating in the python book reviews here(click on the
> book names for the full reviews):
>
> http://www.awaretek.com...
>
> How great is that?! A free 5 star rated programming book? It has a
> unique format: the author starts each section with a few lines of some
> indecipherable code, and then spends the rest of the section introducing
> the concepts and language features that make the code crystal clear by
> the end. The first two chapters are definitely worth reading, and they
> introduce Python's data structures: arrays(called "lists"),
> dictionaries("associative arrays, i.e. arrays with non numeric index
> values), and tuples(immutable arrays).

There's a quality Ruby book for just about every writing style out
there. Between Programming Ruby, Learning to Program, Everyday
Scripting, The Ruby Way, Why's (poignant) Guide, and half a dozen other
notable works, each written in a different style so that they don't tend
to be redundant, there isn't much ground left uncovered. Shop around a
little, and you can probably find what you need -- if what you need
involves Ruby. Just stay away from Mr. Neighborly's Humble Little Ruby
Book. In my opinion, it's organized exceedingly well to get a beginner
started, but written just as poorly as the organization of it was done
well.

Of those, early versions of Programming Ruby and Learning to Program, as
well as the only edition of Why's (poignant) Guide (and the Humble
Little Ruby Book for that matter), are available for free online.


>
> The poster might be interested in a quick look at a "python in 10
> minutes tutorial":
>
> http://www.poromenos.org/tutori...
>
> Anyway, I was wondering if you could give some further insights into why
> you prefer Ruby and don't like Python?

I've done a little of that. I could explain more if you like, but it'd
be a short email -- I spent a fair bit of time giving it a good look,
decided I didn't like what I found, and set it aside. I then proceeded
to forget most of what I knew, so I'm not sure I'd even remember the
specifics so well. I mostly just remember that I prefer other
languages, I suspect.

. . though I'll probably come back to it and really learn Python at
some point in the distant future. You know, when I'm done with Ruby,
UCBLogo, Objective Caml, Objective C, Common Lisp, Scheme, Haskell, Perl
6, and refamiliarizing myself with C. I'm pretty sure refamiliarizing
myself with Java comes after Python, though.

Unfortunately, the realities of the work world will probably result in
learning even more PHP before I get to Python, too. Ew. On the other
hand, as I learn about Rails, I find that if at all possible I'm far
better off if I can convince any clients that Rails is the way to go
than to go with PHP, all else being equal.

(Brief anecdote, re my happiness with Rails:
I followed along with the text in Agile Web Development with Rails, and
found myself thinking "Woah, this is talking like I already have a
database set up, but I don't remember anything about that." I went
back, read between the lines a bit, and realized that creating database
tables is so absurdly easy in Rails that I'd already done so and didn't
even realize it. I mean, really. So easy, it's scary.)

--
CCD CopyWrite Chad Perrin [ http://ccd.ap... ]
"It's just incredible that a trillion-synapse computer could actually
spend Saturday afternoon watching a football game." - Marvin Minsky

John Joyce

3/10/2007 9:08:00 AM

0

all of the languages you're looking at are available for WinXP.
toy with each one and see which one strikes you as feeling right.
They can do pretty much the same things. But every language has
things it is better for. You don't have to use just one. Just use one
you like or that meets your needs. They're tools, not religions.
But that said, at some point if you're seriously wanting to learn
these things, understand they were all originally created in C on
some form of Unix/Linux, so you couldn't hurt yourself by dabbling in
C and definitely could learn a lot by learning to use the command
line in a *nix system and learning the *nix style of directories and
stuff. It makes a lot of languages make more sense. Seems like a tall
order, but you won't regret it. Download Ubuntu or Kubuntu and
install it to a partition or external hard drive. (or get a Mac and
make it all easier on yourself)

raims

3/10/2007 12:13:00 PM

0

Chad Perrin <perrin@apotheon.com> wrote:
> If you've ever noticed the way OOP characteristics look bolted-on in
> Perl, you might understand how regex support looks bolted-on in Python.
> For one thing, regex support is provided only through a library, rather
> than as part of the core language -- in other words, it really *is*
> bolted on.

That's maybe a deficiency in language design but I don't think the
Python's regex support is worse because of that. The 're' module
<http://docs.python.org/lib/module-r... is very comprehensive and
it's object oriented. The matching objects are _objects_ indeed. Ruby
does have regexp support builtin but hey, there must be some differences
between the languages or we won't be here to talk about those :-)

> It's better than Java's regex support. In fact, it may be in the top
> half-dozen languages for regex support, but after extensive use of
> Perl's it feels half-baked. So far (which isn't too far yet), Ruby's
> regex support is a very close second to Perl's, in my opinion. In fact,
> there are a couple things I think Ruby does better.

Never been a Perlista so I can't really judge but I do like the builtin
Ruby support for regexp and I don't dislike the Python's one (being
mostly a Pythonista myself) so I guess I'm caught up in the middle.

> You might want to judge Ruby syntax on something other than a
> demonstration of irb.

I agree. My first taste of Ruby syntax was not really that good but
after a couple of more bites I really enjoyed the meal and there are
cases where I find Ruby to cleaner than Python.


--
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

raims

3/10/2007 12:13:00 PM

0

gga <GGarramuno@aol.com> 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/pyth...
http://www.python.org/ftp/python/2.5/python-2....
http://www.python.org/ftp/python/2.5/python-2.5...

> 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
<http://www.sqlalchem...

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