Early vs. late binding dogma/experiences?

Seeking to learn from other's experience:

I'm probably a knee-jerk static kind of person (SML, Java) but have heard plenty of smart folks extoll the virtues of late binding [1] [2]. And I think I'm even seeing those once-pretty-static places have to loosen up for pragmatic software development/engineering reasons [3] [4].

What is a good middle ground, theoretically? Where is a good middle ground, in terms of a concrete language or system available today?

thank you.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

What is Late Binding?

Maybe we need to start with a definition of what late binding is? You mention that Java is static, and seem to imply that it is not late bound. But quoting from the abstract of Complexity Analysis of Late Binding in Dynamic Object-Oriented Languages :

Late binding is an essential feature of most object-oriented programming, and is present in most object-oriented languages, e.g. Java, CLOS, Smalltalk, C++

Right you are

Apologies, and thanks for your comment; I a) didn't sufficiently think through what I was saying and b) am still not fully educated on typing and terminology. I think I mainly mean compile-time vs. run-time type checking.

I'm mainly concerned with "when can the type error happen?" and "what are your options for handling it?" (Stated like that, they are lame in and of themselves for LtU. :-)

The reason I was thinking about them was the Spring paper talked about using dynamic casting / type checking for things I hope could actually be done with some appropriate static / compile-time approach. I don't know what such a system is exactly, so I was hoping others with experience and smarts could suggest "XYZ is like Spring but doesn't need all the dynamism and yet is as flexbile for versioning and the 'auxiliary property' problem".

Then, I was coming across articles about deferring binding as late as possible. That could either mean Java-OOP-esque late binding (not casting) which shouldn't generate binding exceptions, or it could mean Smalltalk-esque 'message not understood' which I think is a code smell although apparently which gains much power.

And I conflated it all into a bigger question of: how to get flexibility which supports the thinking behind things like Spring and Smalltalk, while being able to avoid runtime binding errors?

so much for my recollection

hm, well, last time i asked (d'oh), HOP sounded very interesting (although perhaps not too much beyond the academic stage yet?). i need to ponder how the versioning and auxiliary properties type things from Spring can be better done with it.

(hm, misc other possibly interesting thing: refinement kinds "to statically check the use of run-time dynamic typing".)