Difference between revisions of "Debugging"

From ProgClub
Jump to: navigation, search
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
The plan with this page is to build a checklist for potential causes of bugs. I'm annoyed that I only started this 30 years after I started programming. Every time I solve a problem caused by a type of bug I will try to add it to this list so it doesn't get me so easily next time.
 +
 +
= Checklist =
 +
 
Some questions to ask yourself when you're debugging a problem:
 
Some questions to ask yourself when you're debugging a problem:
  
Line 5: Line 9:
 
* did you forget to call your parent's constructor?
 
* did you forget to call your parent's constructor?
 
* did you pass a constant value instead of a constant name to e.g. defined()
 
* did you pass a constant value instead of a constant name to e.g. defined()
* have you changed a positional interface (function parameters in order) without updating callers? positional interfaces are typically used in DAL add() and set() functions.
+
* have you changed a positional interface (function parameters in order) without updating callers? positional interfaces are typically used in DAL add() and set() functions. as a general rule you should only add parameters and never change their order.
 +
 
 +
= Reference =
 +
 
 +
* http://www.edm2.com/index.php/Common_REXX_Pitfalls

Revision as of 23:38, 26 April 2022

The plan with this page is to build a checklist for potential causes of bugs. I'm annoyed that I only started this 30 years after I started programming. Every time I solve a problem caused by a type of bug I will try to add it to this list so it doesn't get me so easily next time.

Checklist

Some questions to ask yourself when you're debugging a problem:

  • have you used an 'if' statement where you need a 'while', or vice versa?
  • have you made an assignment (=) instead of an expression (==)?
  • did you forget to call your parent's constructor?
  • did you pass a constant value instead of a constant name to e.g. defined()
  • have you changed a positional interface (function parameters in order) without updating callers? positional interfaces are typically used in DAL add() and set() functions. as a general rule you should only add parameters and never change their order.

Reference