On Tue, 17 Apr 2001, Dave Thomas wrote:

> Now, turn the question around. What do you gain by abandoning this
> limited form of safety?
> 
> Well, we gain immense flexibility. Refactoring Smalltalk and Ruby is
> trivial compared to (say) Java. Things just move around. There's no
> need to jump through hoops to satisfy the compiler.

The way I think of this is "easy in, easy out". The data goes into the
method easily since you can just define it, and the data comes out of
the method easily since you can just use it. There's no pre-coding to
condition the program to handle the data.

Types are meta-data, so embedding types into code is just embedding higher
level data into code. When changing code in strongly typed languages, the
process is essentially a parallel re-write. Change the code, change the
types, change the code, change the types.

Removing type information loosens the strong binding between code and
data, like separating embedded code from HTML. Refactoring becomes a
linear process of change the code, change the code.

Ruby isn't a type-less language. The type information has been moved
into the data and moves around with the data. The meta-data has been
normalised to the data and code can get back to the job of being
program instructions.

Another aspect I've noticed is that in C, I was forever passing around
complicated structures. In Ruby, I'm mainly using numbers, strings and
arrays. Communication between methods and objects is simpler, and I
don't really know why.

I suspect the lack of typing makes programmers work just that bit
harder to make their classes more accessible. A little bit more
up-front work, a lot more flexibility.

--
  spwhite / chariot.net.au