On 3 July 2011 11:26, Mark Engelberg <[email protected]> wrote:

>  But Clojure's
> lack of a "fail-fast" philosophy has burned me several times, with
> hard-to-track-down bugs that were far-removed from the actual cause.
> The larger my code grows, the more this annoys me, reminding me too
> much of my days tracking down bugs in imperative programs.
>
>
I wonder if many people use the pre and post assertions when coding Clojure?
 Assertions (& pre/post-conditions) seem to have lost favour as a go-to tool
for programmers.  Most coders instead seem to go for unit testing
exclusively.  It seems to me that assertions could provide a lot benefit in
dynamic programs as a way to fail-fast and as a way to document intention.
In my limited experiments with them I've found them to be helpful.  I do
wish Clojure would give greater detail as to what went wrong when an
assertion fails though.  See Groovy's assert statement for an example of a
very helpful error report [1].

[1]
http://dontmindthelanguage.wordpress.com/2009/12/11/groovy-1-7-power-assert/

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to