Oh, what the hell, it's Friday night somewhere.
Let's have a drink.
Oh, what the hell, it's Friday night somewhere.
Let's have a drink.
Which actually reminds me of one of my favorite only-for-software-geeks one-liners:
"Days Since Last Timezone Error: -1"
In 45 years as a programmer, I have, of course, made a genuinely impressive number of stupid choices.
None quite so stupid as trying to handle time and date and days with hand-rolled code of my own.
And tho I'm an excellent programmer, most of whose mistakes have been good learning moments, I have not only tried to handle date and time code myself, but I have tried it multiple times.
"Fool me once, shame on you. Fool me 17 consecutive times over multiple decades, shame on me."
I remember using what was then called joda time (in Java), and what is now the core of java's time system, how amazed I was that it "just worked".
I got the source out, so I could learn the secret.
Here's the secret: there are so many fucking secrets to managing time and date and timezone and intervals you simply would not believe that *anyone* who wasn't an expert could code it.
It's a corner-case *hell*.
@bkoehn @GeePawHill tzdata (the defacto standard timezone library) distributes some html files basically listing off all the edgecases bundled with the source code
Also this for some reason https://data.iana.org/time-zones/tz-art.html
Years ago, as part of applying for a job, I was given a take-home coding exam that asked me to write some date-manipulation code without using any built-in date libraries.
I used a third-party library instead, along with comments about not reinventing the wheel, especially not for something as complex as manipulating dates.
I got the job.
@Daveography @GeePawHill My interview tip: Not knowing the answer and confessing immediately shows humility. Telling people how you would find the answer shows resourcefulness and a willingness to learn, and that’s just as good, if not better.
I once got hired to solve a customer’s software problem by telling them I had the developer’s cell phone number. :). It turns out I didn’t need it, but it gave the customer the confidence to let me try to fix it.