Paul on Default Arguments
Paul
Vick chimes in on default arguments. He has some good points; I can believe
the main problem with my
example is one of generally bad API design. But I think the technical issue of the
default arguments being burned into the callsite still exists… Even though it is
a gray area I think changing defaults, especially implementation in nature, is a
right a library designer may need to preserve for herself. For example, changing the default size
capacity of ArrayList…
There is a bigger issue which Paul’s
post makes me consider. If we did
allow default arguments what simple consistent rule would we use for deciding
when to use one or the other? If we
moved away from the simple rule of “never use default arguments in a publicly
exposed API” would we get into another debate like the ID
one (or is Id)?