Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

There's a workflow I'm working on. It's so far been web forms filling databases with occasional writing configuration scripts for analysis instruments instruments, and I've written it all, in Perl, Javascript, HTML, Javascript, MySQL.

And right now, the task in front of me is generating a post-instrument analysis Bash script. Or, rather, a Perl-written post-instrument analysis script generator. And it is taking forever. I have had this as the front-burner task for a while now, and progress has been horribly, embarrassingly slow. In fact, last Friday, I sat, looking at the screen, trying to find my way into the next step of the project, and the first sign of ... inspiration? Of capability? Of knowing and attacking any aspect of the task and being able to code it? Well, it started at 4:30pm, and I rode it until 8:20.

I am looking for and hoping for ideas and techniques to get into that mental space consistently and on my schedule. Any pointers?

share|improve this question

9 Answers

It is called flow. Now look for that instead. Plenty of pointers here and there

share|improve this answer

First, if you're looking for pointers, you're using the wrong language, try C... waits for pun...

But in reality, sometimes the best way to get into a certain frame of mind or to get past an impasse in programming is to either work on something different for a while, or to try and attack the same problem from a different angle.

share|improve this answer
3  
0x74A3842B, 0x8012CF83, ... – jsternberg Mar 28 '11 at 3:25

Here is a roundup of the best posts on the psychology of 'flow' from Programmers.SE. How to achieve it, how to break it, books to read and videos to watch.

Warning: don't click these links if you're trying to achieve a flow state.

share|improve this answer

If you are procrastinating

If you remove all the more interesting things from your life, the most interesting thing that remains will be your work.

If you are genuinely stuck

I find getting out an old-fashioned pad of paper and asking "What am I trying to do here?" And after I have answered that, "How do I get from A to B?". If I can put it into steps, I'll then do the first step. If not, maybe ask someone else? (But google first.)

share|improve this answer

" Of knowing and attacking any aspect of the task and being able to code it? Well, it started at 4:30pm..."

You need to define what you are building before it can be built. This is what stopped you in your own words.

share|improve this answer
That's a big part of it, sure. – VarLogRant Mar 28 '11 at 17:48

If you're sure that the problem is nor burnout, and that some planned and honest rest won't fix it, then placing my mind on something else for a while works for me:

  • Meditation.
  • Playing music.
  • A sport.
  • The I Ching. The whole process.
  • To study something technical but (apparently) completely unrelated to the task at hand. It promotes lateral thinking.
share|improve this answer

Here are some of things I do when I get stuck:

  • Specify (opposite of generalize). Solve a more specific version of the problem.
  • Break down the problem into component parts and solve one part.
  • Re-characterize the problem. What am I actually trying to do.
  • Take a break.
  • Get someone else involved who is fresher.
share|improve this answer

Get a pad of a paper and a comfortable pen and physically write it out. Write down exactly what you are trying to do. Sketch, doodle, scribble, just draw/write. Mspaint wont work. Any program on your computer that is supposed to help, won't work. The act of typing the words of whatever language you're using into whatever editor you're using doesn't make a program. It's made in your brain.

Want to write some code? Get away from your computer!

I built a mysql database for a friends photography website recently. I was having a very hard time wrapping my head around exactly how it needed to work, and how to lay out the table structure. I tried mspaint first, then various database design apps. They all help a little, but I was still stuck. As soon as I got a real pen and real paper and really wrote it down, it just clicked.

This may sound "new-agey", but I honestly think it has something to do with having to actually use your brain to physically move your arm to move the pen to draw what you're thinking of.

share|improve this answer
1  
I know that when I have to really think through a problem, it helps to print out source code and sit away from the computer to work it out, because doing it at the computer encourages hacking. But good advice on this one. – VarLogRant Mar 30 '11 at 14:34

Several people have said get away from the computer, and a walk around the block can do wonders. But for really hard problems I think about it as I'm going to sleep. Preferably a nap in the afternoon where you're not going to be out for 8 hours, but at night with a pen and pad of paper by your head can work.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.