I'm stuck updating other people's code at work. It's bad, bad code, and as such, it's hard to understand. It's not uncommon for me to stare at it glaze-eyed for several minutes before realizing that these 15 lines are just checking if a file exists.

So that gave me an idea. It sure would be nice if, once I figure out what a particular chunk of code does, I could somehow hide it from view, replaced by a one-line comment on what its function is. Then I could collapse the code one piece at a time, and when I'm all done, I'll have nothing but a big page of pseudocode explaining the whole process. Even better, if I could take those collapsed bits of pseudocode and collapse them together into a higher level of abstraction, and so on. In effect, I'd be generating the kind of comments that should have been placed there by the original programmer to begin with.

So I'm wondering. Does anything out there already do this? I can't see how it'd be useful for coding from scratch, but it'd be invaluable for making sense of legacy code, especially in big projects. Anybody know of such a beast?

I'm too sexy for my .sig.