From: Rik Hemsley Date: 2001-12-11T08:48:42+09:00 Subject: [ruby-talk:28153] Re: The benefits of dynamic typing? On Monday 10 December 2001 8:00 pm, you wrote: > In a static OO language (Java, C++) variables have to hold objects of a > certain type (which tends to lead to all kinds of casting which sort of > negates the advantages of compile-time type checking). In a dynamic OO > language like Ruby or Smalltalk all that is required is that an object > respond to a certain method. I think the main problem with static typing is that it's so hard to enforce when writing a compiler. As for casting, well, I don't find myself using reinterpret_cast<> in C++ very often, so I wouldn't say that casting 'negates the advantages of compile-time type checking.' Casting is quite legitimate in some cases, and it can usually be made safe, though if you look at the recent discussions on gcc's dynamic_cast, you can see how hard it is to implement this and make it work properly with things like runtime loaded modules. Rik