Hacker News Comments on
Debugging with the Scientific Method - Stuart Halloway
ClojureTV
·
Youtube
·
3
HN points
·
3
HN comments
- This course is unranked · view top recommended courses
Hacker News Stories and Comments
All the comments and stories posted to Hacker News that reference this video.This talk, "Debugging with the Scientific Method" changed how I debug problems. I try to watch it once every year or two.tl;dr, when debugging people naturally form a hypothesis about what is going wrong and then set about gathering evidence to support or refute that hypothesis. When you do so unconciously you are very prone to biases of all sorts, most importantly confirmation bias.
When you do so mindfully, and Write It All Down then you are much more likely to a) come up with an evidence gathering exercise which will usefully falsify your hypothesis, and b) respect the gathered evidence, reject the now false hypothesis, and move on to a new one.
⬐ tootieOne thing I have learned is to never say "This should work". If it doesn't work it shouldn't work.⬐ seanc⬐ snarfyFor sure! My least favourite type of bug is the converse though. "How is this possibly working?"When you're pulling on a thread and come across a function that looks completely broken and yet somehow is not.
The biases are probably the biggest road block. You make an assumption of what is wrong and start looking in the relevant code. There thousands of if statements that all start somewhere at the top ,creating a big fork. It's easy to get stuck when you are looking on the right side when the issue is on the left. Always understand that your assumptions can be wrong.
Stuart Halloway from the Clojure community has some great a talks using the REPL to debug.Links:
Debugging with the Scientific Method - Stuart Halloway (https://www.youtube.com/watch?v=FihU5JxmnBg)
REPL DEBUGGING: NO STACKTRACE REQUIRED (http://blog.cognitect.com/blog/2017/6/5/repl-debugging-no-st...)
scope-capture (https://github.com/vvvvalvalval/scope-capture)
I think your criticisms are definitely valid.The learning curve is steep (intentionally so) but definitely worth it. Your programs will become more reliable and you'll get more done as a consequence. Please push through!
The error messages are terrible, and there are a lot of ongoing conversations about them at the moment in the Clojure community[1]. The Clojure[script] toolchain does tend to be all-in but there's work happening now to break that up — stay tuned. StackOverflow and the Clojure Slack channel also full of people who know how to fix issues :)
Stick with it, when you'll have an "ah-ha!" moment soon enough!
[1]: This talk is a good backstory as to why the errors are so bad, and useful no matter what language you use https://www.youtube.com/watch?v=FihU5JxmnBg