Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I like that you did it and can look back with a more elegant solution.

What was the thought process originally? Were you just too focused on the problem?

I find that if I'm too close to the problem and too focused for [arbitrary timeframe], this is the type of thing that happens. The joy of fixing something before it's broken takes over.



I wrote this code in the early 2000s, so I don't remember the exact thought process. But I think my thinking was something along the lines of "this is a thing that exists, therefore I should model it 100% accurately". But I think the right way to think about it is "this is a thing that exists but most developers would be better off never thinking about, therefore I should omit it entirely".

Of course, the _real_ correct solution is to split up a date/time library into a number of closely related classes/structs, and allow users to pick the one that meets their needs. So most folks would pick the leap second-free class, but a few would use the one with leap seconds baked in.




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

Search: