Skip to main content

Time to think about Time seriously!

Attention programmers!

Good logic lasts forever.

Many of you were not in the programming business in the 1980s.  Back then, we realized that Y2K was on its way and there was a lot of code that would break with dates beyond 1999-Dec-31.

At the time we were looking to save storage - heck, I supported systems that stored the year in 4 bits, because  it was a huge memory saver, and 16 years of operation was a long time.  We simply expected that our systems would be retired before then.

But come the 1990's, we realized we were still running programs written in the 1960s, and someone would have to address all of the date calculation problems.

Turn the clock ahead to today and we see that in less than 25 years the classic 32-bit Unix clock will turn over.    And the storage problem no longer exists like it once did.  In the past we often tried to squeeze in a full Gregorian date (Y-M-D) into 15 or fewer bits.    Today, using 24 or 32 more bits to store a Gregorian date seem completely reasonable and will greatly outlast our era.

Best practice demands that our code of today will work perfectly with dates into and beyond 2038.  As programming matures as a business, we should be validating clocks and times and dates well into the future, at least beyond 2101.

Are you signing a contract for software services?  Demand proper testing for this problem today.  Code easily lasts for more than 25 years, and so not demanding proper date handling behavior is irresponsible and a dereliction of your professional obligations.  Period.

Our software will be running in 80+ years into the future?

Why not?  Buildings and bridges are designed and maintained to last for centuries... we hope.  Logic lasts forever; why dispose of otherwise good work?

Popular posts from this blog

Fixing a SodaStream Jet, part 1: Disassembly Guide

I've had my SodaStream Jet for years, and once in a while something has gone wrong. Disassembly is the first step to repair.  Start with this article to see how to disassemble the SodaStream, and then once you have that down, scroll through my other articles to see how I repaired specfic SodaStream problems. SodaStream Jet Disassembly Guide Tools Required Flat head screwdriver Phillips head screwdriver 1. Remove the Carbonator.  Duh. 2. Remove the black panel lever The front big black tilt lever needs to be removed first. Removing this panel is tricky, but it isn't impossible. Looking up at the bottom of the black panel, there are two tabs, one on the left and one on the right. These tabs fully secure the panel in place. The trick is to use a flat-head screwdriver under the plastic to gently lever the tabs out of the way.  Note in the pictures how I approach these tabs with my screwdriver.  I usually release the left side first, and then I release ...

Fixing a SodaStream Jet, Repair #2 - Broken Fill Button

My Soda Stream Jet's fill button broke, which means I can not longer carbonate water by pressing the pushbutton. This caused all sorts of grief in my household. Here is how I managed to repair my Jet to give it another 10 years of life (hopefully). First, a look at the button The fill button on the top of the SodaStream is actually a simple lever. Pressing down on the button moves a pin that does the actual work of pressing open the Carbonator's valve. Unfortunately, the axis point is fairly thin and can see a lot of stress. That's where my Soda Stream button cracked. [ I think the usage tip here is "don't over-press the button like a gorilla, it doesn't do anything but put high stress on the button."] Cracked levering point of the button The Pesky Lever Retaining Pin The Fix It was pretty easy for me to replace the button: Take off the back of the Soda Stream and remove the carbonator. Push out the the button lever's steel retaining pin. This takes qu...

Transitioning to Comcast Now!

I've transitioned to Comcast NOW, a lower speed, lower cost alternative.  The kids have grown up and moved out.  I'm spending much more of my time traveling.  I don't need the high speeds at home like I used to. This transition promises to save me $240 dollars a year versus my old "discounted" plan. Xfinity to Comcast Now transitioning process I went to the Xfinity store and told them I was cancelling two weeks out.  This isn't weird - people move all the time, so they do have a process for cancelling at a future ("move-out") date. Later the same day, I was able to go to the Comcast website and order the NOW modem for the new service. Note that Comcast didn't let me do this until I had a future cancel order in place.  Three days later, the modem arrived via FedEx. The cancel date came and went - Xfinity seems to have a grace period, so the old modem wasn't unceremoniously yanked out of service at midnight.  This made the transition smooth.  ...

Installing a CarPlay radio in a Honda CRV

I ended up buying a 2013 Honda CRV and decided to replace the stock radio/CD player with an upgraded unit.  This was far easier and cheaper than I imagined, but the hardest part was selecting a unit to buy  This article covers how I made my choice.   The basic form factor for my CRV head unit Selecting a Unit The Car I have a 2013 CR/V, which is the same series of all of the CR/Vs from model year 2012 through 2016. Therefore it was important to find a radio unit that fits this model. The CRV has steering wheel radio controls, and I wanted to use them.  This uses a technology called CAN-Bus, which is kind of like USB for cars.  Therefore, a CAN-Bus capability would be able to leverage all these steering wheel features.  In addition, the CRV has a backup camera that would be nice to tie into. And of course I wanted to leverage the existing speakers and USB port. Form Factor I wanted a unit that had a big display, and I wanted a unit that was easy to purchas...

Old Apple gear that keeps on ticking

I've been dealing with Apple computer gear for a long time, as have my friends and family. Here is a list of the old gear that me and/or my friends have in active service.   Note that this gear is in real service, and isn't treated as museum pieces or as part of a retro-computing hobby. 2008: Apple Airport Express, draft-N, first generation 2009: Apple MacBook, late 2009 (utility use only) 2010: Apple iPod nano, 6th generation 2013: Apple Airport Extreme AC 2015: Apple TV HD (4th generation) The big winner here is the Airport Express, which is modern enough to do its job, and it just keeps on going.  The device that my friend runs has been in operation for more than 125000 hours.  It received its most recent firmware update on 28 August 2018, 10+ years after its initial release. In terms of security: it has no open, unpatched CVE vulnerability reports.  Many generations of other routers have come and go while this one keeps going.

Robust Installation of an HDHomeRun Networked TV Tuner. 64 OTA channels!

I added an HDHomerun (HDHR) over-the-air (OTA) streaming box to my home network, bringing over-the-air broadcast TV to my computers, phones and tablets.  The HDHR is a big upgrade from my previous setup: using a simple "window mount" antenna directly connected to my TV. A TV-attached antenna is good for watching some TV for free, but the HDHR offers so much more flexibility. Figure 0: HDHomeRun on my basement wall   My original OTA TV setup was haphazard at best. It was finicky, ugly, and hard for other people at home to use. I would actually tape my antenna to a window whenever I wanted to watch OTA TV. Plus, it only worked on my TV and not with my other devices. I wanted a cleaner and more modern OTA setup. After looking at possibilities, I developed two goals: (1) bring my OTA TV into the modern Internet-connected era, and (2) set it up in a reliable and pretty way so that other family members wouldn't have to fool around with the antenna or anything else.  With that,...

Other Posts

Show more