Live data from Hacker News

Maybe comments should explain 'what' (2017)

hillelwayne.com

211–212 of 212 posts

Re: Maybe comments should explain 'what' (2017)

#211
post #142

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…

[deleted]

Re: Maybe comments should explain 'what' (2017)

#212

Earlier quoted context omitted.

By decoupling your application logic from your UI toolkit.

So, when operating system gives you invalid file, it magically becomes valid, because your UI code is in a different file. Sure, that sounds plausible.

I suggest you read up about encapsulation.

Have a good day and happy new year!

Post reply on HN