Hi Alexander! Next time please delete the rest of the message - it was
quite long.
Ok.


As much as a code can be well-thought and well-designed, there can always
be typos and things you did not thought about. A misplaced operator, two
consecutive if's instead of one nested in the other or vice versa. A
missing if altogether. And it can happen while your program is in the
1000's iteration. Would you like to analyze a log of N*1000 lines?
Those are exactly the trivial mistakes I was talking about - they are very easy to catch with a println because it's immediately visible that some variable's value is incorrect. As for analyzing a log of N*1000 lines - why would I do that? The language has a beautiful mechanism for conditional printlns:
if (controlVariable != expectedValue){
System.out.println("error on iteration "+i+". var1: "+var1+" var2: "+var2);
Thread.dumpStack();
}

The only thing that is hard to debug in Java (and in any other language) is multithreading, with or without a debugger. I avoid multithreading bugs by being 5 times as careful about multithreaded code as I am about single threaded code.


Alexander Maryanovsky.


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to