user738: I have read this question but I'm seeking more advice.
So it is quite obvious in the activity of software programming that we cannot help but think about programming concepts and also end up creating objects as concepts (as in Object Oriented Programming) and make something work. 
Now, I understand their usefulness in the context of what I am working on. 
Invariably, I get flustered and frustrated sometimes when something doesn't work because I am lost in the process of creation of that thing which I am currently working on, the cause being I am not mindful. Because mindfulness means there is an observer observing the mind and thoughts, which may lead to emotions. But in this activity the mind is busy creating things which would work on a system. 
Also, sometimes work is incomplete, and you do get an urge to work on something but also you could spend the time to do samatha or vipassana. How to decide efficiently in these cases?  
How to balance mindfulness, be equanimous and pursue this kind of creative activity at the same time? Or is this a curse that you cannot do it effectively in the process of creativity?  
I would like to know if someone dealt with this and how? Thank you.

user295: 
Vedana is also a cetasikacetasika (mental concomitant). When the Buddha says, sabbe dhamma vedana samosaranasabbe dhamma vedana samosarana, it means that the experience of all mental concomitants includes and is inseparable from vedana.

Why Vedana and What is Vedana?
Whenever you are doing creative activity it creates sensation or mental stimulations which are pleasant, unpleasant or neutral. In situations like this you have to keep equanimity and knowing the arising and passing nature of the sensations. The following answer has more detail.

user-1: This is a good question, because in the modern world, we mostly create benefit by using our minds, and most people cannot simply become immersed in traditional mindfulness practices and retreat situations most of the time. We need to discover the "one mind" in our little minds, while minding what we do, without minding what happens along the way. Mind you, this is a lot to ask.
I was a programmer for 12 years, creating complex things that got used commercially. I am familiar with frustration, and elation. Now I teach programming to adults making a career change, and I tell that that programming is frustrating! But, as my Guru says, "There is no 'problem'. We are the problem." You are frustrated. As you say, there is observation of this fact. With observation and reflection come the possibility of awareness and knowledge. So you are on the right track.
It might seem that using the mind to create mental models and concepts (such as in programming) is somehow more ensnaring than other types of work. Perhaps. But if your observer sits with you and helps you remain connected inwardly, then this gets better. There is no fundamental obstacle to conceptual work being also mindful. Eventually, your observer has done a good enough job and dissolves. Then there is no one to get ensnared, frustrated, or wonder if it is being done correctly. (This is nonduality.)
For your other question, deciding what is best to do, how to balance work, practice, rest, etc: that is more practice. Make a decision, observe what happens, reflect. There is no way out of this, it is how life is. Good luck!
ADDITION: Whew, this is a thicket if I ever saw one. Related questions about Mindfulness and so on swirling like a storm of words... Here is how I experience all of this, if it does not clear it up for you, perhaps your mind simply functions differently than mine.
My consciousness is a collection of points of view. I see the functioning of the mind as a bunch of "bubbles of awareness" of varying sizes, more or less known to me at any given time. In an alpha state, or perhaps a nondual state, it feels as though my entire consciousness is a single, silent point of view, but of course small bubbles are constantly arising below awareness and causing small effects, which might grow and distract me again. One cannot live one's life in an alpha state! My model of multiple points of awareness in the mind has scientific backing, but I came to it from my own experience. 
My mind includes 4 past life personalities (which I no longer have a view on whether they are "true" or not, they are relics of earlier in my life). A few years ago, I created about 5 "personality facets", based on my understanding of the Archetypes, in an attempt to develop more areas of my abilities. I have other experiences of "voices" and things going on inside that I will not attempt to categorize. To me, all of this is just the simple functioning of a creative mind. We can model other minds, so it is obvious that we can model and construct personalities in our own minds. This is the basis for part of Transpersonal Psychology. (I found out about that long after I created my facets.) Also, I have one "Accompanying Voice" which I do not see as part of myself at all. I learned what it was once, but the understanding was so powerful that my mind halted and rejected it. (So I can't tell you what it is.) My facets and past lives comment on my life, have emotional reactions (often two or more of them at once), converse with each other, paint, write books and do other things. It is like living in a busy household. This is my normal state. Everyone I have described it to understands and finds me sane, although different from themselves. I call it, being a Creative Person.
I have long thought of my mind as my "experimental laboratory": I get to try things out and see how they work. When we come to questions like "who is watching the watcher" etc, I see these as just silly. Consciousness is "whatever it does" and does not need a definition from us. However, it did not come with an Owner's Manual, so we need to discover how it works as best we can and learn how not to fall in to error. Some ideas are approximations, some are tools, some are crutches, and many are crippling.
Krishnamurti's Master when he was a boy said: "You are not your mind, but it is yours to use." Have fun!

user43: 
I get frustrated when something doesn't work ... the cause being I am not mindful ... which may lead to emotions.

Frustration is a good example of Dukkha (the painful feeling of wrongness). It is generated from mismatch between "how things are" and "how they should be". If you look carefully once you are already frustrated - you will see this mismatch right in front of your nose. Then it's up to you to let go of "how they should be" idea. If you let go, the dukkha will subside. If you keep grasping, the dukkha will keep getting generated. Sometimes the right choice is to pay with dukkha for something bigger. But most often accepting "how things are" is a wiser choice, even if it goes against our foolish heart.

Also, sometimes work is incomplete, and you do get an urge to work on something but also you could spend the time to do samatha or vipassana.

Same problem. You have a conflict between "is" (work) and "should" (meditation). Let go of this conflict and you will be good. That is the real mediation, the higher kind of meditation.

user254: Yes it's a problem.
To some extent an impossible problem, in the sense that ...

The Difficult We Do Immediately. The Impossible Takes a Little Longer.

Quote Investigator also gives that as,

"If it's possible, it's done. If it's impossible it will be done.



I get flustered

Anyway, I read "I get flustered" as saying that when the going gets difficult then you suffer a crash.
Zen and the Art of Motorcycle Maintenance talks about this (which can happen as the result of some "set-back") as a "gumption trap" or "loss of gumption".
The way I perceive it as that I need to use my head for storage: my head is meant to be running (or at least simulating the running of) the software, simulating input data (possibly several data, all possible data), keeping in mind the expected output, comparing my model of the needed software with my observtion of the actual software, understanding the "steel threads" while using hygienic techniques to sanitize any errors paths. If there's a setback (e.g. an emotional setback) then I might lose all that and it takes a while to reconstruct it. If I'm (emotionally) unwilling then the afflictive emotion is what occupies (clouds) the head. And repeated setbacks might tend to train you to feel aversion (which is a vicious cycle).
See also Are mindfulness and flow related -- I wanted to find the answer[s] to that useful, but haven't yet.
My little understanding of flow is two-fold:

If you use a scanner (perhaps an MRI) to look at brain activity, they say a a brain in 'flow' state is less active than unusual, i.e. there are various parts of the brain which aren't active; perhaps that's like, those other parts of the brain are distractions, or like, various flaps and spoilers and undercarriage and so on is folded away when an airplane is cruising.
Flow state happens when the difficulty of the work is in a Goldilocks zone: not too easy (which is so boring that it doesn't hold your attention), and not too difficult (which a mind that wants to experience success might be averse to).

Consequently, two bits of advice:

Avoid distractions
If the work is too difficult then simplify it (e.g. analyze it, write it down, automate testing, etc.).

Furthermore:

If you stop working because you care too much, because you identify with the failing software, then try to be a bit more dispassionate
Conversely if you stop working because you care too little, then maybe reflect a little more on the (real world) consequences

A technique which can help is incremental development: take it from one working (satisfactory albeit non-final/temporary) state to the next ... perhaps like Tai Chi walking where you maintain balance during and after each step, or like rock-climbing where you move from one safe hold to another.


and frustrated sometimes when something doesn't work

It's not going to "work" until it's 'finished'. The majority of your time is with it unfinished and therefore in a non-working state ... so you can't afford to get too personally upset about that, perhaps like a doctor couldn't afford to get too upset with everyone's illnesses (or a garbage collector with people's garbage).
Perhaps ideally you'll see that "not working" as a fault of the software (not a fault of you), and identify what and how to add to or remove from the software (including, your model of the software).
However the dissatisfaction you feel with non-working software is why they're paying you (to work with it) and why you're motivated to fix it: the subjective experience needn't be entirely pleasant all the time.
I guess that I may be more of a "feeler" than a "thinker" (than most other programmers are) on the MBTI, so I use my feelings (e.g. "satisfying" or "not satisfying") as a tool which gives me feedback of whether the software is working. I can't wholly recommend that (it has drawbacks) but that's maybe what I have to work with.
If you're aware you've become "frustrated" then a change in pace or situation might help (see also "the aha! moment"); I won't recommend you go for a cigarette, but maybe take a walk outside.


How to decide efficiently in these cases?

A traditional way to do that is with a clocked schedule:

"For the next hour, I'm going to be working"
"I'm going to work from 14:00 to 17:30 with a short break each hour"

Whether that's "efficient" I can't tell you. Some other people swear by "being in the zone" at irregular hours.


I would like to know if someone dealt with this and how?

Perhaps it's obvious they do. Maybe they master it, continue to practice it, and experience its "three characteristics" too.

738: <p>I have read <a href="https://buddhism.stackexchange.com/questions/7358/developing-mindfulness-doing-complex-activities-like-learning-or-programming">this</a> question but I'm seeking more advice.</p>

<p>So it is quite obvious in the activity of software programming that we cannot help but think about programming concepts and also end up creating objects as concepts (as in Object Oriented Programming) and make something work. </p>

<p>Now, I understand their usefulness in the context of what I am working on. </p>

<p>Invariably, I get flustered and frustrated sometimes when something doesn't work because I am lost in the process of creation of that thing which I am currently working on, the cause being I am not mindful. Because mindfulness means there is an observer observing the mind and thoughts, which may lead to emotions. But in this activity the mind is busy creating things which would work on a system. </p>

<p>Also, sometimes work is incomplete, and you do get an urge to work on something but also you could spend the time to do samatha or vipassana. How to decide efficiently in these cases?  </p>

<p>How to balance mindfulness, be equanimous and pursue this kind of creative activity at the same time? Or is this a curse that you cannot do it effectively in the process of creativity?  </p>

<p>I would like to know if someone dealt with this and how? Thank you.</p>
 295: <blockquote>
  <p>Vedana is also a cetasikacetasika (mental concomitant). When the Buddha says, sabbe dhamma vedana samosaranasabbe dhamma vedana samosarana, it means that the experience of all mental concomitants includes and is inseparable from vedana.</p>
</blockquote>

<p><a href="http://www.vridhamma.org/Why-Vedana-and-What-is-Vedana" rel="nofollow noreferrer">Why Vedana and What is Vedana?</a></p>

<p>Whenever you are doing creative activity it creates sensation or mental stimulations which are pleasant, unpleasant or neutral. In situations like this you have to keep equanimity and knowing the arising and passing nature of the sensations. The <a href="https://buddhism.stackexchange.com/a/19187/295">following answer</a> has more detail.</p>
 -1: <p>This is a good question, because in the modern world, we mostly create benefit by using our minds, and most people cannot simply become immersed in traditional mindfulness practices and retreat situations most of the time. We need to discover the "one mind" in our little minds, while minding what we do, without minding what happens along the way. Mind you, this is a lot to ask.</p>

<p>I was a programmer for 12 years, creating complex things that got used commercially. I am familiar with frustration, and elation. Now I teach programming to adults making a career change, and I tell that that programming is frustrating! But, as my Guru says, "<em>There is no 'problem'.</em> We <em>are the problem.</em>" You are frustrated. As you say, there is observation of this fact. With observation and reflection come the possibility of awareness and knowledge. So you are on the right track.</p>

<p>It might seem that using the mind to create mental models and concepts (such as in programming) is somehow <em>more</em> ensnaring than other types of work. Perhaps. But if your observer sits with you and helps you remain connected inwardly, then this gets better. There is no fundamental obstacle to conceptual work being also mindful. Eventually, your observer has done a good enough job and dissolves. Then there is no one to get ensnared, frustrated, or wonder if it is being done correctly. (This is nonduality.)</p>

<p>For your other question, deciding what is best to do, how to balance work, practice, rest, etc: that is more practice. Make a decision, observe what happens, reflect. There is no way out of this, it is how life is. Good luck!</p>

<p><strong>ADDITION:</strong> Whew, this is a thicket if I ever saw one. Related questions about Mindfulness and so on swirling like a storm of words... Here is how I experience all of this, if it does not clear it up for you, perhaps your mind simply functions differently than mine.</p>

<p><strong>My consciousness is a collection of points of view.</strong> I see the functioning of the mind as a bunch of "bubbles of awareness" of varying sizes, more or less known to me at any given time. In an alpha state, or perhaps a nondual state, it feels as though my entire consciousness is a single, silent point of view, but of course small bubbles are constantly arising below awareness and causing small effects, which might grow and distract me again. One cannot live one's life in an alpha state! My model of multiple points of awareness in the mind has <strong>scientific backing</strong>, but I came to it from my own experience. </p>

<p>My mind includes 4 past life personalities (which I no longer have a view on whether they are "true" or not, they are relics of earlier in my life). A few years ago, I created about 5 "personality facets", based on my understanding of the <strong>Archetypes</strong>, in an attempt to develop more areas of my abilities. I have other experiences of "voices" and things going on inside that I will not attempt to categorize. To me, all of this is just the simple functioning of a creative mind. We can model other minds, so it is obvious that we can model and construct personalities in our own minds. This is the basis for part of <strong>Transpersonal Psychology</strong>. (I found out about that long after I created my facets.) Also, I have one "Accompanying Voice" which I do not see as part of myself at all. I learned what it was once, but the understanding was so powerful that my mind halted and rejected it. (So I can't tell you what it is.) My facets and past lives comment on my life, have emotional reactions (often two or more of them at once), converse with each other, paint, write books and do other things. It is like living in a busy household. This is my normal state. Everyone I have described it to understands and finds me sane, although different from themselves. I call it, being a Creative Person.</p>

<p>I have long thought of my mind as my "experimental laboratory": I get to try things out and see how they work. When we come to questions like "who is watching the watcher" etc, I see these as just silly. Consciousness is "whatever it does" and does not need a definition from us. However, it did not come with an Owner's Manual, so we need to discover how it works as best we can and learn how not to fall in to error. Some ideas are approximations, some are tools, some are crutches, and many are crippling.</p>

<p>Krishnamurti's Master when he was a boy said: <strong>"You are not your mind, but it is yours to use."</strong> Have fun!</p>
 43: <blockquote>
  <p>I get frustrated when something doesn't work ... the cause being I am not mindful ... which may lead to emotions.</p>
</blockquote>

<p>Frustration is a good example of Dukkha (the painful feeling of wrongness). It is generated from mismatch between "how things are" and "how they should be". If you look carefully once you are already frustrated - you will see this mismatch right in front of your nose. Then it's up to you to let go of "how they should be" idea. If you let go, the dukkha will subside. If you keep grasping, the dukkha will keep getting generated. Sometimes the right choice is to pay with dukkha for something bigger. But most often accepting "how things are" is a wiser choice, even if it goes against our foolish heart.</p>

<blockquote>
  <p>Also, sometimes work is incomplete, and you do get an urge to work on something but also you could spend the time to do samatha or vipassana.</p>
</blockquote>

<p>Same problem. You have a conflict between "is" (work) and "should" (meditation). Let go of this conflict and you will be good. That is the real mediation, the higher kind of meditation.</p>
 254: <p>Yes it's a problem.</p>

<p>To some extent an impossible problem, in the sense that ...</p>

<blockquote>
  <p>The Difficult We Do Immediately. The Impossible Takes a Little Longer.</p>
</blockquote>

<p><a href="http://quoteinvestigator.com/2015/06/10/impossible-longer/" rel="nofollow noreferrer">Quote Investigator</a> also gives that as,</p>

<blockquote>
  <p>"If it's possible, it's done. If it's impossible it will be done.</p>
</blockquote>

<hr>

<blockquote>
  <p><strong>I get flustered</strong></p>
</blockquote>

<p>Anyway, I read "I get flustered" as saying that when the going gets difficult then you suffer a crash.</p>

<p><em>Zen and the Art of Motorcycle Maintenance</em> talks about this (which can happen as the result of some "set-back") as a "gumption trap" or "loss of gumption".</p>

<p>The way I perceive it as that I need to use my head for storage: my head is meant to be running (or at least simulating the running of) the software, simulating input data (possibly several data, all possible data), keeping in mind the expected output, comparing my model of the needed software with my observtion of the actual software, understanding the "steel threads" while using hygienic techniques to sanitize any errors paths. If there's a setback (e.g. an emotional setback) then I might lose all that and it takes a while to reconstruct it. If I'm (emotionally) unwilling then the afflictive emotion is what occupies (clouds) the head. And repeated setbacks might tend to train you to feel aversion (which is a vicious cycle).</p>

<p>See also <a href="https://buddhism.stackexchange.com/q/13381/254">Are mindfulness and flow related</a> -- I wanted to find the answer[s] to that useful, but haven't yet.</p>

<p>My little understanding of flow is two-fold:</p>

<ul>
<li>If you use a scanner (perhaps an MRI) to look at brain activity, they say a a brain in 'flow' state is <em>less</em> active than unusual, i.e. there are various parts of the brain which aren't active; perhaps that's like, those other parts of the brain are distractions, or like, various flaps and spoilers and undercarriage and so on is folded away when an airplane is cruising.</li>
<li>Flow state happens when the difficulty of the work is in a Goldilocks zone: not too easy (which is so boring that it doesn't hold your attention), and not too difficult (which a mind that wants to experience success might be averse to).</li>
</ul>

<p>Consequently, two bits of advice:</p>

<ul>
<li>Avoid distractions</li>
<li>If the work is too difficult then simplify it (e.g. analyze it, write it down, automate testing, etc.).</li>
</ul>

<p>Furthermore:</p>

<ul>
<li>If you stop working because you care too much, because you identify with the failing software, then try to be a bit more dispassionate</li>
<li>Conversely if you stop working because you care too little, then maybe reflect a little more on the (real world) consequences</li>
</ul>

<p>A technique which can help is <em>incremental</em> development: take it from one working (satisfactory albeit non-final/temporary) state to the next ... perhaps like Tai Chi walking where you maintain balance during and after each step, or like rock-climbing where you move from one safe hold to another.</p>

<hr>

<blockquote>
  <p><strong>and frustrated sometimes when something doesn't work</strong></p>
</blockquote>

<p>It's not going to "work" until it's 'finished'. The majority of your time is with it unfinished and therefore in a non-working state ... so you can't afford to get too personally upset about that, perhaps like a doctor couldn't afford to get too upset with everyone's illnesses (or a garbage collector with people's garbage).</p>

<p>Perhaps ideally you'll see that "not working" as a fault of the software (not a fault of you), and identify what and how to add to or remove from the software (including, your model of the software).</p>

<p>However the dissatisfaction you feel with non-working software is why they're paying you (to work with it) and why you're motivated to fix it: the subjective experience needn't be entirely pleasant all the time.</p>

<p>I guess that I may be more of a "feeler" than a "thinker" (than most other programmers are) on the <a href="https://en.wikipedia.org/wiki/Myers%E2%80%93Briggs_Type_Indicator" rel="nofollow noreferrer">MBTI</a>, so I use my feelings (e.g. "satisfying" or "not satisfying") as a tool which gives me feedback of whether the software is working. I can't wholly recommend that (it has drawbacks) but that's maybe what I have to work with.</p>

<p>If you're aware you've become "frustrated" then a change in pace or situation might help (see also "<a href="https://en.wikipedia.org/wiki/Eureka_effect" rel="nofollow noreferrer">the aha! moment</a>"); I won't recommend you go for a cigarette, but maybe take a walk outside.</p>

<hr>

<blockquote>
  <p><strong>How to decide efficiently in these cases?</strong></p>
</blockquote>

<p>A traditional way to do that is with a clocked schedule:</p>

<ul>
<li>"For the next hour, I'm going to be working"</li>
<li>"I'm going to work from 14:00 to 17:30 with a short break each hour"</li>
</ul>

<p>Whether that's "efficient" I can't tell you. Some other people swear by "being in the zone" at irregular hours.</p>

<hr>

<blockquote>
  <p><strong>I would like to know if someone dealt with this and how?</strong></p>
</blockquote>

<p>Perhaps it's obvious they do. Maybe they master it, continue to practice it, and experience its "three characteristics" too.</p>
