***Preamble:***

You, my friend, are a very brave man. In trying to teach your wife how to program, you are taking on two roles. One as a husband, which is an equal partner relationship. The other as a teacher, which is an unequal mentor-pupil relationship. 

Trying to take on both relationships at once complicates them greatly. For starters, your wife is not going to like feeling inferior to you when you are teaching her. This is normal in a mentor-pupil relationship, but not healthy at all in a marriage relationship. This is most likely a major underlying (subconscious) cause to her getting angry with you when things are not going well, especially when combined with her other insecurities that you describe.

I assume you realize that it is natural to have negative feelings (such as frustration) when your progress towards a goal is being blocked. In most cases (excluding things like PTSD and Clinical depression) it's not the negative feelings that are the problem, it's our behavior and how we choose to deal with those feelings.

As a developer who went back to community school at age 28 to learn to program, and as I'm sure you can attest to as well, getting stumped by a bug or some other problem I can't figure out is frustrating.  And I express my frustration, frequently out loud.  

The key to expressing that frustration without damaging your relationship is to **never direct your frustration at the other person.** This means that, when you are feeling frustrated, no complaining about the other person. In fact, when expressing frustration you probably shouldn't mention the other person at all. 
  
  
  
***Answer:*** 

You ask:

> what can I do to handle a situation where she apparently refuses to listen while I try to teach her and help her?

 1. **Try to avoid the escalating feelings.**  Pause before talking to take a deep breath. Let your muscles relax, this will help keep you calm. When you feel yourself starting to use a more "passionate" (loud, angry, frustrated) tone,  lower your void instead.

 2. **No accusations.**  It puts people on the defensive, and when people are defensive performance drops. This is true when she accuses (directly or implied) you of not being a good or patient teacher.

 3. **Express your confidence in her.**  So instead of saying "this isn't that hard" or "it's simple", you could say "You can do it love" or "I know you can figure this out, I've seen you figure out hard things before".  Having someone who truly believes in you is way more powerful then I think most of us realize.  

 4. **Compliment her when you're not doing programming.**  Make sure the compliments are genuine and specific, i.e. "Your dresser is always so neat and organized. I like that about you". Your goal with this one is to help her gain confidence in herself in general.

 5. Jesus said "cast not your pearls before swine, lest they turn again and rend you" (paraphrased). I'm not calling names here, I've certainly been the one rejecting pearls of wisdom before. When either of you get to that angry place, just stop teaching. Say something like **"I love you and I don't want to have these hard feelings between us. Let's take a break for an hour (or the day), and try again then."**



Good luck!