Simetrical wrote:
On Sun, Jun 8, 2008 at 6:48 AM, werdna@svn.wikimedia.org wrote:
+// Define new autopromote condition +define('APCOND_TOR', 'tor'); // Numbers won't work, we'll get collisions
Speaking of which, is there any reason for us to ever use named constants like APCOND_TOR rather than just strings? This isn't C, after all. I think it would be wise to deprecate such things for the future and just use strings, arrays of them if necessary, as with wfMsgExt() and similar. (Although in this particular case a named constant might be better, to be consistent with the already-established core conditions.)
I had this argument with Yurik over constants in the web API. He said that constants provide validation because they'll throw a notice if you use one that's not defined. I'm not convinced, I think they're pointless, except when you want to make a bitfield.
-- Tim Starling