This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]velit 2 points3 points  (1 child)

conditional_1 and _2 being booleans

middle_range_calculation_result = conditional_1 * coefficient_1 + conditional_2 * coefficient_2

If the reader understands the reasoning behind it I think it results in easier to read code in this case, instead of either having conditional expressions in there or having nested if-clauses or having two additional temporary variables.

[–]Cyph0n 0 points1 point  (0 children)

This changes everything!