Earlier quoted context omitted.
Mmm... ageAlertThresholdHours = 24 + // backup interval 2 + // approx backup duration 2; // "wiggle room" No static assert needed, no need to pre-compute the total the first time, and no need to use identifiers like `approxBackupDurationHours`, the cognitive override about the possibility of colliding with other stuff that's in scope, or the superfluous/verbose variable declaration preamble.
I'm a believer in restricting the scope of definitions as much as possible, and like programming languages that allows creating local bindings for creating another. For example: local val backupIntervalHours = 24 val approxBackupDurationHours = 2 val wiggleRoomHours = 2 in val ageAlertThresholdHours = backupIntervalHours + approxBackupDurationHours + wiggleRoomHours end Then it's easier to document what components a…
Re: Maybe comments should explain 'what' (2017)
#211[deleted]