• Hanzito (unregistered)

    Would this work on all enums? Let's try an example:

    Frist = 1 Second = 2 Third = 3

    Looks good to me. New best practice!

  • JPJ (unregistered)

    Ever wondered what it would be like to literally live in the 1400's?

    Move to Iran and find out!

  • (nodebb)

    Having an extra month of Adar 2 seven times out of every 19 years says, "Hold my beer".

  • COBOL Dilettante (unregistered)
    this enum clearly was meant to be sorted in alphabetical order

    Bloody hell, I spent far too long trying to work out if it was some elaborate prioritisation scheme before getting to this part ...

    (April = new UK tax year, August = summer sales peak, December = Christmas sales peak ...)

  • (nodebb)

    Will offers the hypothesis that some clever developer was trying to optimize compile times

    Will's hypothesis is wrong. The correct formulation is:

    some "clever" developer was trying to optimize compile times

  • (nodebb)

    Channeling one of the gods of our computing pantheon, Charles Babbage:

    I am not able to rightly apprehend the kind of confusion of ideas that could provoke such an enum

    Addendum 2026-02-17 08:18: One can only hope the author of that enum was soon promoted out of coding and into management Where such confusion of ideas rightly dwells.

  • (nodebb)

    The date version of [true, false, FILE_NOT_FOUND]. 🤣

  • (nodebb) in reply to WTFGuy

    Sadly, the only real solution is promoting the (...), um, to, um ... Ah, Hell, just stick him in front of the GAU-8 and turn it on.

    You do keep a GAU-8 in your back pocket for occasions like this, right?

  • (nodebb) in reply to COBOL Dilettante

    Bloody hell, I spent far too long trying to work out if it was some elaborate prioritisation scheme before getting to this part ...

    (April = new UK tax year, August = summer sales peak, December = Christmas sales peak ...)

    You forgot the other American peak, somewhere in the second half of February if memory serves (it usually does not), which is not for Valentine's Day, but Washington's birthday or something like that.

  • (nodebb) in reply to Hanzito

    Frist = 1 Second = 2 Third = 3

    Frist = 1 Secnod = 2 Thrid = 3

    FIFY

  • (nodebb)

    If not for the sorting error, i'd have assumed this enum was auto-generated, such as from a web reference.

  • (nodebb)

    Big thanks to Remy for not spoiling my day by misusing "begs the question"!

  • (nodebb)

    If you're doing a roll-your-own-date validation, you have to remember that September 3rd through 13th 1752 are not valid dates in Britain (let alone what happened in 1582). I mention this having worked on a system that needed to store pre-1753 dates in old versions of SQL Server.

  • (nodebb)

    "which is not for Valentine's Day, but Washington's birthday or something like that." Also known as "The Day Mattresses Go On Sale."

  • Hasseman (unregistered)

    A smart Enum.

    Almost no country changed to the Gregorian calendar on the same "date". Number of days shifted depends on the date of the change. All countries are taken into account in the area this application is run. Do not make code for things you do not need ...

    Flanderen 1582. US 1867 and Saudi Arabia 2016

  • Brian (unregistered) in reply to Steve_The_Cynic

    Well, we used to have holidays for Washington's birthday and Lincoln's birthday, but we're not allowed to celebrate dead white guys anymore so it all got rolled into a generic Presidents' day. (Which was yesterday, actually)

    And yes, every February those poor guys are dragged out of the grave by every cheesy furniture store and used-car dealer to push whatever crap they're selling.

  • Officer Johnny Holzkopf (unregistered)

    "As every year, this month's Tuesday will be on a Friday."

  • Michael R (unregistered)

    It reminds me of when I was working for a big financial shop and there was a table in the database with a column day_of_week which contained values 1-31 . I asked my colleague what is going on and he said:"Yes, we made a mistake there."

  • Alan Scrivener (unregistered)

    Put this in a textbook as a short example of technical debt.

  • Duke of New York (unregistered) in reply to Brian

    That's some dubious history, but OTOH there's nothing about being white that particularly entitles someone to celebration in death.

    As for the article, I want to believe that the enum is a key to a string table and therefore makes perfect sense. Right? Right?

  • enkorvaks (unregistered)

    Easy Reader Version: October's gone from being named the 8th month and being the 10th to being the 13th, which boy- can you imagine if Halloween fell on a Friday the 13th one year? The movie crossover alone!

    "It was the thirteenth hour of the thirteenth day of the thirteenth month..."

    "Lousy Smarch weather."

  • (nodebb)

    I don't want to see how this is used. If you have some date object, and can ask if someDate.Month == Calendar.October, there can only be unspeakable horrors lying underneath the surface.

  • (nodebb) in reply to Steve_The_Cynic

    There's also Chequeuary, the 13th month of each year that comes between December of the preceding year and January of the current year in which cheques are dated to the previous year.

  • (nodebb)

    Number of days shifted depends on the date of the change. All countries are taken into account in the area this application is run.

    It’s even worse than that: you certainly shouldn’t be looking at the modern-day countries when working with dates where the Julian–Gregorian change is involved, not even the countries that existed at the time this happened, but in many cases the regions or other areas within those countries. See https://en.wikipedia.org/wiki/List_of_adoption_dates_of_the_Gregorian_calendar_by_country … Near the top already, it has six entries for what is now Austria, with five different dates all in 1583.

  • (nodebb) in reply to Gurth

    For dates that old, the only choice seems to be handling them as strings and preventing all comparison operators.

  • pull request (fixes incorrect ordering) (unregistered)
    -    Sunday = 15,
    -    September = 16,
    +    Sunday = 16,
    +    September = 15,
    
  • 516052 (unregistered) in reply to sibtrag

    That might be easy but it is also unusable. What you really need is a database of these strings, one per day, that also contains a column representing them in some sort of absolute time. Kind of like UTC but for dates. I am thinking maybe use the Mayan calendar for that. Or just a day stamp since year 0 or something. And you do all your comparison by that field.

    Manual entry only, of course.

  • valued internet subscriber (unregistered) in reply to Brian

    We still do have a hoiliday for Washington's Birthday. That's legally what it's still called.

    https://www.opm.gov/policy-data-oversight/pay-leave/federal-holidays/#url=2026

  • erffrfez (unregistered)

    but there are at least 4 important calendar events missing from that list! Today Tomorrow Yesterday and Payday

  • Drak (unregistered) in reply to Duke of New York

    That was my first thought. Some sort of index for a list of language strings. Would make some sense.

Leave a comment on “Waiting for October”

Log In or post as a guest

Replying to comment #:

« Return to Article