Get grandpappy another glass of bourbon, and I'll tell yas a story about how messy software engineering is in the real world.

Thank you, that'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'd be no financial transactions processed.
Ha, ha! No problem, I thought. I'll just code a list of dates: December 25th, January 1st, and so on.

Nope, that's not gonna work. You see, there'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'll just figure out when Easter is.

Oh....no.....
no no no. I just wanna know when Easter is. I don'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.
If you'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
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'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
Now, in the finance world, you can buy datasets for anything, most definitely dates. But you couldn't buy just a bank holiday set, it always came with a bigger set I didn't need, and cost mind-blowing levels of money.
Now I know what you're thinking.

You're not going to hard-code it are you? That's not, like, seriously a thing you're gonna do right? Because you can't do that but so many years out. And you're gonna have to maintain that.

Hard-code it we did.
8 years out if memory serves.

If you'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't be our problem.
In my defense, we really did boil the ocean on this one and didn't have great alternative options. I'm not proud. But we got the job done, and we didn't waste a month maintaining an irrelevant open source library. Some affordance has to be made for the dirty wins
A favorite quote on programming comes from Larry Wall, the inventor of perl
we engineers wanna believe there's an elegant solution but sometimes it just isn't so. The world has an irreducible complexity to it. https://twitter.com/mdavidallen/status/1123241425775276033?s=20
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
You can follow @mdavidallen.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: