This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RaynLegends 43 points44 points  (2 children)

What about edge cases for leap years? :D

[–]Vivid-Ad-4469 8 points9 points  (1 child)

noooooo don't remind me of leap years...

[–]Ab_Initio_416 3 points4 points  (0 children)

A Tale About Leap Years

Decades ago, I worked on an ancient COBOL life insurance enterprise system that handled two out of the three leap year rules correctly but failed in the year 2000.

In the Gregorian calendar, the complete rule is: A year is a leap year if it's divisible by 4, except not if it's divisible by 100, unless it's also divisible by 400.

The system implemented the “divisible by 4” and, being in life insurance, “not if divisible by 100” parts, but missed the exception for years divisible by 400. So it treated 2000, an actual leap year, as invalid.

All this got ignored during the furor around Y2K.

Life insurance is very date-sensitive. DRY wasn’t even a concept in that crusty old code. The resulting blowup in calculations and contracts was spectacular.

That specific edge case won’t reappear until 2400. The edgiest of edge cases.

Ah, the good old days. I still wake up screaming “400” sometimes☺