Marshall wrote: > Joe Marshall wrote: > > > > That's the important point: I want to run broken code. > > I want to make sure I understand. I can think of several things > you might mean by this. It could be: > 1) I want to run my program, even though I know parts of it > are broken, because I think there are parts that are not broken > and I want to try them out.
I think I mean a little of each of these. Nearly *every* program I have ever used is buggy, so this is actually a normal state of affairs even when I'm not debugging or developing. > 2) I want to run my program, even though it is broken, and I > want to run right up to a broken part and trap there, so I can > use the runtime facilities of the language to inspect what's > going on. I do this quite often. Sometimes I'll develop `in the debugger'. I'll change some piece of code and run the program until it traps. Then, without exiting the debugger, I'll fix the immediate problem and restart the program at the point it trapped. This technique takes a bit of practice, but if you are working on something that's complex and has a lot of state, it saves a lot of time because you don't have to reconstruct the state every time you make a change. > > I want to run > > as much of the working fragments as I can, and I want a `safety net' to > > prevent me from performing undefined operations, but I want the safety > > net to catch me at the *last* possible moment. > > This statement is interesting, because the conventional wisdom (at > least as I'm used to hearing it) is that it is best to catch bugs > at the *first* possible moment. But I think maybe we're talking > about different continua here. The last last last possible moment > is after the software has shipped to the customer, and I'm pretty > sure that's not what you mean. I think maybe you mean something > more like 2) above. It is often the case that the proximate cause of a bug is nowhere near where the fix needs to be applied. This is especially true with the really hard bugs. A static type system will tell me that there (may) exist a path through the code that results in an error, but the runtime check that fails will provide a witness. -- http://mail.python.org/mailman/listinfo/python-list