Debugging as Editing
Jun. 4th, 2003 11:54 pmI've been hearing people around me talk about the books they're writing, and it's been making me think about how writing code is and is not like writing prose.
There are a lot of similarities, but debugging shows up as a big difference. Debugging is a lot like editing--it's a process of taking a work that is mostly "there", understanding what's wrong, and adjusting the work to be right.
But the flaws I fix in debugging are often much more strongly evident flaws than in editing prose--when a program crashes, it's a very clear flaw, and the fix is a very clear improvement. I don't edit my prose with such rigor, with such a sense of the severity of errors. I can't easily imagine what it would be like to do so.
This is part of what appeals to me about programming and debugging--there is the chance to see every flaw writ large, and that means the chance to reach perfection. It never actually happens, of course--every program that actually ships does so with a host of bugs. But even so, it's a deeply neat effect to realize that I can imagine ways for a program to be better--much more easily than I can imagine ways to improve prose or other crafts.
There are a lot of similarities, but debugging shows up as a big difference. Debugging is a lot like editing--it's a process of taking a work that is mostly "there", understanding what's wrong, and adjusting the work to be right.
But the flaws I fix in debugging are often much more strongly evident flaws than in editing prose--when a program crashes, it's a very clear flaw, and the fix is a very clear improvement. I don't edit my prose with such rigor, with such a sense of the severity of errors. I can't easily imagine what it would be like to do so.
This is part of what appeals to me about programming and debugging--there is the chance to see every flaw writ large, and that means the chance to reach perfection. It never actually happens, of course--every program that actually ships does so with a host of bugs. But even so, it's a deeply neat effect to realize that I can imagine ways for a program to be better--much more easily than I can imagine ways to improve prose or other crafts.
no subject
Date: 2003-06-04 10:06 pm (UTC)However, they can still exist. A fatal program crash kills the user's experience of running that program. Sometimes, they can restart the program and find a different way of doing the same thing such that the program doesn't crash. Sometimes the program is just broken.
It's the same with a book. If the reader comes across something that doesn't make sense, or they don't like, they put the book down unfinished. Your story has crashed. If you're still writing the book, you can listen to the feedback, and rewrite slabs of it to remove the problem area, or to increase the suspense, or explain things better so that the reader understands better and can get past the intellectual hurdle. But the process is still essentially the same.
Other times in programming, you just pixel futz to make the UI look better. This is analagous to rewording a para to make it read better.
Now that I think about it, debugging is a form of editing. So is refactoring, but that's another story altogether :)
no subject
Date: 2003-06-05 07:49 am (UTC)Some editing is like debugging (grammar foo and the like), but most of it, in my experience, is more like refactoring: this works, but that would be better. And you get a lot of that in both text and code. (Hey, I know you've been programming long enough that you don't really believe that every flaw will be writ large. :-) )