caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Ivan Gotovchits <ivg@ieee.org>
Cc: John Whitington <john@coherentgraphics.co.uk>,
	"caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] Do you use a debugger with OCaml? If not, why not?
Date: Wed, 25 Nov 2015 16:27:44 +0100	[thread overview]
Message-ID: <1448465264.23576.11.camel@e130.lan.sumadev.de> (raw)
In-Reply-To: <CALdWJ+zPC94SQjf8jdCOkUTgmhjGyQ9n8rXCPawcmVOQofP1WA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1733 bytes --]

Am Mittwoch, den 25.11.2015, 08:23 -0500 schrieb Ivan Gotovchits:
> The use of a debugger usually indicates that a programmer lost a
> control of its own program and has no idea whats going on. 
> If a programmer doesn't own a program, and tries to understand
> existing program, written by someone else, then it means to me, 
> that the program is written so poorly, that it is too hard to recover
> its semantics by reading its source code representation.

That's a little bit too hard. Actually, I like one aspect of the
debugger, namely that you can easily print deeply nested values. This is
also very helpful for exploring a well-written existing program. (And it
would even be more helpful if the debugger could look through
abstractions.)

Actually, I recently used that for writing unit tests for a complex
algebraic transformation (developed by myself). Just create some input
for the transformation, run it, fire up the debugger, and stop the test
at the point where the transformation call returns. Then check whether
you like the result by printing it in the debugger, and if so, develop a
check that matches against the expected pattern. (You could also do this
with the toploop, but using the debugger is easier when you have a
closed executable.)

That said, I also prefer the printf method for debugging program flow
issues.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
My OCaml site:          http://www.camlcity.org
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
------------------------------------------------------------


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-11-25 15:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 12:49 John Whitington
2015-11-25 13:12 ` Francois Berenger
2015-11-25 13:23 ` Ivan Gotovchits
2015-11-25 15:27   ` Gerd Stolpmann [this message]
2015-11-25 16:04     ` Chan Ngo
2015-11-25 13:26 ` Matthieu Dubuget
2015-12-01 12:06   ` Matthieu Dubuget
2015-11-25 14:02 ` Markus Weißmann
2015-11-25 14:05 ` Nils Becker
2015-11-25 15:55 ` Daniel Bünzli
2015-11-26  9:14   ` Leonardo Laguna Ruiz
2015-11-26 10:59     ` Tom Ridge
2015-11-30 17:56       ` Xavier Van de Woestyne
2015-11-25 16:06 ` Maverick Woo
2015-11-25 16:16 ` Anton Bachin
2015-11-25 16:52   ` Michael Grünewald
2015-11-25 18:23     ` Török Edwin
2015-11-25 20:23 ` David MENTRÉ
2015-11-26 10:11 ` Malcolm Matalka
2015-11-26 10:57 ` Romain Bardou
2015-12-11 18:58 ` Richard W.M. Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448465264.23576.11.camel@e130.lan.sumadev.de \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=ivg@ieee.org \
    --cc=john@coherentgraphics.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).