3 ms·
As someone who has not seen this syntax before, it's OK. But, "timezone" shouldn't be a separate method, it should be a parameter to the function taking the tim
by CGamesPlay 3y ago
As someone who has not seen this syntax before, it's OK. But, "timezone" shouldn't be a separate method, it should be a parameter to the function taking the time specification. Functions named as nouns should be named "onNoun" instead (onWeekdays, onDays). It's also very unclear what happens if I do something like ->daily()->weekdays() ("daily on weekdays") or ->weekdays()->lastDayOfMonth('15:00') ("on the last weekday of the month at 15:00").
- hu3 3y agoWhile I agree with most if not all your points. Let's agree that "should" is a strong word for what is basically our opinion. These are all debatable. For example: - Prefixing everything with "on" adds noise. It's debatably intuitive enough as it is. - Demanding timezone arguments on these methods also adds noise. More often than not you just want to use system default noise since it is such an important thing that you want to control at a higher level anyway. - It can be okay to allow edge/confusing states if the tradeoff is to keep implementation simpler. One can always rely on unit tests to keep expectations in check.