Update
This commit is contained in:
parent
73fc5424ca
commit
c76830be56
13 changed files with 1798 additions and 1788 deletions
|
@ -79,6 +79,10 @@ ass(abs(playerPos.x) <= WORLD_BOUND && abs(playerPos.y) <= WORLD_BOUND,"player p
|
|||
|
||||
Here if you don't define the `DEBUG` macro, the assert macro will just be an empty command that does nothing.
|
||||
|
||||
### Finding The Breaking Change (Regression)
|
||||
|
||||
If something that used to work stops working, it's a **[regression](regression.md)**. Here the first step towards fixing it is finding which exact change to the program broke it, i.e. find the last software version before the bug that didn't have the bug -- for this version control systems like [git](git.md) are very cool as they allows you to switch between different commits. In this search apply the binary search principle again (just like you search a word in a dictionary, i.e. keep checking the middle commit and move either before or after it depending on whether it already has the bug or not). Once you find the offending commit it's usually easy to spot the bug, you just have a relatively small amount of code in the commit which you can keep checking by parts if it's not immediately obvious (i.e. try to recreate the commit part by part and see when exactly it breaks, this moves you yet closer to the bug).
|
||||
|
||||
### Debuggers And Other Debugging Tools Like Profilers
|
||||
|
||||
There exist many software tools specialized for just helping with debugging (there are even physical hardware debuggers etc.), they are either separate software (good) or integrated as part of some development environment (bad by [Unix philosophy](unix_philosophy.md)) such as an [IDE](ide.md), web browser etc. Nowadays a compiler itself will typically do some basic checks and give you warning about many things, but oftentimes you have to turn them on (check man pages of your compiler).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue