Sunday 20 October 2013

Programming: Debugging Tips


  • Visualize concepts when possible. 
    • Helps to understand where the information is going and what is happening
  • Modular code to easily understand the separate parts. 
    • Break things into smaller functions, assign a single task to each function.
  • Clear variable names, especially loop variables. 
    • Example: Instead of i,j for a matrix, use iRow, jCol
    • Now you at least have some sort of idea what each loop variable is.
  • Unit Testing
    • Modular code allows you to test each code component separately in order to ensure that the behavior of each function is what you expect.

For more tips like these, see 'Clean Code'. 
http://it-ebooks.info/book/1441/

Book recommendation and discussion via Karanhaar.

No comments:

Post a Comment