Live data from Hacker News

Want to write some code? Get away from your computer

blog.rtwilson.com

51–60 of 64 posts

Re: Want to write some code? Get away from your computer

#51

I find I solve the trickiest problems in one of three places: Walking my dog, taking a shower, and laying in bed trying to fall asleep. I find that stepping away from the keyboard, and my programming environment entirely, allows me to let go of all the basic assumptions I hadn't even realized I'd been making.

I'm the same way, and I know a lot of people like this. Many times I've been working on a project with friends and we'll get stuck on something and we'll joke that someone is going to have to go take a shower, so we can get past the hurdle.

Also, I may have, on one or two occasions, written code on the tile walls with tub crayons.... after all, you get a brilliant idea, you don't want to lose it in the time it takes to dry of.

I'd say that in addition to letting go of assumptions, it's just as much about breaking patterns.

I often find that once I start trying to fix a problem, my brain gets stuck in that way of fixing it and if that doesn't work, it then becomes a matter of fixing the fix, etc. It all just kind of builds up. If I'm standing in the shower with hot water pouring over my head, I can free my mind of whatever I was concentrating on and then new ideas emerge.

Re: Want to write some code? Get away from your computer

#52

I find I solve the trickiest problems in one of three places: Walking my dog, taking a shower, and laying in bed trying to fall asleep. I find that stepping away from the keyboard, and my programming environment entirely, allows me to let go of all the basic assumptions I hadn't even realized I'd been making.

I agree and yes I do sometimes bill my shower time. That's where the best work gets done after all

But I think it's much deeper than that. It's the basic truth that creativity emerges from a still mind. First you spend hours obsessing in front of the screen seemingly achieving nothing. Later you seemingly do nothing and solve the hardest problems.

It's an excellent practice to take breaks where you do nothing. Pretend to be a smoker and step out for a smoking break every hour or so.

Re: Want to write some code? Get away from your computer

#54

I find I solve the trickiest problems in one of three places: Walking my dog, taking a shower, and laying in bed trying to fall asleep. I find that stepping away from the keyboard, and my programming environment entirely, allows me to let go of all the basic assumptions I hadn't even realized I'd been making.

This is often repeated by a lot of people, but I think it might be affected by a bias. Perhaps we notice more when we solve problems away from the keyboard because we are not supposed to be working then. Perhaps we selectively label those the trickiest even though we solve many more problems staring at the monitor trying really hard.

Re: Want to write some code? Get away from your computer

#55

I find I solve the trickiest problems in one of three places: Walking my dog, taking a shower, and laying in bed trying to fall asleep. I find that stepping away from the keyboard, and my programming environment entirely, allows me to let go of all the basic assumptions I hadn't even realized I'd been making.

This. Circa 2002, I debugged a mutli-threaded Java server, by taking a hard copy of source and walking through it on paper.

A developer sitting in another office had written it; I was roped in at the moment the nasty bug was discovered, basically to have a look from a fresh set of eyes. It had to be shipped in a couple of days time.

The neat thing about writing code on paper is the amazing gain in clarity. Of course, like all approaches, it has to be taken with a grain of salt.

It seems to me that the necessity of scrolling on a Laptop screen somehow creates additional cognitive overhead, especially when we want to rapidly jump across sections of code. Perhaps, it forces us being physically away from the machine to reflect more deeply on the problem.

Re: Want to write some code? Get away from your computer

#56
Is it really true that many real-world programming tasks require this level of thought and dedication?

Honest question, I'm a student and none of my school/pet projects have been difficult enough that stepping away from the computer was beneficial. Only puzzles have been hard enough.

Re: Want to write some code? Get away from your computer

#57
post #17

This is good mostly for algorithms but for system software (drivers, a lot of different technologies involved) is impossible because issues are outside of your control, without debugging you'll lose 100x of time.

Agreed -- the author of the post is talking about writing or debugging algorithms; coding is the stuff you need your computer for.

Re: Want to write some code? Get away from your computer

#58

Why is the write test -> code -> run test -> code -> run test -> etc. circle being derided? Given that your test cases are stringent enough, it should be fine. If you did indeed write good test cases, then that's a prime indicator that you understand the problem you're solving well. Try test first programming, it's trickier than it sounds at first. In my opinion, it is too easy to get caught up into coding something…

[deleted]

Re: Want to write some code? Get away from your computer

#59

Why is the write test -> code -> run test -> code -> run test -> etc. circle being derided? Given that your test cases are stringent enough, it should be fine. If you did indeed write good test cases, then that's a prime indicator that you understand the problem you're solving well. Try test first programming, it's trickier than it sounds at first. In my opinion, it is too easy to get caught up into coding something…

[deleted]

Re: Want to write some code? Get away from your computer

#60
post #54

I find I solve the trickiest problems in one of three places: Walking my dog, taking a shower, and laying in bed trying to fall asleep. I find that stepping away from the keyboard, and my programming environment entirely, allows me to let go of all the basic assumptions I hadn't even realized I'd been making.

This is often repeated by a lot of people, but I think it might be affected by a bias. Perhaps we notice more when we solve problems away from the keyboard because we are not supposed to be working then. Perhaps we selectively label those the trickiest even though we solve many more problems staring at the monitor trying really hard.

There is certainly some confirmation bias going on in these reports, but I must say I sometimes find walking away from the problem for a short while (looking at something else, taking a relaxed lunch instead of eating at desk, just nipping out for a few minutes of fresh air, or just chatting to a colleague about something related or otherwise) can work wonders.

Sometimes a relevant idea will just come to me while I'm away (I carry a pencil and bit of paper for such occurrences, as it is very annoying to get back to my desk and forget the beneficial train of thought!), sometimes I'll hit the problem from a slightly different angle when I get back and find success that way.

I think mainly the difference is usually stress. Forcing your mind to think about a particular problem can drive you into a mental rut in which you think the same things over and over and get nowhere, getting more irritated at your lack of getting anywhere as time goes on which creates more stress and makes matters worse. At times like that inspiration is less likely to strike (or be recognised when it does). Having time to ponder a problem, consciously or otherwise, can be very fruitful.

This fits in quite nicely with the idea that the sleep pattern we've evolved is as much about rearranging what we've learnt and experienced while awake as it is about anything else (like the brain's DBA taking time to run DBCC REINDEX on everything so our thinking is more efficient the next day). It also tallies with the fact that some of the most successful people I know are generally more relaxed (and not just because they are more comfortable due to earlier success) than myself!

Post reply on HN