Summary: strong/weak typing and pointers

Alex Martelli aleaxit at yahoo.com
Thu Nov 4 16:00:33 EST 2004


Steven Bethard <steven.bethard at gmail.com> wrote:
   ...
> I wonder what people think about Ruby, which, I understand, does allow you to
> modify builtins.  Can anyone tell me if you could make Ruby strings do the
> horrible coercion that PHP strings do?

Yes, you could.  Reliable Ruby friends tell me that's not DONE in the
real world of Ruby, any more than pythonistas call their methods' first
argument 'foo' rather than 'self' or pepper their code with 'exec'
statements or code 200-chars nested-lambda oneliners.  But though
culturally frowned on, it _is_ technically possible.

The one real example I saw, which was enough to turn me off my quest to
explore Ruby for production purposes, was making (builtin) string
comparisons case-insensitive -- apparently that _IS_ the kind of thing
_SOME_ perhaps-inexperienced Rubystas _DO_ perpetrate (breaking library
modules left, right, and center, of course).  Maybe it's similar to
rather inexperienced Pythonistas dead keen on "exec myname+'='+value"; I
_have_ seen that horror perpetrated in real Python code (doesn't break
any library, but slows function execution down by 10 times w/o any real
advantage wrt dicts or bunch usage, and is a bug-prone piece too...).


Alex



More information about the Python-list mailing list