logoalt Hacker News

x0x0today at 6:45 AM4 repliesview on HN

You have to admire the person who designed the flexibility to have 87239 seconds not be old enough, but 87240 to be fine.


Replies

dspilletttoday at 2:03 PM

Probably went with the simplest implementation, if starting from the current “seconds since epoch” value. Let the user do any calculations needed to translate three days into that measurement.

It also efficiently annoys the most people at once: those what want hours will complain if they set it to days, thought that want days will complain if hours are used. By using minutes or seconds you can wind up both segments while not offend those who rightly don't care because they can cope with a little arithmetic :)

Though doing what sleep(1) does would be my preference: default to seconds but allow m/h/d to be added to change that.

show 2 replies
zelphirkalttoday at 9:42 AM

I actually think it is not too bad a design, because seconds are the SI base unit for time. Putting something like "x days" requires additional parsing steps and therefore complexity in the implementation. Either knowing or calculating how many seconds there are in a day can be expected of anyone touching a project or configuration at this level of detail.

show 3 replies
scoutttoday at 3:34 PM

Well, you have 1000000 microseconds in between. That's a big threshold.

raverbashingtoday at 7:01 AM

This is the difference between thinking about the user experience and thinking just about the technical aspect