On Tue, 5 Dec 2006, Edwin Fine wrote:

> The bottom line seems to be that the current crop of Ruby programmers
> are responsible enough not to mess with things under the hood unless
> they understand the workings.
>
> Is this an accurate assessment?
>
> What scares me a bit is when Ruby becomes extremely popular and every
> second programmer is using it, and less-disciplined developers start
> providing libraries that tinker with core classes willy-nilly. At some
> point you are going to get clashes between two same-named add-on methods
> in (say) Array, that do different things <shudder>. That could be fun to
> debug.
>
> Sure, you can decide not to use such a library, but you have to get
> burned first before you realize it's not good to use. I'm probably
> showing my age here, but I remember cases where people used to code
> macros in C header files (like MIN and MAX) that would clash with other
> uses of MIN and MAX and cause untold havoc. Some of these were from
> mainstream companies.

   harp:~ > irb
   irb(main):001:0> Array.freeze
   => Array

   irb(main):002:0> class << Array; def each() 'ha-ha'; end; end
   TypeError: can't modify frozen object
           from (irb):4
           from :0


> It's one thing to say "What if I'm stupid?". It's quite another thing to
> say, "What if lots of stupid/undisciplined people start using Ruby?"
> This tends to be the price of language popularity, I fear.
>
> Probably, evolutionary forces will get rid of the poorly designed
> libraries in time. I'm more worried about the beleaguered corporate IT
> developer who often does not have much choice and has to use in-house
> code.
>
> I dunno. Thoughts?

what if people start coding in c and leave dangling pointers lying around,
double free pointers, corrupt the heap in their lib, forget the clean-up
resources in at_exit handlers, or don't prefix each and every
var/function/macro with something like my_lib_XXX?

where would we be?  ;-)

i can hear people thinking 'java' out there already - but those guys are
manipulating byte code to subvert their fist-cuffs already!  anyone know a
thing or two about boost::any?  on a related note, it seems the most useful
ocaml code uses the type system in a way that makes the promise of 'safe'
programs more difficult or impossible for the compiler to ensure...

history has shown that there is exactly __one__ re-usable component of code:
the shared library.  at least in the *nix world, nearly all of them are written
in c and it is plagued by issues at least two orders of magnitude, imho, worse
than clobbering Array#each!  yet, the internet continues to be powered by *nix
servers running said c libraries ;-)

(ducking)

-a
-- 
if you want others to be happy, practice compassion.
if you want to be happy, practice compassion.  -- the dalai lama