By bloid
via jeremyjarrell.com
Published: Oct 30 2007 / 03:43
Recently I came across some code in a framework that was performing different calculations on data as it was retrieved from data source. The framework had a set of derived columns, each of which represented a set of predefined calculations against the retrieved data. For example, we may have had a Sum column which was responsible for adding the values of two other columns together. We also may have had a Difference column which was responsible for subtracting the value of one column from another column. This is a pretty common, straight forward situation which I'm sure that nearly everyone has encountered at some point in their career.
Comments
dzonelurker replied ago:
Refactoring to the worse. Enums are easier to understand.
robse replied ago:
Agreed. But it's the wrong use of enums anyway.
Refactoring a looooong switch-case away is always good.
lipe775 replied ago:
That was some really bad use of enums.
dzonereader replied ago:
Cool Idea, bad example.
Voters For This Link (15)
Voters Against This Link (3)