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

This has so many happy side effects. Yesterday I was upgrading some code to use a newer version of an API. The old version stored timestamps as int seconds-since-epoch, but the new one stored them as ISO8601 strings. I replaced a line of code like:

  if row['timestamp'] < cutoff_time_as_int: ...
with:

  if row['isotimestamp'] < cutoff_time_as_string: ...
and everything kept working exactly as before. There was no expensive and error prone date parsing involved, some some simple string comparison. It wasn't quite as cheap as comparing ints, but it's not performance critical code so eh, good enough.


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

Search: