Saturday 16 July 2011

What has all this got to do with SCUBA diving?

In a previous life, I took up SCUBA diving at the behest of a friend who was an instructor, looking for new pupils to induct into his world. As time passed by, I became more confident, became an instructor myself, but then started to get a little bit bored with fish watching.

Now SCUBA diving, treated with respect, is not at all dangerous. Technical diving, however, using mixed gases to go deeper and stay longer, requires (a bit) more respect, and at least high-school physics to appreciate the potentially deleterious effects on the human body.

As a computer programmer by training and profession, I decided to write my own decompression  software, in order to understand a little more about what was actually happening in the diving computer I wore on my wrist. This handy little device told me how long I had been underwater, what my maximum depth was, and bleeped at me angrily in those times where I didn't obey its guidance as to how fast my ascent from depth should have been.

I was shocked and amazed by 2 discoveries. Firstly, the dive computer was a bit of a woos! I could use a considerably more aggressive dive profile and still not die! With the expense of the helium in the gas that I was breathing, this was good news. This was no doubt due to our litigous society. No company wants to get sued because their computer should only be used by a 24 year old marine commando who had the use of a nearby decompression chamber!

The second discovery was that there were so many programmer decisions to be made when constructing the software. As the various body tissues release the nasty bends-inducing nitrogen gas, the software instructs the user to move to a higher level in the water and stay there for a certain length of time. 3 meter depth levels are selected for ease of use, and times usually rounded up to the next 5 minute boundary. Safety and useability are entirely entrusted to the programmer, even within the user's desired operating parameters (I would not like to leave the dive site in an ambulance).

In writing forex software for clients (an even longer, deeper voyage of discovery) it never ceases to amaze me when mission critical systems are designed with no forethought to operational safety. For every new area, indicator type, execution strategy, I look for clues in the software that other folks have written. I am eternally grateful to all who have published their works. No matter how simple, no matter how uninformed. These provide the mechanism by which thoughts are provoked about safety. What happens if the context thread is busy and the trade never gets executed? what does the system do next? What happens if there are big gaps in the historic data, this data being used to determine the volume of the next trade?

I once owned a diving computer that flashed the display twice when the (internally sealed) battery was about to die. Unfortunately, this was nowhere in the manual. Without a backup system, and the experience to cope with the situation, the dive on which I experienced this feature could have been disastrous. Rather like losing your connection when you need to close a trade, and have the price move against you rapidly ....