Lazy eval

BCS BCS at pathlink.com
Tue Aug 22 08:54:30 PDT 2006


Walter Bright wrote:
> 
> Changing an API and thereby breaking (obviously or subtly) the user code 
> is as old as programming ("DLL hell" is a term probably older than many 
> programmers!). The only answer I can think of is, if you must change the 
> API of a function, and you have legacy users of it, give the changed one 
> a new name and tag the old name with 'deprecated'.

The problem isn't that changing things, breaks stuff. It it that going 
from (T) to (T delegate()) is almost always valid, but the programmer 
can *never* assume that it is.

Thinking of it that way, changing the API from one to the other is 
*never* safe. This means that using a T delegate() as a parameter might 
as well be considered an unsafe practice. If you started with just T, 
your locked in for all time. Starting with T delegate() is almost as bad.

Having a feature that is nearly impossible to use safely may well be 
worse than not having the feature.



More information about the Digitalmars-d mailing list