------ art_8753_22467206.1156290015963 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/22/06, David Vallner <david / vallner.net> wrote: > > In dynamically typed languages, the type of an object isn't its "class" > or any other predictable concept, it's just the protocol it adheres to > during its lifetime. Most such languages also make no presumption that > this protocol, or the behaviour of an object remains the same during its > lifetime - which makes compile-time checks rather pointless. > > Of course, you rarely use even this aspect of dynamic typing - in fact, > I can't come up with a single noncontrived example for it, these things > just don't occur in daily coding. But dynamic languages sure a heck > faster to type, and the fact the compiler rarely bitches at all is very, > very appealing to people that know what they're doing most of the time. That was a perceptive comment. The fact that there are so few true cases of objects that metamorphose in flight also accounts for the observed "magical" behavior that "duck-typing" seems to "just work" almost all of the time. (By magical, I mean unexpected for people like me with too many years of experience programming in statically-typed languages.) The intention of a well thought-out code path is generally easy to express without typing all the types along the way. It doesn't break often, and when it does break, it doesn't make a big mess. ------ art_8753_22467206.1156290015963--