News for hackers. Stuff that matters.
Re:Show HN: Herodotus – An IRC bot that logs a channel's act... by perlgeek on Saturday February 20, 2016 @12:17PM (#11140922)
Don't use integer timestamps as object keys. What if there's more than one action in any given second?

I'd much prefer an array with objects as element, each object storing its own timestamp.

Re:Show HN: Herodotus – An IRC bot that logs a channel's act... by egladman on Saturday February 20, 2016 @12:23PM (#11140953)
I was hoping no two actions would occur on the same millisecond. Thanks for the feedback.
Re:Show HN: Herodotus – An IRC bot that logs a channel's act... by TheDong on Saturday February 20, 2016 @02:17PM (#11141451)
Just for you, I went through my logs for my current irc server and checked how often irc messages occured on the same millisecond. I found on the order of a few thousand such events out of millions of lines total.

In addition, that's just based on my perception; IRC is NOT an ordered protocol, so if multiple people ran this same logger, they'd end up with different stream and different duplicate keys (same thing as events lost I might add).

My log, also, conveniently contains joins, parts, notices, ctcps, and all that other jazz because I used a mature logging library.