Aryeh Gregor wrote:
On Wed, Sep 24, 2008 at 5:44 AM, tstarling@svn.wikimedia.org wrote:
Revision: 41222 Author: tstarling Date: 2008-09-24 09:44:45 +0000 (Wed, 24 Sep 2008)
Log Message: ----------- Fixes for r41154 and r41155: * Boolean parameters are widely accepted to reduce readability. Replaced the new boolean parameters with class constant parameters instead.
I thought you said you preferred literal strings to class constants.
In some cases, yes. I think literal strings are especially useful when there's a lot of options, and they're defined at runtime, such as with magic words or user rights.
Defending the API, Yurik argued that class constants provide a useful level of parameter validation, which I think is a reasonable argument in some cases. They also fit in with the existing practice in Revision.php (the DELETED_* constants).
-- Tim Starling