11/19/05: Feature Envy Rule of Thumb

If you're looking at a method and you see a lot of references to different objects inside it, do the following experiment:

Make the method static (which means turning the "this" pointer into a named parameter). Now count the number of times each object is referred to.

What object is referenced the most? Chances are that it would go better as a method on that object.

And if you can split it into meaningful chunks, each of which primarily references a different object -- then divide and conquer.

Comments made

You can be sure that you will find a hat that fits your own style. The cap are very versatile.People consider that the trend is of 90s and it is no longer in anymore,>cheap tisa snapbacks but that is quite wrong once you wear it to the party everyone starts following the trend and in no time you are a trend setter.
04/26/12 02:29:58

Add comment

Sorry, but due to blog comment spam, I have to ask you to create an account before you post a comment. Please log in (using the form on the top right of the page) or click here to create an account: Create an account!