On 12/4/06, Zouplaz <user / domain.invalid> wrote:
> Hello, when I compare Ruby to Java there is something I don't understand  .
>
> For example, let say that I create instances of JDBCFooBaseDriver in
> Java - The methods and their behaviors will never change, unless I
> update JDBCFooBaseDriver jar file. I can be sure that this part of my
> environment will stay the same even if new third party libraries are
> added and used by my application.
>
> Now, in Ruby I can use a new library (FancyDates) that will alter the
> behavior of some JDBCFooBaseDriver methods - Some methods of
> JDBCFooBaseDriver will be redefined by FancyDates and new methods will
> be added - All this stuff will occurs without giving me a chance to be
> informed of what is going on under the scene.
>
> So,
>
> 1) Is what I say right ?
> 2) Why should I not be scared by that ?
> 3) Why most C#, Java, C++ developper thinks that this approach is
> dangerous and lead to bad practices ?
>

I can only speak from a Java perspective here, but if you look at what
most frameworks and (shudder) containers out there do, you'll find
there is an enormous amount of reflection going on. The more modern
frameworks also make use of runtime bytecode manipulation. Both of
these techniques introduce the same type of dynamics into a project
(and negate the "advantages" of static typing), but - unlike Ruby - it
is almost impossible to understand what is going on under the hood.
And every framework does things in a different way. At least with
Ruby, you can recognise this kind of metaprogramming easily, and if
used in libraries its use is normally well documented.

Ruby programmers are simply more aware of these features and are
therefore able to use them effectively.

Cheers,
Max

> Thanks
>
> If this question have been answered many times, feel free to only
> provide some links to references.
>
>