IEEE 754-2008 Subnormal

Minor rant. IEEE 754-2008 redefined a term. In hand wavey terms, very small floating point numbers which could not be completely represented in the format used to be called “Denormal”. With the 2008 update, these were redefined as “Subnormal”.

When I was at school as a child, Autism and Aspereger Syndrome were not well known. I was classed as “Educationally Subnormal” (also “Mentally Deficiant”) – which was the code in those days for “way below average intelligence”.

Every time I see “Subnormal” with respect to floating point numbers, I wince. Especially when they get flushed to zero.

We Care A Lot

In 1985, Faith no More released their album “We Care a Lot”, with a track of the same name. I discovered that track about 1987. It details a lot of things about which they care a lot about (look up the lyrics), and some of it is cynicism but the refrain is:

Oh it’s a dirty job, but someone’s got to do it.

My mother was a doctor, my father a safety-critical engineer, and so I grew up with a very strong life ethic. It is not exactly surprising that when I came out of university, I ended up a safety-critical engineer myself. Mostly aerospace, but some rail and automotive.

I worked on many planes, one train system, and a couple of automotive systems. However, the Boeing 787 broke me. I worked on that plane for several years, and the amount I cared took my pleasure, my sanity, and nearly my life. I want to say how much, but I can’t.

I am no longer completely immersed in the safety-critical industry, but despite some of my best efforts, I am still heavily involved. The problem is, that now I have worked for nearly 20 years in those kind of systems, I have to.

We care a lot.

Once you have given your soul to the safety-critical industry, you can never go back. It is a mindset. That niggle that if something goes wrong, people die. Potentially hundreds or thousands (millions?) of people. Code I wrote, over 20 years ago, people still depend upon. I may have made a mistake in some testing, that means some freak accident causes a plane crash tomorrow. There are checks and balances, but I still have that weight on my shoulders.

You can take the engineer out of the safety-critical, but you cannot take the safety-critical out of the engineer.

This is nearly my mantra these days. I no longer work in a safety-critical job, but I am still (how could I not be) involved in our company’s safety effort. I still cast an eye over things that go past me, and go “Is this OK?” … “Is this safe??

Oh it’s a dirty job, but someone’s got to do it.

I did that job. Many of us do. I still do it, to a lesser extent. We care a lot. A lot.

Python Gotchas

Last year, I got involved in trying to teach programming to school kids – this was via the excellent enterprise. During this, I collated a series of Python “gotchas”, which I still think is worth sharing. As a friend of mine put it:

“The problem is that python is good, except where it does stupid things. Python programmers mostly trip over the stupid things fairly quickly, right themselves, and work around them forever, and forget that they are stupid.” – Aquarion

So, here is my list. If you think you have a good new one, please add in the comments.

  1. Tuples are immutable.
  2. Case Matters.
  3. Integer division trucates. (__import__ future, float cast)
  4. Classes have to inherit object to be derivable from.
  5. Type of bracket plethora-rama.
  6. Unicode.
  7. List string concatenation with .join().
  8. Shallow copies of dicts (.deepcopy())
  9. Default arguments in Python (dragons).
  10. Tabs vs Spaces.
  11. == vs is.
  12. Dictionaries are unordered.
  13. Scope, particularly scope in loops.