# How do you use debuggers?

**URL:** <https://discourse.julialang.org/t/how-do-you-use-debuggers/4580>\
**Category:** Community\
**Created:** [July 1, 2017, 6:41am UTC](https://discourse.julialang.org/t/how-do-you-use-debuggers/4580 "2017-07-01T06:41:52Z")\
**Posts on this page:** 1\
**Showing post:** 44

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [July 5, 2017, 4:48am UTC](https://discourse.julialang.org/t/how-do-you-use-debuggers/4580/44 "2017-07-05T04:48:58Z")

</div>

> [@kevbonham](#):
>
> @juliohm it seems you misunderstand me, or you misunderstand the sort of work that many biologists do. If one wants to calculate the mean of 5 numbers, it is not necessary to provide the code that was used to make the calculation reproducible. One can simply say they took the sum of the numbers and divided it by 5. Sure, if no mean () function existed, it might be nice to provide that for the community, and many scientists are in the business of writing tools.
> 
> But a lot of data processing work is idiosyncratic, and spending the time to write a well-tested suit of functions that no one else will ever use is a waste of time. Better to describe the analysis and let someone implement it the way that makes sense to them.

How do I know you didn’t miss any details? Trust you, because you’re an authority in the subject? You already typed everything down into the REPL, so copy pasting that into a script and putting a test on the end to make sure it actually outputs the result you think it does takes less than a minute. I don’t understand why someone wouldn’t want to make it easy for someone else to run their exact computational analyses to make it easy to reproduce every figure with 1 button and enough computing resources.

(I really applaud Fernando Perez was mentioning about the new tools to accommodate reproducible science and make this easier, [https://www.youtube.com/watch?v=DUdE3M2nlDE&t=1s](https://www.youtube.com/watch?v=DUdE3M2nlDE&t=1s) . I hope this becomes required.)

Linking back to the original purpose of this thread, test suite are the best debugger because humans are infallible and get things wrong. Tests get corrected and refined over time. Other people check them, ask questions, and make sure try to re-understand them (maybe you in the future!). What you type into the REPL is something you did once, and sometimes your recall of it is wrong. We’ve all typed things into the REPL and been like “huh? Oh… I renamed …” or something silly like that, because we are all fallible. We all write bad code, and we all write code incorrectly. Tests are a clear statement of what you’re looking at, and it allows others (or you in the future) to double check no only that you’re looking at the right thing, but also that you’re looking for the right thing. Hell, one instance of this was already documented earlier today:

> [@Bigfloat lufact](https://discourse.julialang.org/t/bigfloat-lufact/4653/3):
>
> I pulled an example out. In this case, it looks like lufact! is the only one correct on BigFloat: A = 92.317\*eye(4) b = [0.0970454, 0.00944241, 0.167562, 0.08518] println("True solution") println(b/92.317) lufact!(A) println("lufact") println(A\b) A = 92.317\*eye(4) qrfact!(A) println("qrfact") println(A\b) A = 92.317\*eye(4) svdfact!(A) println("svdfact") println(A\b) Abig = big.(A) bbig = big.(b) lufact!(Abig) println("lufact bigfloat") println(Float64.(Abig\bbig)) Abig = big.(A) qrfac…

What I was throwing into the REPL was wrong because I’m silly and fallible, but my tests still led me to the right spot and uncovered a Base bug.

The only reason to have complete trust in what you do interactively is if you never make mistakes, but if that’s the case, why would you need a debugger?

---

_[View the full topic](https://discourse.julialang.org/t/how-do-you-use-debuggers/4580)._
