My proposal is simple:
require that any if statement that compares a constant to a mutable variable
be written as
if (constant == variable)
instead of
if (variable == constant)

this prevents an extremely common programming error
if (variable = constant)

While this is almost always found in testing sometimes thing can slip
through and writing it using the former method will generate a compiler
warning.
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"

Reply via email to