November 2017
Intermediate to advanced
670 pages
17h 35m
English
We start with a getDiscountedPrice function that takes two parameter: lineItemPrice and discount:
lineItemPrice := quantity * itemPrice; discount := getDiscount(); totalPrice := getDiscountedPrice(lineItemPrice, discount);
Replace Parameter with Method aggressively strives to reduce the number of parameters.
In this case we have two parameters. That is clearly fewer than the four parameters. Why reduce this low number of parameters?