- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Would this work on all enums? Let's try an example:
Frist = 1 Second = 2 Third = 3
Looks good to me. New best practice!
Admin
Ever wondered what it would be like to literally live in the 1400's?
Move to Iran and find out!
Admin
Having an extra month of Adar 2 seven times out of every 19 years says, "Hold my beer".
Admin
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 ...)
Admin
Will's hypothesis is wrong. The correct formulation is:
Admin
Channeling one of the gods of our computing pantheon, Charles Babbage:
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.
Admin
The date version of
[true, false, FILE_NOT_FOUND]. 🤣Admin
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?
Admin
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.
Admin
Frist = 1 Secnod = 2 Thrid = 3
FIFY
Admin
If not for the sorting error, i'd have assumed this enum was auto-generated, such as from a web reference.
Admin
Big thanks to Remy for not spoiling my day by misusing "begs the question"!
Admin
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.
Admin
"which is not for Valentine's Day, but Washington's birthday or something like that." Also known as "The Day Mattresses Go On Sale."
Admin
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
Admin
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.
Admin
"As every year, this month's Tuesday will be on a Friday."
Admin
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."
Admin
Put this in a textbook as a short example of technical debt.
Admin
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?
Admin
"It was the thirteenth hour of the thirteenth day of the thirteenth month..."
"Lousy Smarch weather."
Admin
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.
Admin
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.
Admin
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.
Admin
For dates that old, the only choice seems to be handling them as strings and preventing all comparison operators.
Admin
Admin
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.
Admin
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
Admin
but there are at least 4 important calendar events missing from that list! Today Tomorrow Yesterday and Payday
Admin
That was my first thought. Some sort of index for a list of language strings. Would make some sense.