public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>, gdb@sourceware.org
Subject: Re: gdbtypes.h #defined field accessors
Date: Mon, 28 Jun 2010 20:57:00 -0000	[thread overview]
Message-ID: <20100628205701.GC2700@adacore.com> (raw)
In-Reply-To: <m3oceux59g.fsf@fleche.redhat.com>

> In new code I don't generally write accessors.

I don't know if this is relevant to this particular discussion, but
I tend to like opaque structures and accessors (setter/getter) functions,
and I try to use that when writing new code.  The idea is that it's just
very easy to figure out who's reading the data, and who's modifying it.
Sometimes, it's the only way to go, because the data structures are
complex enough that we shouldn't expose their contents, but even for
simple data structures, this can be handy.

-- 
Joel

  reply	other threads:[~2010-06-28 20:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-24 19:57 Jan Kratochvil
2010-06-28 20:37 ` Tom Tromey
2010-06-28 20:57   ` Joel Brobecker [this message]
2010-06-30 21:51     ` Tom Tromey
2010-06-29 23:15   ` 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=20100628205701.GC2700@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).