Be True to Yourself
DRANK

Ben M recently inherited some code from some Highly Paid Consultants. These consultants needed to be able to set some flags to control the behavior of the application, and for whatever reason, these flags needed to be strings. It probably wasn't a good reason, but there was some reason. The consultants wrote the module which set the flags, and guaranteed that the flags were only ever "true" or "false". To parse those flags back into boolean values, they did it the true Highly Paid Consultant way: they used a generic "string to boolean" solution they copied from Stack Overflow instead of Boolean.Parse, the built-in C# method for turning "true" into a boolean value.

thedailywtf.com
Related Topics: X as a Service C#