• (cs) in reply to FragFrog
    FragFrog:
    GettinSadda:
    or a change to the requirements.
    You mean, like the next time we switch to a different calendar? ;)
    What happens if the code ends up being used to catalogue museum artefacts, and someone realised they need to handle dates before 99BC? Or for holding translations of letters written by Romans (which may be indexed by date)
  • (cs) in reply to Andrew
    Andrew:
    RandomGuy:
    The mistake is that in 1582 there was no October 5th to October 14th, but there were February 29th in 1500, 1400, ...
    Depends on where you lived. Many people were still using the Julian calendar for centuries afterward.
    Indeed, but those were heathens who are now burning in hell.
  • ssddfdfsdf hater (unregistered)

    What kind of a blooming nitwit is this ssddfdfsdf dude?

  • ssddfdfsdf hater (unregistered) in reply to Quietust
    Quietust:
    Now nobody expects you to read through a lengthy assembler listing
    Maybe, but some of us actually understand assembly language and would have preferred to see the actual code in addition to the high-level translation...

    My dream job would be to program in nothing but assembly language. Unfortunately, I've only had one job with significant amounts of assembly language programming.

  • Pastychomper (unregistered) in reply to nerd4sale
    nerd4sale:
    Quietust:
    Now nobody expects you to read through a lengthy assembler listing
    Maybe, but some of us actually understand assembly language and would have preferred to see the actual code in addition to the high-level translation...
    +1

    INC A

    For a moment I thought maybe here would be a CodeSOD I'd actually understand - but no, it's just another test of my woefully inadequate knowledge of Java.

  • SimulatedEnglishSpeaker (unregistered) in reply to no laughing matter

    1517 Programming Reformation - Richard Stallman publishes his 95 theses about the differences between cathedrals and basars and invents open source software.

    Basar: base class for quasars, pulsars, etc.

  • (cs) in reply to RandomGuy
    RandomGuy:
    The mistake is that in 1582 there was no October 5th to October 14th, but there were February 29th in 1500, 1400, ...

    But, of course, TRWTF is translating assembler to Java.

    There certainly was an October 5th in Britain in 1582, I remember it well.
  • amet (unregistered)

    I hope the translation from one language to another is a trend we'll see more of - perhaps if the WTF is originally written in C# the article will feature it translated into JavaScript. Can't see how that would cause any problem.

  • Larry Hiltshire (unregistered)

    Except for parameters that could be better-named I don't see anything wrong here. It's likely been well-tested and works for a wider range of dates than the majority of date libraries would accept. For those who are keen to bring up the maintainability argument, this is code that doesn't need any maintenance. If anything it's far better than all the date WTFs we've seen on this site.

    TRWTF is Java.

  • not an anon (unregistered) in reply to Larry Hiltshire
    Larry Hiltshire:
    Except for parameters that could be better-named I don't see anything wrong here. It's likely been well-tested and works for a wider range of dates than the majority of date libraries would accept. For those who are keen to bring up the maintainability argument, this is code that doesn't need any maintenance. If anything it's far better than all the date WTFs we've seen on this site.

    TRWTF is Java.

    Yeah. With a good set of unit tests, this code will last nigh-forever. Only fix I'd make is to set a floor (say, 1800 or 1900) on dates to avoid Gregorian adoption hangover weirdness complaints and trap ID-10-T errors from people in many multi-calendar locales. (AIUI, most of the non-Gregorian calendars in use don't use a year number nearly as large as Gregorian years are for a sane value of $epoch.)

    Also: TRWTF are RTC chips that only support leap years through 2099. (What do you mean that your hardware says it's Feb 29, 2100?)

  • Erin (unregistered) in reply to Steve The Cynic

    Well year 0 doesn't exist anyway, so there's probably a bigger issue there (years go from 1BC straight to 1AD in the Gregorian calendar.) Because date math wasn't screwy enough!

Leave a comment on “Ancient Daze”

Log In or post as a guest

Replying to comment #:

« Return to Article