Hacker News new | past | comments | ask | show | jobs | submit login
Special cases broke Microsoft Zune and can ruin your code base too (mermaidchart.com)
4 points by knsv on Aug 23, 2023 | hide | past | favorite | 3 comments



I am not convinced that leap years can be called "special cases", after all they are a known occurrence and happen roughly every 4 years (and they were taken into account - wrongly - in the code in the example), if something similar had happened with the divisible by 100 but not by 400 rule, that happens three times every 400 years (and that seems not have been taken into account in the code) I would have found it more convincing.


Some thoughts on special cases, a love-hate relationship, I guess :)


Interesting




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: