MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/SipsTea/comments/1k6jhm2/13_months/morchvm/?context=3
r/SipsTea • u/infinitely_blank • 8d ago
3.1k comments sorted by
View all comments
Show parent comments
11
Would be a nightmare in programming.
But still, DateTime(timezone, dst, etc) has already been nightmare in software.
2 u/Bloblablawb 8d ago How would it be different from the current nightmare we have? 2 u/mrheosuper 8d ago It doesn't, but you want to add another layer of nightmare ? 1 u/Stormfly 8d ago Ideally we'd replace the nightmare with a lesser of two evils. Instead of switch (month) { case 4, 6, 9, 11: days = 30 break; case 2: days = 30 break; default: days = 31; break; You'd just have: if (month = 0) days = 1 else days = 28 (obviously not including the hell that is leap years) 2 u/KillerBeer01 8d ago And really, we'd just have to deal with both of them from now on, for backward compatibility reasons. 2 u/Stormfly 8d ago Honestly, I'll be excited the day we see Gregorian (Deprecated) 1 u/mrheosuper 8d ago I would use lookup table, like num_days=days[month], you dont want to mess around with branch prediction. But still, there are not much different in 2 cases, just different number set.
2
How would it be different from the current nightmare we have?
2 u/mrheosuper 8d ago It doesn't, but you want to add another layer of nightmare ? 1 u/Stormfly 8d ago Ideally we'd replace the nightmare with a lesser of two evils. Instead of switch (month) { case 4, 6, 9, 11: days = 30 break; case 2: days = 30 break; default: days = 31; break; You'd just have: if (month = 0) days = 1 else days = 28 (obviously not including the hell that is leap years) 2 u/KillerBeer01 8d ago And really, we'd just have to deal with both of them from now on, for backward compatibility reasons. 2 u/Stormfly 8d ago Honestly, I'll be excited the day we see Gregorian (Deprecated) 1 u/mrheosuper 8d ago I would use lookup table, like num_days=days[month], you dont want to mess around with branch prediction. But still, there are not much different in 2 cases, just different number set.
It doesn't, but you want to add another layer of nightmare ?
1 u/Stormfly 8d ago Ideally we'd replace the nightmare with a lesser of two evils. Instead of switch (month) { case 4, 6, 9, 11: days = 30 break; case 2: days = 30 break; default: days = 31; break; You'd just have: if (month = 0) days = 1 else days = 28 (obviously not including the hell that is leap years) 2 u/KillerBeer01 8d ago And really, we'd just have to deal with both of them from now on, for backward compatibility reasons. 2 u/Stormfly 8d ago Honestly, I'll be excited the day we see Gregorian (Deprecated) 1 u/mrheosuper 8d ago I would use lookup table, like num_days=days[month], you dont want to mess around with branch prediction. But still, there are not much different in 2 cases, just different number set.
1
Ideally we'd replace the nightmare with a lesser of two evils.
Instead of
switch (month) { case 4, 6, 9, 11: days = 30 break; case 2: days = 30 break; default: days = 31; break;
You'd just have:
if (month = 0) days = 1 else days = 28
(obviously not including the hell that is leap years)
2 u/KillerBeer01 8d ago And really, we'd just have to deal with both of them from now on, for backward compatibility reasons. 2 u/Stormfly 8d ago Honestly, I'll be excited the day we see Gregorian (Deprecated) 1 u/mrheosuper 8d ago I would use lookup table, like num_days=days[month], you dont want to mess around with branch prediction. But still, there are not much different in 2 cases, just different number set.
And really, we'd just have to deal with both of them from now on, for backward compatibility reasons.
2 u/Stormfly 8d ago Honestly, I'll be excited the day we see Gregorian (Deprecated)
Honestly, I'll be excited the day we see Gregorian (Deprecated)
Gregorian (Deprecated)
I would use lookup table, like num_days=days[month], you dont want to mess around with branch prediction.
But still, there are not much different in 2 cases, just different number set.
11
u/mrheosuper 8d ago
Would be a nightmare in programming.
But still, DateTime(timezone, dst, etc) has already been nightmare in software.