Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps. Jon is a DZone MVB and is not an employee of DZone and has posted 23 posts at DZone. You can read more from them at their website. View Full User Profile

Possibly The Best Way To Be A Great Programmer: Be Brain-Healthy!!

10.28.2008
| 16079 views |
  • submit to reddit

I was watching a television show on PBS (viewer-sponsored educational public broadcasting) about brain health. The speaker was Daniel G. Amen, author of the book Change Your Brain, Change Your Life. This sort of show always grabs my attention, for one obvious reason:

I am a programmer, therefore my brain is my most important tool to invest in.


A programmer's job is among a few other jobs in this world that relate directly and primarily to brainpower; others are:
  • electronics engineers
  • lawyers
  • doctors
  • writers / authors

(Unfortunately, my brain stopped thinking of others by the time I wrote "writers".) This is not to say that other occupations don't use their brain; it's just that programmers primarily have to think, because to program is to teach computers to think.

Some moron in DZone posted the comment, "Your brain doesn't write programs. YOU write programs." News flash for idiots: Your brain is your "you" hardware, and just as a software program executes no faster and no more stable than the computer it runs on, you as a programmer are only as naturally smart and productive as your brain is healthy

There have been times, more now at my age of 31 than in my younger teenage and early 20s years, that I've begun to get frustrated and even scared of my brain's health. Names and numbers sometimes become forgotten. I'm sometimes unable to concentrate on anything. At home I rarely read all the way through any of the many books I own because I typically get halfway through a page and then, without thinking, grab my remote control and turn on the TV, or jump up to find something to eat or drink, or hit the Stumble! button on the StumbleUpon toolbar on my web browser. Sometimes I just have a hard time keeping my eyes open. Sometimes I feel depressed, I think a lot of negative thoughts, or I just feel knee-jerky.

Other days I'm doing great. I'm focused. I'm being productive. I get stuff done. I feel good. I have a smile on my face -- whether it's visible or not. Life just feels fulfilled.

I know the primary causes of what puts me off, I just need to pay better attention to them, and I suppose that's part of the reason why I'm writing this down now. Meanwhile, this PBS show put emphasis on these things and added specific details I need to be reminded of.

So I guess here are some of the most important things a programmer (or anyone I guess) can do to improve their brain's health. And believe me, I'm posting this for me more than for anyone else.

  • Sleep. No, seriously. Sleep. Go to bed on time, WoW / LOTRO / GW / et al should have no rights to your evening, in fact you shouldn't even let "being in the zone" in a software project deprive you of sleep. On that latter note, I've seen people whine in forums and mailing lists that "I've been up for the last 36 hours trying to fix a bug, I can't find it, what should I do?!" Yeesh, go to BED!! Staying up to solve a problem is only going to cause you to make things worse. 

    I have the best-selling book on programming Cocoa on the Mac, and it starts off saying that 1) you're probably not too stupid to get some things, some things are just hard, and 2) you should always get nine hours of sleep. A Cocoa book, telling me to get nine hours of sleep!
     
    • I sometimes struggle with sleep apnea. Sleep apnea is the problem a lot of Americans have of snoring or of being unable to breathe at night. Even if you're "asleep" in bed for eight or nine hours, sleep apnea is worse than getting very little sleep. It does two serious things: it deprives the brain of oxygen, which is much the same as blocked blood flow to the brain and also causes chronic headaches and sore spots on the head, and it causes the brain's level of consciousness to rise during sleep, so even if you're not aware that you're waking up, you are, because you keep SUFFOCATING on your own mouth/nose/throat. In essence, you're not really sleeping, or at least not deeply enough for it to count for much.
      In cases like mine, there's a cure for sleep apnea: lose weight!! Excess weight in the neck and face causes, well, weight to be applied to the windpipe, nasal passages, and mouth, collapsing the passageways. A couple years ago, my weight fluctuated, as did my sleep apnea, and I became close to useless at my job and was fearful of losing it (prematurely) because I wasn't alert, I couldn't think straight, I couldn't remember things or think things through (um, like the software I was writing), and I kept showing up late. Hopping on an "emergency diet" of 1,250 or so calories day and getting some exercise each day, I found normalcy in the quality of my days within about two or three weeks.
    • I tended throughout my younger adult years to be a night owl. I was 100% persuaded that "it's just the way I am" that, when I'm motivated to stay up late doing whatever it is I'm doing (writing software, playing a game, browsing the web, blogging, whatever), there's no stopping me, I'm like a freight train, I have too much momentum and no real sense of "I'm tired, it's time for bed" until about 4:00am. Many weekends I turn my days and nights upside down, and then I hate Mondays because I have to force it right-side up again. I'm also single, so it's not like I have family to remind me that it's time for bed (which is unfortunate, sometimes I literally just forget to pay attention to the time). But there are a few things I can do to compensate for this:
        
      • Have a social life with non-distracting friends and family. By non-distracting I mean not distracting people like those of the opposite gender (having a girlfriend will not help you sleep, especially if you're a geek like me, it will just make you confused, hopeful, frustrated, whatever -- not that I'm encouraging anyone to not have a girlfriend, I'm just saying that that doesn't fall into the context of "non-distracting") as well as frustrating relationships with people who make you have grudges or regretful memories or overly enjoyable or hopeful thoughts. Children are great for this.

        Why? Social life produces a certain degree of healthy mental stresses and after so much of these stress exercises in the day the brain may beg for rest. Plus, as long as you aren't stuck on obsessive thoughts or having high contemplation of tomorrow, there are usually very good side-effects between not just sleeping well and on time but generally feeling better about yourself.
      • Melatonin supplements should be considered experimental. Melatonin is the hormone that tells your body, "It's time to sleep." It's not quite the same as taking something like NyQuil, as it doesn't have the dizzying and/or drowsy effects of typical sleep medicines. It just makes your body feel like it's sleep time, naturally. It could be that my body doesn't produce enough of the stuff. I'd been pursuaded to try taking melatonin supplements before going to bed. Even just taking one 5mg tablet, though, a few hours before bed time, I find myself sleeping in quite late or else feeling like I should go back to bed if I can't sleep in. Limiting my intake to 2 or 3 mg might suffice -- or else not using it at all and finding other ways to improve my sense of sleep time. DO NOT OVERDOSE.  
      • Exercise. My weakest spot, there's no excuse for me except self-discipline. But I acknowledge that the body's demand for rest is driven in large part by the physical and mental stresses of the day, and imbalanced lack of demand from the body to rest at night, and physical desire to be lazy at day, is a clear sign of not enough exercise. It's correctable .. by exercising, of course.
  • Exercise. Yeah, I'm saying it again, because it doesn't just help you go to sleep in a balanced way, it is one of the most beneficial things for the brain. It increases blood flow to the brain. It increases serotonin, which is critical for proper brain health and combatting depression and A.D.D.
     
    But if you're like me, you're afraid to go to the gym because you're embarrassed by your being out-of-shape and being surrounded by all the in-shape people at the gym, so ..
     
    • Go on long walks around the neighborhood. No one has to see or even care about you, you're just walking, right? And if you have a dog, your dog needs exercise, too. (No dog should not be taken on walks; not taking a dog on walks and not at least giving a dog room to run around is, in my view, a bit abusive.)
    • If you have an extra room, designate it as a workout room. Add a large fan and a radio. Add some exercise "tools" like dumbells, a weight bench, a Bowflex, a treadmill. I have such a room but it has a super-cheap elliptical machine and a really cheap weight bench I bought at Wal-Mart that feels like it will snap and break apart every time I attempt to use it, so I am fearful of safety hazards. I rarely use this room anymore, but I should do what I can to change this. I've invested hundreds of dollars on technical books, but without the brain health to read them efficiently I wasted my money, unless I try to make a better investment in my exercise facilities as well.
    • If you have friends, find a workout partner. Going to the gym can be fun if you have a buddy with you, who can spot you or coach you or give you some competitive spirit or otherwise "keep you on your toes", as well as distract you from the embarassment aspects that keep you from the gym.
  • Diet (food and water intake) matters. You are what you eat, quite literally. Your brain is 60% water, so drink lots of water.
     
  • Always be learning about new things.The brain creates new connections and links between cells when you are trying to learn new things. As soon as you stop learning, the brain actively starts to de-link and break apart these connections. Find things to learn about. It doesn't work if it's directly related to what you're already doing--a cook learning a new recipe doesn't gain brain health by doing so because he's already a cook. I for one am thinking about taking classes at the local Community College about things that are totally different from my core interests and skills, but, while I am still on my job search, I'm currently slobbering over a job that substantially demands continued self-education and training and actually cares about technical certifications in the field. Jobs that do that are huge for promoting brain health, and that, I feel, is extremely ideal for me as a human being as well as for my continued career path.
       
  • Avoid alcohol, drugs, and smoking. I'm not writing this stuff for myself; I don't drink, I don't smoke, and I don't do drugs. But this stuff hurts the brain significantly, so it's worth noting for the record. Smoking significantly limits blood flow throughout the ends of the body. Alcohol significantly slows down and kills brain cells. And everyone knows that drugs do to the brain what a frying pan does to eggs. I don't do any of the above, but what applies to me..
        
    • Caffeine is a drug. Too much caffeine (more than a couple cups of coffee per day) is unhealthy for the brain, because it decreases blood flow to the brain. (Not sure how, just quoting this guy on PBS.) It also causes you to stay up late at night, of course.
    • Detoxify your body. A reader of this blog post (Krishnan Thodla) commented, "Undigested food/pollutants/environmental toxins (you mentioned a little bit) make your mind sluggish. Getting rid of these definitely improves your brain health too." (Thanks Krishnan!) 
       
      • Work environments can produce drug-like brain symptoms by way of air pollution. The story of a furniture factory worker was described on the PBS show, where a husband suddenly became "a jerk" and upon scanning it was found that his brain was significantly deteriorating similarly to alcohol and drugs. His problem turned out to be the workplace, where he was inhaling fumes and air pollutants that were as bad to the brain as drugs are. The doctor got him to find a different position in the company that didn't expose him to that environemnt. 
      • I once had some symptoms that were not unlike my sleep apnea symptoms when I had my windshield replaced. The fumes from the seal filled my car and the car stunk of the adhesive stuff that held the new windshield in place. I strongly believe that the headaches and difficulty to think and the dizziness were direct results of that; it all went away after a couple days.
  • Avoid sports that can cause injuries to the brain. Football, boxing, these are bad sports for the brain. The brain is very soft, in a very hard and "edgy" skull. Too much banging of the head and knocking the head around can cause a lot of trauma to brain cells. On the flip side, table tennis is considered the best sport for the brain, because it is safe for the brain in the avoidance of trauma, it encourages light exercise, and it forces the brain to coordinate hand, eye, and foot interaction with the gameplay. (I don't have room in my home for a ping pong table, but now I'm thinking of getting a Wii.)
  • Wear a safety belt, and drive safely. Car accidents often result in brain trauma. Even if you get out of an accident and your senses and motor skills and personality are not affected, you may still never be able to write software as well as you could before ever again.
  • Dwell on optimistic and/or true thoughts. Negative thoughts cause chemicals and activities in the brain that decrease the use of brain functions that encourage control and productive function, and increase the emotional aspects of the brain. Uncontrolled, negative thought patterns can become cyclical disasters. But here's a quote from the Bible that applies for good reason: "Finally, brothers, whatever is true, whatever is honorable, whatever is fair, whatever is pure, whatever is acceptable, whatever is commendable, if there is anything of excellence and if there is anything praiseworthy--keep thinking about these things." (Phillipians 4:8) 
  • Listen to ambient or classical music. Speaking of personal experience, I've listened to every kind of music while working--I love it all!-- and the kind of music that makes me feel most like I'm actually being mentally productive is ambient music. Classical music and classic jazz works well, too.
     
    • Check this out: http://www.getimusic.com/  Be sure to follow all the Research links. It looks somewhat like a gimmick--I can hear some pretty strong "effects" and artifacts in the sample music, but I don't know that it's actually doing anything significant, it might be snake oil. But then, it might not be. And if not, wow, what an invention!!
    • Music or ambient sounds (like television) with verbal language -- sung or spoken, but particularly spoken -- makes a very difficult environment to focus on anything. You don't have to be listening to the words to be distracted; your ability to focus will be negatively affected even if not directly. Or at least, that's true for me. :)  That's why I opt for ambient, classical, and jazz music, but lots of people listen to techno or trance or other forms of electronica as well, with very positive results.
  • Try meditation. According to this guy on PBS, there was a study a while back where observers were expecting brain activity to decrease after a subject meditated, much like sleeping would do. Instead, the opposite happened; after meditation, the subject's brain was significantly more active and (s)he was more alert. I'm certain there's more to the story (in more fascinating detail) but I don't remember much more than that.
  • Try Yoga. I haven't tried it, so I'm going on hearsay. Those who do yoga mostly have wonderful things to say about the soundness of both body and mind. A commenter on this blog entry writes, "Pay particular emphasis on breathing exercises, and not just on the postures. The physical postures help relax your body, but the breathing exercises relax your mind."

Anyway, this is a good list. Back to work ...

References
Published at DZone with permission of Jon Davis, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Joe Farmer replied on Thu, 2008/10/30 - 1:39pm

Interesting. How about Stephen Hawking? Does not his example overturn the most of what you just said?

Greg Ewing replied on Fri, 2008/10/31 - 2:29am in response to: Joe Farmer

Thanks for making the time to post that. As someone who has hit their 50s, I only wish I knew back in my 30s what I know now. Sleep is critical.

[quote=tech0513]Interesting. How about Stephen Hawking? Does not his example overturn the most of what you just said?[/quote]Hawking has one of the world's finest brains. Other than a limited ability to exercise, what is the relevance of your question?

 

Joe Farmer replied on Fri, 2008/10/31 - 2:05pm in response to: Greg Ewing

Not only limited ability to exersize (which is already a lot) - he has a many other physical issues but still his ability to think is not impaired. I think reality is a bit more complex. For example, I can argue that if coding does not put you in a good mood you are not gonna be a good programmer.

A.j. Bonnema replied on Sat, 2008/11/01 - 1:45am

[quote]

Some moron in DZone posted the comment, "Your brain doesn't write programs. YOU write programs." News flash for idiots: Your brain is your "you" hardware, and just as a software program executes no faster and no more stable than the computer it runs on, you as a programmer are only as naturally smart and productive as your brain is healthy. [/quote]

While your comment that the brain is our hardware is true, it may only be one side of the equation. It is like driving a fast car: you determine the speed, not your car. Your car only sets the limit.

Computer hardware is a better analogy, because it is very easy to misuse or abuse hardware in a way that is not effective, just like your brain. Inefficient or illogical programming, memory leaks or even building on an ineffective software architecture.

The same goes for you and your brain. Your brain sets the end limit (hardware). But you determine your habits (software architecture) and it is your habits (programming or otherwise) that determine your effectiveness.

An example? Suppose your are reading important stuff for your job, but every time you hit a certain subject, or you feel just a little bit bored, your mind wanders and you start doing other things than you need to do to accomplish your goal. Effectiveness may still be there, but you are using your brain less efficiently. Another one? You hate working on software platform X and although your brain is perfectly capable of working this platform effectively and efficiently, you are not.

So, keeping your brain healthy is one side of the equation. Using it effectively and efficiently is the other side, and by far less easy to tune. 

P.S. the person that wrote a quote you disagree with may not be completely right, but calling him a moron because you disagree ............ At least he was partially right, just like you. Play the ball, not the man .....

Guus.

Joaquin Garrido replied on Tue, 2008/11/11 - 10:32pm in response to: Joe Farmer

Who's to say he wouldn't have an even more exceptional mind were he able to increase blood flow and endorphins to it by physical exercise (and/or intercourse)? Obviously, in his case, there is no way to test this as there is no control - we could not compare a before and after - but most of us are not this unfortunate.

Don't knock it before you try it.

Gonzalez Flores replied on Fri, 2008/11/21 - 8:41pm

Bravo!!!!!!!!!!!!

I agree with U, bravo!!!!

:D.

 

Excercise your brain, and your hearth ( I love my woman) ...

 

;D.

Brock Lesnar replied on Mon, 2010/11/15 - 8:31am

Eyes are the most sensitive part of our body and all  Eye disease are equally capable of harming the eyes, as they are very delicate

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.