Live data from Hacker News

Holding a program in one's head

paulgraham.com

1–10 of 136 posts

Re: Holding a program in one's head

#2
I've found that a ramification of holding the current program in my head is that I have a greater emotional bond with whatever problem I've most recently worked on.

If I work on several project concurrently, there's always one of them that I am more passionate about at any given time, causing me to think about it at nearly all hours of the day. Interestingly, the one I am more passionate about oscillates -- and is nearly always the project I have most recently worked on for a large chunk of time. Therefore, it is the one in which I am holding the most context in my head.

Re: Holding a program in one's head

#3
> Sometimes when you return to a problem after a rest, you find your unconscious mind has left an answer waiting for you.

This happens to me on so may occasions in may different areas. While programming, if I have a problem I'll sleep on it, wake up, and see the problem in a whole new light.

Also, before writing an essay for class, I will read the prompt throughly. This way my brain starts form sentences without conscious thought.

Re: Holding a program in one's head

#4
> Oddly enough, scheduled distractions may be worse than unscheduled ones. If you know you have a meeting in an hour, you don't even start working on something hard.

God, how I wish more people understood this. It might seem like programmers overreact to even the most minor demands on their time---"What's the big deal? It's only a half-hour meeting!"---but a half-hour meeting can easily kill several hours of productivity.

Re: Holding a program in one's head

#5
> Thanks to Sam Altman, David Greenspan, Aaron Iba, Jessica Livingston, Robert Morris, Peter Norvig, Lisa Randall, Emmett Shear, Sergei Tsarev, and Stephen Wolfram for reading drafts of this.

PG, you got the Stephen Wolfram to read this? If so, perhaps you can have a conversation with him about making Mathematica open source :~)?

Re: Holding a program in one's head

#7

> Sometimes when you return to a problem after a rest, you find your unconscious mind has left an answer waiting for you. This happens to me on so may occasions in may different areas. While programming, if I have a problem I'll sleep on it, wake up, and see the problem in a whole new light. Also, before writing an essay for class, I will read the prompt throughly. This way my brain starts form sentences without cons…

I totally agree, and oftentimes, I don't even need a whole night. Just now, in fact, I left my laptop frustrated, thinking, "Shoot, what the heck is going on with this bug?!". I went to the bathroom and "forgot" about my problem during my pee. Then, one minute later, walking back toward my laptop, I paged the problem back in, and realized my sub-conscious (I guess) had already solved the problem -- I knew exactly what was going on with the bug.

It startles me how often and well this works. It seems like cheating, too, because it feels like I'm not doing the work! :)

Re: Holding a program in one's head

#8

> Sometimes when you return to a problem after a rest, you find your unconscious mind has left an answer waiting for you. This happens to me on so may occasions in may different areas. While programming, if I have a problem I'll sleep on it, wake up, and see the problem in a whole new light. Also, before writing an essay for class, I will read the prompt throughly. This way my brain starts form sentences without cons…

I totally agree, and oftentimes, I don't even need a whole night. Just now, in fact, I left my laptop frustrated, thinking, "Shoot, what the heck is going on with this bug?!". I went to the bathroom and "forgot" about my problem during my pee. Then, one minute later, walking back toward my laptop, I paged the problem back in, and realized my sub-conscious (I guess) had already solved the problem -- I knew exactly wha…

I've had the same experience with taking a bath. Just forgetting about the problem (weather it is a bath or pee) seems to help.

Re: Holding a program in one's head

#9
Awesome essay, Paul. You really nailed this whole phenomenon. It's the first time I've read all these things in one place and it is so very true in my experiences.

At my old company, one comment you'd always hear from team members with a new idea was "Hey, I thought of this in the shower this morning, and I think we should ..."

Re: Holding a program in one's head

#10
I used to write my research papers (in linguistics) this way, I'd make piles of useless notes, writing and rewriting sections of it while never having anything to show for it. Then when I understood all of it, I'd write the paper (say 10-45 pages) as fast as I could type, usually in a single sitting. I'd have to go back and edit it and such, but the bulk of the work was getting all of the problem and my solution to it into my head.

Interestingly, as I headed to grad school, this became more and more difficult as the problems became harder and harder. Eventually I had to devise a new system for writing papers (which I can't describe adequitely) because the problems and their solutions became to large to hold in my head at once.

To me, this is the interesting case, how do you solve problems that are too large to hold the solutions to in your head at once? The obvious answer is "break it into smaller pieces", but that is frequently very difficult to do. Probably the answer lies in "go back to the basics", and make sure that you have the foundations cold so that they aren't occupying stack space.

Post reply on HN