Sometimes it works though.. 😅 But it also makes it even more suspicious. 🥲
Sometimes it works though.. 😅 But it also makes it even more suspicious. 🥲
"Never allow the same bug to bite you twice."
- Steve Maguire
I must admit, whenever my code fixes itself, I start to worry even more.. Because now it's much harder to pinpoint where the pitfall of code is.. And it will FOR SURE bite me back soon.. 🥲
I have three simple tips:
📊 Use the profiler.
The profiler is your best bet in this case. Try to repro the steps and if it still appears to be 'fixed by itself', observe the profiler for disturbing patterns and spikes. For me personally this often works great to pinpoint the code to look at and look further in there for clues. Often I then find out it's a state or execution order based problem. Which I can then try to resolve.
If you aren't familiar or confident using the profiler. Try practicing with it more. 🙌
🎥 Video record the problem.
Whenever I have an issue that suddenly "fixed" itself, I record the same steps a few times to compare them. This really helps as you can sometimes see a difference in execution which helps you pinpoint the exact problem as well. 🙌
I personally always find it useful to see how it actually behaves and being able to move back and forth frame by frame to see it with my own eyes. 👀
⭕ Set breakpoints and print lines.
I always combine break points and print lines. First I use print lines to verify the execution and then I use breakpoints to verify the condition and state of each suspicious execution. 🙌
------
Last I like to mention that you should also be realistic about the impact of the issue anyway. If it's a low impact issue, than it's just a big W that it resolved itself. If it has a high impact or is a big risk, I recommend to get to the bottom of it. 🙌
Happy coding everyone! 👨💻
💡 Feel free to like, save and share this post!
~ Follow me for more @justinbieshaar
.
.
.
#coder #coding #gamedeveloper #developer #gamedev #learntocode #setup #csharp #computer #developerslife #windows #linux #programmer #programming #debug #100daysofcode #html5 #javascript #js #code #bugfix #setupinspiration #desktop #tech #indiedev #funny #wfh #sandwich #debugging
Comments
Comments from the original post on Instagram
No comments yet
