We had big discussion about small peace of code in our team.
Example 1 developer added extra local variable to make code more readable. In local variable he saved value from constant.
Example 2 same code without extra variable, but less readable from our developer point of view.
What do you think is more readable? Better from refactoring point of view?
1.
var tolerance = Constants.DateTypeGeneratorTolerance;
var dayType = DateTypeGenerator.GenerateDateType(
courseTripValidity,
tolerance,
symbols,
startDate,
endDate);
2.
var dayType = DateTypeGenerator.GenerateDateType(
courseTripValidity,
Constants.DateTypeGeneratorTolerance,
symbols,
startDate,
endDate);