Template talk:LatestComicOnDate

Explain xkcd: It's 'cause you're dumb.
Revision as of 16:29, 11 August 2012 by IronyChef (talk | contribs) (Thotz on LatestComicOnDate)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

I'm playing around with a bit of date math to see if we can reduce the sheer size, server-load, and maintenance requirements of the current implementation of LATESTCOMIC. The premise is that Randall posts comics on a regular basis: Monday, Wednesday, and Friday of every week, and that is eminently predictable (as long as Randall keeps to that schedule... there have been exceptions in the past...)

LatestComicOnDate is predictive, but not definitive: it tells you what comic should be latest on a given date, but if nobody has posted it here yet, well, it doesn't know that.

My thoughts are:

  • Improve the year roll-over behavior (right now, this will work until late December 2012.) Quick thoughts are to change the hard-coded base at the start of the expression (the comic number of in the final ISO-8601 week of 2011) with either a #switch for successive years (ongoing maintenance, but only every few years) or some inter-year week math. Right now, I'm leaning toward the former, for simplicity.
  • LATESTCOMIC would then use this template to decide what the latest comic should be, and then make sure it exists. If not, try n-1, n-2, etc for a few (but not more than a couple ;-) of prior numbers... hopefully this site doesn't go all cobwebby on us that we're more than, say, a week behind...

-- IronyChef (talk) 16:29, 11 August 2012 (UTC)