On Mon, 16 Oct 2006 04:38:09 -0700, Avatar wrote:

> I would like to hear people's opinions on the ability to use variables
> without declaring them in dynamic languages like Ruby.
> 
> It would seem to me that an argument for non-declared local variables
> that typically occupy a small scope could be made. But, class
> variables? What is the benefit in allowing for runtime definition of
> class variables?
> 
> Are there real tangible benefits that non-declared, dynamically typed
> (at binding time) variables provide? Or do dynamic variables simply
> create less compile time errors and more (harder to catch) runtime
> errors?
> 
> Thoughts?

I was programming in Java last week, and writing typed code. I found that
after about an hour of coding, my code would have worked correctly (it
would have been less time if Java supported operator overloading the way
ruby does), but I still had to spend another hour getting the types
appropriately declared, and typecasting things correctly as I pulled
objects out of their various collections.

C++ can be worse. I wanted to use the Boost Spirit library for CFG
parsing, and found that I couldn't read the compile errors I was
getting because 90% of the text was multiply nested template types. The C++
Standard Template Library uses templates so much to get close to Ruby's
flexibility, but the result is still more complicated than Ruby,
impossible to debug, and less flexible. At that point, why not go all the
way to a dynamically typed language?

--Ken Bloom

-- 
Ken Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
I've added a signing subkey to my GPG key. Please update your keyring.