[wp-testers] 2.3 Nightly - Plugin Compatibility

Travis Snoozy ai2097 at users.sourceforge.net
Thu Aug 30 19:12:50 GMT 2007


On Thu, 30 Aug 2007 10:38:05 -0400, Mark Jaquith
<mark.wordpress at txfx.net> wrote:

> On Aug 30, 2007, at 12:50 AM, Travis Snoozy wrote:
> 
> > IMHO, the change is more "subtle and insidious" than "low
> > impact" ;). Adding values to enums means hitting "default" in any
> > switch statements
> > for those enums, and that either leads to (a) incorrect behavior
> > (e.g., default == everything else == published), (b) an error (i.e.,
> > default == unknown == WTF? Error!), or (c) incorrect behavior that
> > looks correct (e.g., default == everything else == unpublished;  
> > correct
> > in the case of "pending").
> >
> > I can guarantee that this will be a problem for In Series, at least.
> 
> It's good to keep these things in mind as you code plugins.
> Consider using multiple OR'd conditions instead of a negated
> condition that may in the future include unwanted results.

Show me code that does not fall into one of the three categories I
described when you add values to an enum. I contest that it cannot be
done without some a priori knowledge of what the new enum value(s) will
be, but I'm open to being proven wrong. :)


-- 
Travis


More information about the wp-testers mailing list