practicalli / blog-cryogen

Cryogen powered blog with all the content used to generate the static website.
https://practical.li/blog-cryogen/
3 stars 2 forks source link

Debug Clojure #132

Open practicalli-johnny opened 2 years ago

practicalli-johnny commented 2 years ago

Developer workflow and tooling available for debugging Clojure

Using the scientific method

Stuart Halloway talks about adopting a scientific mindset when debugging. Thinking in this way has absolutely changed the way I now approach debugging. Debugging is such a core skill in software development, but how many developers would rate themselves to be truly great at debugging? Not me yet, but after watching that video I’ve picked up two books: Debugging and Why Programs Fail to learn more and hone this skill. You can see the slides and related resources at Stuart’s wiki page.

All developers have to debug their code at some point. But there are particular practices that, when used, can make debugging significantly easier, faster, and most efficient. One overall perspective that can help is that of the scientific method. In this talk, Stuart Halloway describes how he approaches debugging using a scientific approach, and how doing so makes debugging less of a depressing and tedious chore, and more one that helps to move a project forward and provide the developer with greater understanding. His examples all employ the Clojure language, but the lessons learned can be generalized to many languages.

Summary of recommendations “Debugging is deductive”

Specific recommendations:

Don’t use C.
The failure is not the defect.
It’s always GC.
RTEFM (read the entire fracking manual)
Everybody lies (gives imperfect initial information)
Debugging is fundamentally a search operation (git bisect) – try to automate that?

Read "Why Programs Fail" book

Resources