[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking?
From: |
Markus Wanner |
Subject: |
Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking? |
Date: |
Sun, 04 Jan 2009 18:41:21 +0100 |
User-agent: |
Mozilla-Thunderbird 2.0.0.19 (X11/20090103) |
Hi,
Timothy Brownawell wrote:
> "N(false, message)" results in "throw informative_faulure(message)", the
> question is what to throw rather than whether to throw.
I'm with Timothy on that. These states are exceptional enough and much
simpler to code. While "control loops" (why a loop, simple conditions
would do, no?) clutter .. ehm.. exception handling a lot.
> A command that does "throw usage()" gives the same result as calling
> "mtn help <command>", printing full usage info to stderr, where N()
> results in "mtn: misuse: <message>" on stderr and will put a note in any
> debug log.
As long as the <message> is maintained in case of "throw usage()", I'm
fine. I dislike tools which just throw the complete usage page at me and
let me figure myself. Some hint on what's wrong certainly helps. And
that hint should survive, IMO.
Regards
Markus Wanner