Skip to content
0:00 / 0:00

#clojure#debugging#scientificmethod

Debugging with the Scientific Method - Stuart Halloway

ClojureTV

111K subscribers • 159 videos on Hallway

YouTube
  • Recommended by 5 people: 4 on Hacker News and 1 curated list.
  • A classic. People kept recommending it from 2015 to 2023.
  • Presented by Stuart Halloway, co-founder of Cognitect
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

25K views10 years ago5 recommendations

Tools and practiceSoftware designDebuggingTestingFunctional programming

Stuart Halloway explains how to apply the scientific method to debugging by forming hypotheses, trying to falsify them, and keeping careful records.

About the speaker: Stuart Halloway (@stuarthalloway) is a founder and President of Cognitect (formerly Relevance). He is a Clojure committer, and a developer of the Datomic database. Stuart has spoken at a variety of industry events, including Strange Loop, Clojure/conj, EuroClojure, ClojureWest, SpeakerConf, QCon, GOTO, OSCON, RailsConf, RubyConf, JavaOne, and NFJS. Stuart has written a number of books and technical articles. Of these, he is most proud of Programming Clojure.

Why it's here

5 people recommend this

What people say. Highly recommended as a transformative talk on debugging mindfully to avoid confirmation bias and other cognitive traps.

seancon Hacker News • Recommends

On “Ask HN: How do you get better at debugging/finding a solution?”

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. link to this video

programming-talkscurated list on GitHubRecommends

Under “Debugging”

Debugging with the Scientific Method 00:49:08 by **Stuart Halloway** (2015)

chrislloydon Hacker News • Recommends

On “Metabase: Why we picked Clojure”

…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 link to this video…

griersonon Hacker News • Recommends

On “REPL + Debugger = REPLugger: a pleasant and scalable live code editor”

Stuart Halloway from the Clojure community has some great a talks using the REPL to debug. Links: Debugging with the Scientific Method - Stuart Halloway ( link to this video ) REPL DEBUGGING: NO STACKTRACE REQUIRED ( link ) scope-capture ( link )

simon_accaon Hacker News • Recommends

On “Rich Hickey: Design in Practice”

Stu Halloway (also a member of the Clojure core team) has a couple of great talks on using the scientific method in programming: link to this video link

u/halgariin r/Clojure • Mentions

On “New Clojurians: Ask Anything”

…flat, or at least properly designed ones are. You don't often have business logic running dozens of functions deep, instead you call into one function and then take the result and pass it into another. This means if you have something like the REPL you can test these steps interactively and mechanically. This is a fantastic talk on the subject: link to this video But that's the gist...data + a REPL makes debuggers not as needed.…

u/ArjaSpellanin r/Clojure • Mentions

On “Are these problems something that Just Make Sense once I learn more, or what?”

Regarding the error messages: there is a great talk by Stuart Halloway where he explains the logic behind the poor error messages (spoiler: error messages are accidental) link to this video

u/halgariin r/Clojure • Mentions

On “New Clojurians: Ask Anything”

Reasoning about the code is an important tool this concept is explored in this talk: link to this video But what I normally do is break the program down. If I run function A and it calls B and C, test B and C in the repl and see what breaks or doesn't. Now you've narrowed the problem down a bit. Also, very rarely write more than 10 lines of code without throwing them in the repl and testing them, so I often know that my bug is in the last 10 lines of code I wrote. Thirdly, I like to write tests, stuff like test.check (and spec) really help with this. I'm not saying test-first. But more that I use tests as a way to save my repl explorations. So I view tests as an automated way to poke at code from…

u/lambdacurryin r/Clojure • Mentions

On “How do I do breakpoints, step-by-step debugging, in Clojure, how do I profile, etc.?”

> these things are a must for serious work. (Debugger) I thought the same thing when moving from C# and Visual Studio, but this talk Debugging with the scientific method and reading “Why programs fail” helped change my perspective. A big learning step for me was watching David Nolan’s talk Idee Fixe which made me realise that I was allowing my previous fixed ideas of debugging C# to drive my thought process so I wasn’t leveraging the fact that Clojure is dynamic development enviroment.

u/JavaSuckin r/Clojure • Mentions

On “New Clojurians: Ask Anything”

> watching Stuart Halloway's Debugging using the scientific method and listening to Rich Hickey on the Case podcast Links for the lazy: * Debugging with the Scientific Method - Stuart Halloway * Problem Solving and Clojure 1.9 with Rich Hickey

u/elbowichin r/Clojure • Mentions

On “Do you feel "in the dark" when debugging Clojure?”

In case anyone missed it, this post was mentioned in this year's Clojure/conj talk: Stuart Halloway - Debugging with the Scientific Method

u/MattDarlingin r/Clojure • Mentions

On “FYI: ClojureTV updated their channel today with Clojure/conj 2015 videos.”

Debugging with the Scientific Method by Stuart Halloway is *excellent*, and has basically nothing to do with Clojure, so anyone can benefit from it. It's my favourite thing from the Conj so far. If I was only picking three, my next two would be: * Condition Systems in an Exceptional Language by Chris Houser: how do you get flexibility in both how your program responds to errors, and how you handle those errors? * Improving Clojure's Error Messages with Grammars by Colin Fleming: tangential to the use case of improving error messages, this provides examples of how complicated macros could be written with parsers, which would make me personally far more likely to write non-trivial…

u/lambdacurryin r/Clojure • Mentions

On “New Clojurians: Ask Anything”

> How do you cope with not having static types? I thought the same thing coming from C# but one thing to remember is > First and foremost, Clojure is dynamic. That means that a Clojure program is not just something you compile and run, but something with which you can interact. Clojure - Dynamic Nightcode is a great example of this. > After many years programming in Java I got used to only need very minimal debugging after writing my code, sometimes even getting it to work on the first try. 1. Just because it compiles it doesn't mean your program works, the compiler doesn't catch all errors otherwise try-catch blocks wouldn't exist. 2. ```int add (int x, int y)``` - ```add(2, 2) => 5```…

u/vlaaadin r/Clojure • Mentions

On “stuarthalloway/presentations — Aim Small, Miss Small: Writing Correct Programs”

Transcript link, talk link

u/maxw85in r/Clojure • Mentions

On “New Clojurians: Ask Anything - August 25, 2025”

This helps me a lot:  link to this video

u/lambdacurryin r/Clojure • Mentions

On “How much more productive are you with Clojure as compared to other languages?”

\> I've heard of things like macros in Clojure Clojurians usually say these phrases "First rule of macro club is don't write macros" and "Data > Function > Macro". \> how does the uniqueness of Lisp/Clojure speed up development time as compared to using another language All theses sources helped change my view of Clojure coming from a C# background. But mainly it's just focusing on "pulling things apart" and Clojure helps with doing that as it's dynamic and has tight integration with the REPL. (REPLDD) * Running with scissors * Debugging with the Scientific Method * The power of Clojure: Debugging