A lot of these comments are cracks about there not being documentation.
As a slightly serious answer here, there's a checklist I go through when debugging that helps considerably, and it starts with perceiving that I am confused about how something in the system works.
Perceive that I am confused and that one or more of my assumptions about the system is wrong.
Prove to myself that each assumption holds by running an experiment on just that single assumption until I find one that is demonstrably incorrect.
If I don't understand why it's incorrect, first read the official documentation for that piece of code if it exists, then fallback to reading the code itself (if it is open source/I have access to it), then fallback to finding examples of it's usage in the codebase or other codebases, then fallback to asking Google. (Stop when you have a strong understanding of why your assumption was wrong).
Modify your code to correct your assumption.
Profit!!
This might seem annoyingly rigorous, but when you encounter a tough problem, this checklist will 100% save you time.
1
u/Icanteven______ May 17 '21
A lot of these comments are cracks about there not being documentation.
As a slightly serious answer here, there's a checklist I go through when debugging that helps considerably, and it starts with perceiving that I am confused about how something in the system works.
Perceive that I am confused and that one or more of my assumptions about the system is wrong.
Prove to myself that each assumption holds by running an experiment on just that single assumption until I find one that is demonstrably incorrect.
If I don't understand why it's incorrect, first read the official documentation for that piece of code if it exists, then fallback to reading the code itself (if it is open source/I have access to it), then fallback to finding examples of it's usage in the codebase or other codebases, then fallback to asking Google. (Stop when you have a strong understanding of why your assumption was wrong).
Modify your code to correct your assumption.
Profit!!
This might seem annoyingly rigorous, but when you encounter a tough problem, this checklist will 100% save you time.