3 ms·
Yup, I very much favor SPOT. SPOT often means you must not repeat yourself, but abstraction isn't always the answer. Look at my comment upthread where I attac
by LorenPechtel 2y ago
Yup, I very much favor SPOT. SPOT often means you must not repeat yourself, but abstraction isn't always the answer.
Look at my comment upthread where I attack this differently. We have a truth: Date is in the future. That should have a single point of truth--a function that checks if the date is in the future. Perhaps one with a boolean return (if you're in a position to handle it) and a wrapper that throws if the check fails (if you're not.) Pull out that truth even if you have separate code paths for the two things.