Wednesday, 15 March, 2006

Viagra, Debugging, and the Wonder of the Internet

I've been reading the book, You: The Owner's Manual, about which I'll post more when I'm finished.  However, it struck me about halfway through the book how many ailments are related to poor blood circulation.  We often think of clogged arteries causing heart attacks and strokes, but don't often realize how many other things are related.  It's not just the arteries that get clogged.  For example, erectile dysfunction is most often caused by poor circulation, not stress or other psychological problems.  Reading that, I got to wondering how Viagra and similar drugs work.

You can find anything on the Internet, and a quick search for "how does viagra work" turned up the HowStuffWorks page, How Viagra Works.  It's actually an interesting story.  The biology of an erection is a somewhat complicated mechanism that involves stimulating the production of an enzyme that in turn produces a chemical (called cGMP) that induces the muscles around an artery to relax, letting blood flow.  Another enzyme called PDE deactivates the cGMP so things don't get out of control.  The most common cause of erectile dysfunction is that not enough cGMP is produced to maintain an erection.

There are 11 different types of PDE (the enzyme that blocks cGMP) and one, PDE-5 is used primarily to control the penile valve.  Once biologists discovered that, all they had to do was develop a drug that blocks PDE-5.  So Viagra doesn't increase blood flow, but rather blocks the enzyme that prevents the cGMP from increasing blood flow.

I've been concentrating on fixing bugs in our product lately, and found that the story of how Viagra was developed resembles debugging.  Very often, the symptom is painfully obvious, but it's difficult to find the cause of the problem.  My experience with debugging is that finding the cause of a problem is the hard part.  Once I understand what's causing the program to malfunction, designing and implementing a solution is almost automatic.  The same is true for the development of Viagra:  once they fully understood the mechanics and chemistry of how an erection works, it was almost trivial to develop a drug to interrupt the mechanism.  There are some side effects, and I can imagine that men who take the drug even though they don't need it might experience some discomfort from the unrestricted blood flow.

Isn't the Internet great?  10 years ago, you would have been hard pressed to find that much information without making a trip to a large library and having to leaf through uncounted issues of medical journals.  For all the bad things people can say about the Internet, it's absolutely the best information resource ever developed.