ben lowery

Great advice to keep in mind when designing methods

Nov 16 2005

As stated in the SLAR notes for System.Net.Authorization, avoid boolean parameters to methods.
Use an enum that captures the intent of the parameter instead. I hate
System.String.Compare(string, string, bool) for just this reason.
String.Compare("ben", "Ben", true) just looks silly to me. I much
prefer the new version that takes a StringComparison enum, resulting in
String.Compare("ben", "Ben", StringComparison.CurrentCultureIgnoreCase).

Related posts:

  1. A TraceListener that writes to the Console
  2. So Great
  3. .net annoyances
  4. Dojo’s little gems
  5. A great little omelet pan

Leave a Reply