A fully late bound namespace proposal

Andreas Raab andreas.raab at gmx.de
Fri Oct 5 05:57:41 UTC 2007


nicolas cellier wrote:
> Funny Andreas, we could have said exactly the same about messages...
> Sure a lot of curly brace defenders have already.

Not quite. There are various real problems that you can only solve via 
late-binding method names to their implementations (inheritance for 
example makes little sense if you need to know whether you're going to 
call a function with an Orange or an Apple instead of just generally 
using a Fruit). Whether using late-binding *exclusively* solves any real 
problem I'm personally not so sure. There have been numerous times where 
I wished to have the ability to early-bind methods and rather recompile 
everything upon a change instead of being forced to use late-binding (we 
pay a major price for this; both in terms of runtime and development 
costs because in the case where we need it we have to punt and use C 
instead).

But late-binding class names? I'm sorry, but I really fail to see which 
problem this is supposed to address (and I have the distinct feeling 
neither do you because otherwise you probably would have pointed out at 
least one good reason why it is advantageous ;-) Besides, I would like 
to point out that we often use late-bound classes already (browse those 
implementors of #controllerClass in MVC) and that classes are 
automatically kept up-to-date (which would be a good reason for 
late-binding them otherwise). And as if that weren't enough you can just 
assign them if you'd like to use some other class instead. So, once 
again, what is the advantage of late-binding class names? And how does 
it outweigh the price you'd have to pay?

> From a pragmatical POV, you're probably right.
> But from a historical, not sure...
> Be a future VM able to transparently inline those lookups, that your 
> arguments might vanish.

In which case I'll happily late-bind them. Because if there is no cost 
associated with it then there's really no reason not to (outside 
security). I have no general problem with late-binding class names 
(security concerns excluded) but given the price, I'd like to know why 
exactly I should be paying it.

Cheers,
   - Andreas




More information about the Squeak-dev mailing list