in reply to Re^4: Is there an easy way to get the start date of the current week?
in thread Is there an easy way to get the start date of the current week?
(Magic numbers == bad)
I'm amazed, given your programming experience, that 86,400 isn't as memorable to you as 1024 or 65536. It's certainly has been a number I recall without thinking about, for longer than I care to think about.
43,200 isn't so familiar. But then, if you see a number that you don't recognise, then it's as well to question "why that number". Sure, I could have use 12*60*60, or a constant HALF_A_DAY_IN_SECONDS, but would anyone have then though about "why half a day"?
Assumptions == bad. Code that make you question it == good.
|
|---|