Get grandpappy another glass of bourbon, and I& #39;ll tell yas a story about how messy software engineering is in the real world.
Thank you, that& #39;s very nice.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🥃" title="Tumblerglas" aria-label="Emoji: Tumblerglas">
OK here we go.
Thank you, that& #39;s very nice.
OK here we go.
Once upon a time, I needed to write some software that knew when Swiss national holidays were. Those were the days, you see, when the banks would be closed, and when there& #39;d be no financial transactions processed.
Ha, ha! No problem, I thought. I& #39;ll just code a list of dates: December 25th, January 1st, and so on.
Nope, that& #39;s not gonna work. You see, there& #39;s Easter, and the holidays derived relative to Easter.
Nope, that& #39;s not gonna work. You see, there& #39;s Easter, and the holidays derived relative to Easter.
So many are defined in relative terms. 40 days after easter. 2 Sundays after Easter, etc.
No problem! I& #39;ll just figure out when Easter is.
Oh....no.....
No problem! I& #39;ll just figure out when Easter is.
Oh....no.....
no no no. I just wanna know when Easter is. I don& #39;t want to know about the decisions of the council of Nicaea in the year 325. Please no.
OK. This is a little bit simpler.
OK. This is a little bit simpler.
If you& #39;re following the yak shave to this point:
- To know when the bank is closed
- ...you have to know when the holiday is
- ...you have to know when easter is
- ...you have to understand the cycles of the moon
- To know when the bank is closed
- ...you have to know when the holiday is
- ...you have to know when easter is
- ...you have to understand the cycles of the moon
Intrepid and undeterred, I actually did go investigate astronomical libraries in JS and Python that could let me calculate when/where the moon was.
I found...breakages. And weird assumptions that didn& #39;t hold. And cross-platform compatibility issues.
I found...breakages. And weird assumptions that didn& #39;t hold. And cross-platform compatibility issues.
It is not my job to maintain a JS library that works with Sidereal time. Conclusion: Swiss bank holidays are not practically calculate-able.
Two remaining options:
- Buy a list from someone
- Hard code it
Two remaining options:
- Buy a list from someone
- Hard code it
Now, in the finance world, you can buy datasets for anything, most definitely dates. But you couldn& #39;t buy just a bank holiday set, it always came with a bigger set I didn& #39;t need, and cost mind-blowing levels of money.
Now I know what you& #39;re thinking.
You& #39;re not going to hard-code it are you? That& #39;s not, like, seriously a thing you& #39;re gonna do right? Because you can& #39;t do that but so many years out. And you& #39;re gonna have to maintain that.
Hard-code it we did.
You& #39;re not going to hard-code it are you? That& #39;s not, like, seriously a thing you& #39;re gonna do right? Because you can& #39;t do that but so many years out. And you& #39;re gonna have to maintain that.
Hard-code it we did.
8 years out if memory serves.
If you& #39;re stuck maintaining legacy hell right now my heart goes out to you, and I want to state for the record, YES, we knew by that time it wouldn& #39;t be our problem.
If you& #39;re stuck maintaining legacy hell right now my heart goes out to you, and I want to state for the record, YES, we knew by that time it wouldn& #39;t be our problem.
In my defense, we really did boil the ocean on this one and didn& #39;t have great alternative options. I& #39;m not proud. But we got the job done, and we didn& #39;t waste a month maintaining an irrelevant open source library. Some affordance has to be made for the dirty wins
we engineers wanna believe there& #39;s an elegant solution but sometimes it just isn& #39;t so. The world has an irreducible complexity to it. https://twitter.com/mdavidallen/status/1123241425775276033?s=20">https://twitter.com/mdavidall...
if, at some level, programs are proxy models of reality, and reality is a complete mess, well then good luck building an elegant proxy model