Chess, Buckets and Scrolling
Dave Lemphers has been talking about chess, and Darren came in on the discussion too with some comments of buckets.
It's all about dealing with information overload. When you've got to deal with a whole lot of information at once, unless you can generalise or group things together, it becomes too much to keep a handle on all at once.
So I thought I'd describe what happens in my head (because I think it's strange :)
Sometime in the last two years (I can't remember exactly when) I was designing a new system at work. Generally speaking it wasn't too hard, but at the same time the specifics were numerous and complex. It became a problem for me because there was a fair bit of stuff I hadn't yet learned how to do, and the stuff I did know about was just plain hard.
Normally when I'm coming up with new ideas and designing things I let it all jumble around in my head until I've got a fairly clear picture in my mind of what it is I have to write. Basically, I write the application in my head first before I sit down to write a single line of code. I don't use normal code for this, but more of a shorthand. A line that means 'this sort of task', a line that means 'that sort of loop', etc. In a way you could compare it to Dave's chunks, but only roughly :)
For this one though, it was jumbling around in my head constantly, but the damn thing wouldn't settle. I couldn't get a grasp of how I was going to write it - every time I tried I'd get a certain way along and realise i'd forgotten something and need to scrap it. And it kept on happening. And I couldn't work out why.
And then it clicked. My buffer size had been exceeded.
Since I generally think in code in these situations, and since there was so much going on at once, when I 'typed' the code in my head I'd fill more than one 'screen'. Everytime I 'scrolled back up' to see something I'd previously written, I forogt where I was up to lower down. If I didn't scroll back up, then I forgot what I'd 'typed' above. The scroll bar in my head was too small.
The interesting thing (to me) is that I managed to overcome the problem. It's really hard to describe, but basically I improved my shorthand (or increased my chunk size, if you will :) By recognising that there were certain bits that didn't really need to be written yet, I was able to generalise different chunks of code in my head to less information. You could almost say I refactored it - me, I prefer to say that I descreased the font size so that more text could fit in the screen at once :)
But it all comes down to the same thing. You need some way to package up different things so that you know what they are, but they don't get in the road of the problem at hand.
Darren mentioned this ability is something that contributes the difference between a good and a great programmer. I think the biggest thing that contributes to the great prgrammer is an agile mind that can deal with complex problems - this just seems to be a common mechanism that that is used to acheive that end.
[Now Playing: Enough Space - Foo Fighters]