3 ms·
It's a good distinction to make. In the example given, while the code itself looks and does the same - comparing a date to the current date - they represent two
by Cthulhu_ 2y ago
It's a good distinction to make. In the example given, while the code itself looks and does the same - comparing a date to the current date - they represent two different business logic processes, which can change over time.
I mean if there's more instances of this (the DRY "rule" usually says that you deduplicate if there's 3 or more instances) you could refactor it into a utility like "isBeforeNow", but that doesn't add that much value.