Live data from Hacker News

The interruptible programmer

stevestreeting.com

21–30 of 50 posts

Re: The interruptible programmer

#21
post #16

The problem arises when you are focused on something very specific, for example designing a particularly complicated series of function calls, you effectively have to keep a stack in your mind, think about locals, instance variables, whatever, abstract stuff that the brain isn't so well designed at retaining, which becomes very vulnerable to disruption. If you are unlucky enough to be interrupted while in that kind o…

Maybe your code is too complicated? I suppose the ultimate goal is too keep one's code clean and simple enough that one does have to go into super brain mode in order to solve a problem. Sadly we don't live in an ideal world.

I don't think it takes very much complexity before this kind of situation arises (perhaps my example was a little contrived!), maybe it would be clearer to apply this to debugging where it certainly becomes very quickly apparent even with extremely simple code.

I don't think what you claim as ideal is possible - the only thing a programming environment can hope to offer is to eliminate as much accidental complexity as possible, leaving you to focus on essential complexity. The real-world problems we try to solve as developers are usually at least somewhat hard (even the seemingly simple ones), no getting away from that.

In no way intending to be condescending, I seriously recommend you read 'No Silver Bullet' by Fred Brooks if you haven't already - http://en.wikipedia.org/wiki/No_Silver_Bullet - an absolute classic (and important too I think).

Re: The interruptible programmer

#22
post #16

The problem arises when you are focused on something very specific, for example designing a particularly complicated series of function calls, you effectively have to keep a stack in your mind, think about locals, instance variables, whatever, abstract stuff that the brain isn't so well designed at retaining, which becomes very vulnerable to disruption. If you are unlucky enough to be interrupted while in that kind o…

Maybe your code is too complicated? I suppose the ultimate goal is too keep one's code clean and simple enough that one does have to go into super brain mode in order to solve a problem. Sadly we don't live in an ideal world.

> I suppose the ultimate goal is too keep one's code clean and simple enough that one does have to go into super brain mode in order to solve a problem.

Let's drop back into reality for a minute. Just 15 minutes ago I was tracing sql data converted to xml by a rails application which was processed by a perl frontend. Yay legacy code.

It would really be nice for things to be simple but the reality is I'm dealing with multiple erp systems that output mostly similar xml thanks to the people that where here before me. It is not possible to not end up in super brain mode with some of the problems I deal with.

Now my latest project was rather complicated. I took a report that only showed current inventories and converted it to display inventories at any specific day. It was all fine and simple until I encountered a little off by one bug which caused most of the dates to be off by one. Tracing that error through all the layers required a number of hours. I am thankful I was not interrupted with an emergency fix to some production report so it only took hours to fix instead days.

It would be nice if things were simple but not everyone gets to work with clean environments and applications.

Re: The interruptible programmer

#23
What I like about this article is that it's a bunch of helpful hints which are largely inside your control.

There's no suggestion that you're going to change your environment in unrealistic ways, it's more about dealing with the fact you don't work in a perfect space.

Re: The interruptible programmer

#24
post #16

Earlier quoted context omitted.

Maybe your code is too complicated? I suppose the ultimate goal is too keep one's code clean and simple enough that one does have to go into super brain mode in order to solve a problem. Sadly we don't live in an ideal world.

> I suppose the ultimate goal is too keep one's code clean and simple enough that one does have to go into super brain mode in order to solve a problem. Let's drop back into reality for a minute. Just 15 minutes ago I was tracing sql data converted to xml by a rails application which was processed by a perl frontend. Yay legacy code. It would really be nice for things to be simple but the reality is I'm dealing with…

"It is not possible to not end up in super brain mode with some of the problems I deal with."

I'll argue that it is possible, just not necessarily preferable. You could rewrite the whole thing. You could also focus on building a number of small functions which brings the whole interface up to a human-digestible level.

The reality of the matter is not the realm of possibility, but instead that you often just want to get it working by whatever super-herculean effort it takes. People are often very interruptible while fighting hydras or stealing golden fleece.

So it's twofold. Ensure that as often as possible you've got the programmatic infrastructure to only consider human-digestible chunks of complexity at any given time and try not to be interrupted whenever that's not possible.

Re: The interruptible programmer

#25
Keeping context outside of your head is a really good advice. I've been using Google Tasks for that and it works quite well for me. This way I also have the context with me on my phone and I can quickly note down ideas when I am away from my desk.While coding I progress through the list of small tasks and check them away.

Re: The interruptible programmer

#26
Maintain context outside of your head at all times

Much of the problem with interruptions is that of losing context. When you’re in that Zone, you’re juggling a whole bunch of context in your head, adjusting it on the fly, and maintaining and tweaking connections between issues constantly.

I find that there's an all-too common hair-shirted developer mentality that glories in the stunt of keeping track of umpteen different entities and variables at once. Mental/conceptual organization is an area where work smarter should definitely trump work harder. I think a part of the problem has to do with the tendency for dramatic fire-fighting to be rewarded in organizations. What results is like an emergency responder TV show. It's exciting to watch the responders rappelling or doing something exciting and unusual every week, but in reality a well run city would strive to make such events as rare as possible and be boring as possible.

Think of it this way, if you ran a trucking company, would you want employees who had a different hair-raising tale to tell on just about every trip? Do you know developers who are full of such tales?

Re: The interruptible programmer

#27
post #5

IME, the most useful tip is "maintaining the context outside your head". The article recomends a "running comment". I use a notebook, but anyway I find it efective.

A stack of Post-it notes is amazingly useful! IDEs need something like this. Just a command-key sequence on whatever, and a box pops up for a quick annotation, press return and it's saved. (Cue someone telling me that it's already a plugin in Eclipse.)

Re: The interruptible programmer

#28

The problem arises when you are focused on something very specific, for example designing a particularly complicated series of function calls, you effectively have to keep a stack in your mind, think about locals, instance variables, whatever, abstract stuff that the brain isn't so well designed at retaining, which becomes very vulnerable to disruption. If you are unlucky enough to be interrupted while in that kind o…

The problem arises when you are focused on something very specific, for example designing a particularly complicated series of function calls, you effectively have to keep a stack in your mind, think about locals, instance variables, whatever, abstract stuff that the brain isn't so well designed at retaining, which becomes very vulnerable to disruption.

Let me ask this: after you've written such code, how is it for other people to read it? What is it like for people to debug it?

I think a lot of the problem comes down to us using the brain for stuff it's not great at.

I think good programming design tries to maximize the stuff your brain is good at and minimize the use of stuff your brain isn't good at.

Re: The interruptible programmer

#29
post #16

Earlier quoted context omitted.

Maybe your code is too complicated? I suppose the ultimate goal is too keep one's code clean and simple enough that one does have to go into super brain mode in order to solve a problem. Sadly we don't live in an ideal world.

> I suppose the ultimate goal is too keep one's code clean and simple enough that one does have to go into super brain mode in order to solve a problem. Let's drop back into reality for a minute. Just 15 minutes ago I was tracing sql data converted to xml by a rails application which was processed by a perl frontend. Yay legacy code. It would really be nice for things to be simple but the reality is I'm dealing with…

This is an appropriate working style for dealing with legacy code. The key is to be able to switch gears when you're writing new code that doesn't integrate so heavily and you aren't so constrained (more typical in a startup). Different environments require different working styles.

Re: The interruptible programmer

#30
post #5

IME, the most useful tip is "maintaining the context outside your head". The article recomends a "running comment". I use a notebook, but anyway I find it efective.

Good point. I use a large drawing pad and sort of sketch out and arrange keypoints as I go along.

This recent HN item is relevant: http://calnewport.com/blog/2007/10/08/monday-master-class-ho...

Post reply on HN