TutorialsTutorials HomeDebuggingIntroductionGood Practices Compiler Errors Run-Time Errors Wrong Answers MPI Errors Utilities
FullDocument
Related InfoTotalviewDebugging Tools
|
Good Programming PracticesThe best debugging strategy is to use good programming practices, since this is the key to easy debugging. Obvious practices include:
It is also a good idea to try and align complicated equations to easily catch syntax and typing errors. For example, both these statements have the same typo, but it is readily apparent in the well-written one:
example = ( ax1*by1 - ay1*bx1 ) &
- ( ax1*bz1 - az*bx1 ) &
+ ( ay1*bz1 - az1*by1 )
example=(ax1*by1-ay1*bx1)-(ax1*bz1-az*bx1)+(ay1*bz1-az1*by1)
These kinds of typos can be difficult to track down, because if variable
Another programming practice that can be helpful but many people don't
use is the |
![]() |
Page last modified: Fri, 21 May 2004 20:47:44 GMT Page URL: http://www.nersc.gov/nusers/help/tutorials/debug/practice.php Web contact: webmaster@nersc.gov Computing questions: consult@nersc.gov Privacy and Security Notice |
![]() |