by rtpg · 2y ago · 0 comments
Your vendor says thing does not happen on holidays or weekends. There might be some other special day where things also do not happen. Keyword is “training day for staff”. Also end of year holidays. They will send you an email about it. Maybe 3. You read the email (important!), and put it in the vendor-specific list of holidays in your code (also important!)
And of course because you like your sanity you use whatever iCal date relativity respecting library to do logic like “the next Wednesday from today” or whatever.
Some things take 1 step. Some take 5. Being able to do something that takes 5 steps without writing a 3000 word screed about the world being broken is the sign of a successful person. Document it, do it, maybe improve it a bit, move on with life.
The point is you don't write the is_holiday function, you might write "is_jp_govt_holiday" or "is_mufj_bank_holiday" (though really it might be more "is_mufj_bank_transfer_csv_acceptance_day" or whatever), that might look at "is_jp_govt_holiday". You write functions to their contexts, in a specific way. This lets you write "hacks" that aren't hacks when you get the specific email. A bunch of tiny, specific functions calling other tiny, specific functions.
5-word functions might look gnarly but they will be specific, and you got the magic of autocomplete to save you some typing.
It feels to me like the article sets up the confusion it must resolve by starting from national holidays... I don't think any of my employers have had a holiday schedule that matched another. There's a lot of variation on what holidays companies do and do not recognize, often with compromises around giving longer runs off around Christmas. If you really need to know when another company is doing business I wouldn't have ever thought there was a solution other than "collect a list of holidays each of your business partners observes."
Hell, a lot of US states don't match the federal holidays.
If anything the banking industry is unusually consistent for practical reasons. But even then, I worked for a major US bank and discovered that our holidays didn't quite match another major US bank we did business with!