Home Segments Index Top Previous Next

190: Mainline

If you write a program that is littered with places where fat grams are converted to calories by multiplication by 9, you will have to make many changes if you want to augment, improve, or change the way fat-to-calories conversion is done. On the other hand, if you write a program in which the multiplication by 9 is confined to a fatToCalories method, you will need to make only one change.