Spot on.  We see this a lot in coding activities. Many tasks are usually more complicated than for example &quot;import this file into database, use the imported data to produce the histogram&quot; ... there&#x27;s bound to be plenty of &quot;collateral&quot; shyte en route.  Non-programmers don&#x27;t usually understand this.<p>So how to overcome this?<p>There&#x27;s no other way than to cognitively &quot;bring to front&quot; the end goal every time you hit a task hurdle that threatens your concentration or that lets you succumb to distraction.  But it takes practice to learn that you are in the  process of beginning the &quot;shirk move&quot; ... watch out for this. Can you blame yourself when all you&#x27;ve done your whole life subconsciously toggle to other tasks when the going gets tough.  Blame evolution for this.<p>So two things:<p>1.  Know upfront the discrete sub-task&#x2F;destination you are hoping to achieve for a given finite stretch of time, achieve it and call it the day; and<p>2.  Kak on yourself solid! for being distracted during a tough spell ... speak it out to yourself by enunciating that you are being distracted, mofo.  If someone else is doing the disturbing, find a quiet place next time. (Working with kids in the house can be painful).<p>That&#x27;s why I am here!