Do signatures really work in practice? (Re: Could Python supplant Java?)

Greg Ewing see_reply_address at something.invalid
Fri Aug 23 02:51:05 CEST 2002


Stuart D. Gathman wrote:

> An improvement on this is the "signatures" extension in GNU C++.  ...

> With a signature, any object that has the methods in the
> signature can be assigned to the variable - regardless of how the object
> was declared.


On the face of it, this sounds good, but do you know
how much experience anyone has had at actually
*using* this?

A problem I can see is this: In order to be able to
pass any suitable object A to a method B, whoever
wrote B must have been diligent enough to specify
a suitable signature for its argument, that includes
only just what is required for B to work properly,
and no more.

Since the minimum requirements can, and probably
will, vary from method to method, this would seem
to require writing a very large number of signatures,
potentially one for every argument of every method.
And if you change a method so that it calls something
that it didn't call before, you'll have to update the
signatures of its arguments, and the signatures of
everything which calls it, etc. recursively. In
other words, a huge amount of administrative overhead.

All this is just theoretical musing on my part, though.
So I'd be quite interested to hear of any experiences
at using signatures on a large scale, and whether
this sort of problem turns out to exist or not
in practice. Anyone know of any published papers,
articles, essays, newsgroup comments, etc. about this?

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list