<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On 06/09/2006, at 8:22 PM, Neil Mitchell wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">It's been my experience that debugging is a serious weakness of</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Haskell - where even the poor mans printf debugging changes the</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">semantics! And everyone comes up with arguments why there is no need</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">to debug a functional language - that sounds more like excuses about</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">why we can't build a good lazy debugger :)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">[Sorry for the slight rant, but I've used Visual Studio C++ so I know</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">what a good debugger looks like, and how indispensable they are]</DIV></BLOCKQUOTE></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I simply can't let this pass without comment.  It's irrelevant if you're using a functional or imperative language, debuggers are invariably a waste of time.  The only reason to use a debugger is because you need to inspect the contents of a processes address-space; so either you're using it as a disassembler, or you're using it to examine the consequences of heap/stack corruption.  Consequently, if you're using Java, C#, Scheme, Haskell, Erlang, Smalltalk, or any one of a myriad of languages that don't permit direct memory access, there's no reason for you to be using a debugger.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Jon understates it by implying this is a Functional/Haskell specific quality - it's not.  Debuggers stopped being useful the day we finally delegated pointer handling to the compiler/vm author and got on with writing code that actually solves real problems.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>It's just that historically functional programmers have tended to already be experienced programmers who realise this.  Why would they waste their time building a tool that no-one needs?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>It's a truism to say if your code doesn't work it's because you don't understand it; clearly if you did understand it, you wouldn't have included the bug that's causing you difficulty.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Therefore either</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>1) The code is poorly structured and you need to restructure it to better represent your understanding of the problem</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>or</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>2) Your understanding of the problem is flawed, so you need to sit back and reexamine your thinking on this problem in light of the counter-example you have found (the bug).</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Spending your time tracing through individual lines of code is counter-productive in both cases.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Andrae Muys</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>P.S. It is worth noting that I am here talking about the sort of debugger raised in the original post.  I am not talking about using a separate tool to extract a stracktrace from a core file in a C/C++ program or equivalent - I'm talking about runtime debugging with variable watches, breakpoints, and line-by-line stepping.</DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Andrae Muys</DIV><DIV><A href="mailto:andrae@netymon.com">andrae@netymon.com</A></DIV><DIV>Principal Kowari Consultant</DIV><DIV>Netymon Pty Ltd</DIV><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR></BODY></HTML>