4 ms·
To unorientalize the Japan thing here: there’s a national list of holidays. It is updated once a year. You put it in your code base. In the code base there’s a
by rtpg 3y ago
To unorientalize the Japan thing here: there’s a national list of holidays. It is updated once a year. You put it in your code base. In the code base there’s a comment pointing to the page (hopefully one on a .go.jp page)
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.
- npunt 3y ago"The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man." ― George Bernard Shaw, Man and Superman
- deleted 3y ago[deleted]
- Retric 3y agoThat’s a wonderful example of often repeated nonsense.
- fiddlerwoaroof 3y agoThis doesn’t actually solve the problem because the problem is that the list of holidays depends not only on the country but also on the particular company you’re interacting with. So, is_holiday is something like a function of the parties involved in a particular contract.
- rtpg 3y agoThere is no general problem. There is the act of doing business between parties. You do this across N relationships. You have N vendor contacts. You document them. You deal with them. This is what working with someone is like! Of course after doing the same thing 3 or 4 times you might understand some patterns, but even if you don't totally factor it out you'll at least have a general pattern. 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.
- jcrawfordor 3y agoNot at all unique to Japan either, I was confused by the Japan-centric focus of the discussion. I've worked for two different US corporations that observed a company-specific holiday, either founding day or IPO day. 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!
- deleted 3y ago[deleted]
- zrail 3y agoThe Japan focus is likely because patio11 lived in Japan for several decades, was a salaryman for many years, and is exceedingly familiar with their business and banking practices.