Episode 29. Variables

Regarding Episode 29, I notice that the pointsForCurrentRound function makes use of a “magic” number …100… when calculating the end result. While you cleaned up the code and made it ‘DRY’, you did not address the issue of defining this number.
Is there a reason for this? Why not create a variable, say …let maxPoints = 100; then everybody knows what the 100 is meant to be? In all other languages that I have learned this goes right along with DRY.

This topic was automatically closed after 166 days. New replies are no longer allowed.