From: Doug Evans <dje@google.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Tom Tromey <tromey@redhat.com>, gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [patchv3 1/5] Mostly code cleanup: Constification
Date: Tue, 17 Sep 2013 19:50:00 -0000 [thread overview]
Message-ID: <CADPb22T+JJwk37YTjBBvsd81TbUTSnyoxdrSO5PrxFK9qCffqA@mail.gmail.com> (raw)
In-Reply-To: <20130917193713.GA26005@host2.jankratochvil.net>
On Tue, Sep 17, 2013 at 12:37 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Tue, 17 Sep 2013 21:32:48 +0200, Tom Tromey wrote:
>> >>>>> "Doug" == Doug Evans <dje@google.com> writes:
>>
>> Doug> What's wrong with utility wrappers?
>>
>> In the general case they require the introduction of a new function, a
>> new type, and marshalling and unmarshalling code. This is verbose and
>> error prone.
>>
>> I suppose catch_command_errors* aren't quite so bad.
They're rather trivial, and abandoning them is isomorphic (IMO) to
asking people to instead duplicate their contents. Sounds like the
definition of a good wrapper, or any utility function really.
[There is a discussion to be had about print_any_exception, but that's
just cleanup ...]
> * catch_command_errors* use non-public function print_any_exception() with
> unclear differences from the public function exception_print().
Plus I saw a call to target_terminal_ours. Not sure it's present on
all code paths.
> * The body of catch_command_errors* is several lines of code which is rather
> questionable whether it is worth wrapping in a function.
A better measure is how many lines of code is there to use it versus not use it?
[Plus, all else being equal, wouldn't the larger the amount of code
that can be replaced with a subroutine call improve the worthiness of
creating a utility function?]
next prev parent reply other threads:[~2013-09-17 19:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-15 19:37 Jan Kratochvil
2013-09-16 22:22 ` Doug Evans
2013-09-17 6:48 ` Jan Kratochvil
2013-09-17 18:39 ` Tom Tromey
2013-09-17 19:24 ` Doug Evans
2013-09-17 19:32 ` Tom Tromey
2013-09-17 19:37 ` Jan Kratochvil
2013-09-17 19:50 ` Doug Evans [this message]
2013-09-18 13:45 ` Joel Brobecker
2013-09-18 14:08 ` Jan Kratochvil
2013-09-18 17:10 ` Doug Evans
2013-09-19 12:45 ` [commit] " Jan Kratochvil
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=CADPb22T+JJwk37YTjBBvsd81TbUTSnyoxdrSO5PrxFK9qCffqA@mail.gmail.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=tromey@redhat.com \
/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