I usually live by the rule that global variables / functions are evil and that every piece of code must live in the class to which it belongs.
This is a very simple rule to follow, and I believe that so far I have never encountered a problem with this rule.
Today, however, I need to add a function to my assembly, and not to a specific class. That is, almost all my classes can use this particular function.
Where should I put this function (+1 overload)?
If I put it in the Utilities class, I feel dirty. If I bind it to a semi-connected class and let other classes call it directly, I feel worse.
This piece of code basically drops IList<PointF> into the normalized list. I feel right now that adding it as an extension method to IList<PointF> might be the best choice ...
c # oop global-variables utility-method
John Gietzen Jul 27 '10 at 0:26 2010-07-27 00:26
source share