Erika’s company wanted to implement this idea as a policy, so they set a limit on how many lines could be in a single method. The thinking was that if each method was short- say, under 100 lines- it would automatically be simple(r), right?
Well, Garret, down the hall, wrote a method that was three hundred lines long. During a code review, he was told to refactor it to simplify the logic and comply with the policy. So he did.
public void Update()
{
UpdateSection01();
UpdateSection02();
UpdateSection03();
}
To read the full article, please visit The Daily WTF
No comments:
Post a Comment