A fresh start for Spring 2017

Over the last year, my thoughts have been increasingly limited to one of two subjects – my work, or my headache research.  Things have been getting more stressful at work, and my research has all but ground to a halt.  CJ made the comment a couple of weeks ago that I needed to pick up a hobby again, just so I would have SOMETHING else to think about.  The more I thought about it, the more I was convinced she was right.

These last few days, I’ve published a few blog posts I had planned, and am putting Project Nesso in cold storage until further notice.  In its place will be a project that CJ and I have been planning for a while – a math game that helps you learn and practice solving algebraic equations.  I’ll be building it on the Unity 3D framework, which means I’ll be playing with a very familiar programming language again – C#.  It also means I’ll be able to dust off my technical blog, and post some fresh content there.

And of course, starting a new project in spring just makes sense, doesn’t it?

Project Nesso, Chapter 3: Troubleshooting

“The loftier the building, the deeper must the foundation be laid.”   Thomas à Kempis (http://www.brainyquote.com)

Some of what my doctors prescribed in 2014 made a lot of sense.  You’re having pain in your head – let’s take an MRI and see what’s going on in there.

But the approach to medication seemed very rudimentary.  Let’s try drug A and see if it helps.  No?  Let’s take you off of A and try drug B.  No?  On to drug C.  Trying every possible drug that has been shown to help a headache one by one seemed terribly inefficient.  It began to dawn on me that there is a parallel practice in software development, specifically in the area of troubleshooting.  I began to wonder if the lessons I’ve learned there could apply to medicine.

Troubleshooting bugs in software typically involves a few different tools in a developer’s toolkit:

Tool in the Toolkit What does it look like in practice?
Gathering Facts Step through the problem with the client.  Determine if I can reproduce it.
Analysis Can I find a pattern in when the issue occurs, and what the rest of the system was doing when it occurs?
Research Look online for other people who have had this issue, and what they did to solve it.
Experimentation The client did X, Y, then Z to get the issue.  What if I changed the order, or skipped Y – do I get the same error?
Collaboration Talk through the issue, my tests, and my theories with another developer.

When all of those techniques fail, I’m reduced to what I’ve termed “code roulette” where I just try changing things almost at random, and see what the outcome is.  It’s like Experimentation, but without a theory to guide it, which makes it the least scientific and least efficient way to fix a bug.  Historically, this approach is far less likely to lead to a solution to (or even insight into) the problem.  As a result I only pull it out of my toolbox when I’ve exhausted all of my other options.

How does the approach to troubleshooting recurring headaches stack up against troubleshooting a software bug?

Tool in the Toolkit Software Development In Practice Headache Treatment In Practice
Gathering Facts Step through the problem with the client.  Determine if I can reproduce it. Do the headaches occur every day?  Do you notice the headaches getting stronger as the day goes on?  Does your family have any history of headaches?  Let’s get you in for an MRI to see what’s going on in your head.
Analysis Can I find a pattern in when the issue occurs, and what the rest of the system was doing when it occurs? Can you keep a headache journal, to track when you get headaches, and how bad they are?  Is there a pattern to when they become more severe?
Research Look online for other people who have had this issue, and what they did to solve it. Read the medical literature to see what the research has to say about them.
Experimentation The client did X, Y, then Z to get the issue.  What if I changed the order, or skipped Y – do I get the same error? If you get more sleep, is your headache the next day better, worse, or unchanged?  Would cutting processed meats out of your diet affect them?
Collaboration Talk through the issue, my tests, and my theories with another developer. Let me refer to you to a specialist.
Roulette Let me change each setting, one by one, until we find one that fixes the problem. Let me prescribe each drug for you, one by one, until we find one that is effective.

Not only is the roulette approach inefficient, the feedback look with medication is a couple of orders of magnitude longer.  With code roulette, the time between trying something and seeing the effect is usually measured in seconds or minutes; with “drug roulette” it’s measured in weeks.

This analogy had been brewing two years, but it really solidified in February 2017.  It drove me to ask what I believe is a foundational question: is this really the state of the art for prescribing drugs, or was this just one patient’s experience?

Project Nesso, Chapter 2: Gathering Data

“It is a capital mistake to theorize before one has data.”  Sir Arthur Conan Doyle (http://www.brainyquote.com)

During my office visits, my neurologist would ask me how bad my headache was, on a scale of 0-10.  Since I only saw him one every few weeks, I thought the answer to that question couldn’t possibly be giving him that much to go on.

What if I were to chart my headaches multiple times a day, every day?  Could I learn something about them?  Could I start asking some intelligent questions about them, like “do they tend to get worse in the early afternoons, right after lunch?” or “are they worse if I don’t get a good night’s sleep the night before?”

That led me down the road to all sorts of things that I thought could be contributing to them – how “stressed out” was I feeling, how much liquid had I consumed that day, had I eaten recently, and so on.

I built a custom wearable, wrote a survey app for my desktop and eventually my phone to collect this data.  While the wearable was short-lived, I collected more than a hundred thousand data points with the app over the course of a year, and tried to see if there was any correlation between the strength of my headaches and things going on around me.  There were some mild correlations, but I didn’t find anything like a smoking gun.

In April 2016, I decided to try to rule out any food-related triggers.  My family and I spent that month going through a program called “The Whole 30”.  The authors talk about various foods that cause inflammation – milk, grains, sugar, etc. – and how by abstaining from them for 30 days you can clean out and “reset” your system.  They don’t specifically talk about headaches, but I wanted to see if cutting those foods would result in any improvement.  It didn’t.  My headaches before, during and after the Whole-30 remained about the same.

In July 2016, I started what I thought was the next logical step – a massive research project.  I set out with the ambitious goal of reading every piece of headache research I could get my hands on.  I also started identifying the researchers doing the leading-edge work in this area.

That undertaking spun into what I believe will become a very interesting future software project.  However, after 8 months of pursuing that, it dawned on me that now I had two problems.*

I needed to get back to the real quest – my headaches.  I felt my best bet would be to go back to the experts – researchers and medical doctors – rather than try to become one myself, but something about my experience as a patient nagged me.

 

*Apologies to Jamie Zawinski

Project Nesso, Chapter 1: Backstory, Tests, Scans, and Drugs

“The basic quality that any great story must have is a story that illustrates the human condition.”  William Shatner (http://www.brainyquote.com)

Somewhere around 2003 it finally dawned on me that getting a headache every day wasn’t normal.  I asked my regular physician about it, and he suggested some common triggers to look for.  Over the next 10 years, most of those triggers would be removed from my environment one way or another – I stopped eating some specific foods, I changed jobs (and therefore my work environment), and so on.  The headaches only worsened.

Then during a 2013 vacation, I realized that my headaches had been progressively starting earlier and earlier in the day, until I found myself waking up with them.  For headaches, “chronic” is defined as having one 15 or more days per month.  I was now getting them every day, all day long.  I decided to get serious about finding out what was going on.

In September of that year, I started with my general physician again, who prescribed a few different drugs to try – Propranolol, Sumatriptan, and Topiramate.  Even after a couple of months, they didn’t seem to have any effect.

About the same time, I found out something new about my family history.  When I was a teen, my grandmother starting having seizures, and the doctors found that she was bleeding from the brain.  She was diagnosed with a stroke.  After her hospital stay, she returned home only to have another seizure.  The doctors looked again and found it was a tumor – not her brain, per se – that was bleeding.  Surgery, radiation, and chemotherapy were unfortunately not enough to knock it out completely, and she eventually died.  What I found out in January of 2014 was that in the years leading up to her first seizure, my grandmother suffered from daily headaches.  My grandmother – never one to complain and always serving everyone else before herself – never saw a doctor about the headaches.  She simply endured them.

I became very worried about my own headaches.

My doctor then referred me to a neurologist, who first referred me to an ophthalmologist for an eye exam.  When that didn’t turn up anything out of the ordinary, the neurologist ordered an MRI.   The MRI also turned up nothing – no tumors, growths, hemorrhaging, or signs of a stroke.  That was a huge weight off my chest.  We had just ruled out the “big” bad things.

The neurologist also took me off the initial drugs, and tried a couple of additional ones – Diclofenec and Amitriptylin.  Like before, those had no effect.  He then referred me to an ear-nose-and-throat, or ENT, doctor.  If my brain was fine, perhaps my sinuses or something else in my head was to blame.  My ENT ordered a CT scan and an X-ray.  Again – nothing.

My ENT ordered a series of sleep studies.  Perhaps I suffered from sleep apnea, or some other condition that was preventing me from getting a good night’s sleep.  Yet again – nothing.

By November of 2014, my ENT had decided that there wasn’t anything he could do for me.  At this point, having spent over a year being poked, prodded, scanned and drugged, I called a time-out.  I needed a new approach to this problem.

If I couldn’t find the cause of my headaches, could I identify things that made them better or worse?  Could I gain even a measure of control over them?  2015 would be the year that I would try to do just that.