2013-11-28

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?

LED Light Bulb - First experience

There are a certain set of bulbs in my building which need to be on 24x365, so I figured this would be a good place to try an LED bulb.  The bulb is in an open ceiling fixture and is never turned off.

I recently bought a Cree LED Light Bulb to try out in one of these fixtures.

The bulb cost me about $10, and gosh darn it - it looks and behaves a lot like a regular incandescent bulb.  It is bright enough for my use, and draws a mere 6 watts - that's a ton less than 40 watts, and even 33% less than the 9 watts of a similar CFL.

Doing the math the electricity costs me about $8 a year to keep it lit, versus $12 in power for a 9 watt CFL or $50 in power for a 40 watt incandescent.  So payback will be very fast.

So far I have about 10,000 hours on the bulb.  I'll report if and when this bulb fails, but according to the specs I should expect to get about 6 years out of this.  And that's great, because changing a bulb in this location is a royal pain.

Next time I'll consider installing one of those 3 watt bulbs.  And to imagine just 10 years ago these fixtures were loaded with 60 watt bulbs.  The cost savings is just incredible.

Now if anyone has a tip for replacing an old-school GX32 style CFL with an LED without a lot of labor, please let me know!



Share