Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Siva Chandra <sivachandra@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] A new command 'explore'
Date: Thu, 22 Dec 2011 12:53:00 -0000	[thread overview]
Message-ID: <20111222114821.GT23376@adacore.com> (raw)
In-Reply-To: <CAGyQ6gwUMwAEiKuTZ85jhTqMjJ6nnt9e+6M_4zj2OakU=usAtA@mail.gmail.com>

> I did have inheritance in my first implementation. But soon realized
> that I am essentially implementing stateless functions. Hence, I
> removed the inheritance, kept the classes, and made the functions
> static (to imply that they are stateless). In fact, we need not have
> the classes as well. Like you have noted in your penultimate sentence
> above, this is really not an API for others to use. So, isn't an
> abstract base class and inheritance an overkill for a Python
> implementation here?

It might be overkill indeed, but I find that this is the natural way
to implement in Python. You may be right in your observation about
stateless functions, but it seems to me that the net effect of this
design change is that it made the code more difficult to approach
and thus maintain.  For instance, you have to infer that all the classes,
which from a programatic point of view are indepdent, actually all need
to implement a given interface (which one and the semantics of that
interface are not documented either). That's where abstract classes
and inheritance bring some value. In a way, this reminds me of the
discussions I was having with Ada newbies a long time ago, telling them
how they did C programing in Ada... It feels a little bit the same way
here.

Just my 2 cents, though. This is your code, it's self-contained and
it does the job, so I am OK with whatever you decide.

-- 
Joel


  reply	other threads:[~2011-12-22 11:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAGyQ6gyAwr2zuv3NYpdk09vPyYpuFkyiErEhw-vws-WfuLDxiw@mail.gmail.com>
2011-12-19 19:05 ` Siva Chandra
2011-12-21 19:36   ` Tom Tromey
2011-12-22 11:00     ` Siva Chandra
2011-12-22  5:21   ` Joel Brobecker
2011-12-22 11:48     ` Siva Chandra
2011-12-22 12:53       ` Joel Brobecker [this message]
2011-12-27  6:29   ` Siva Chandra
2012-02-08  9:34     ` Siva Chandra
2012-02-17  7:40       ` Doug Evans
2012-02-17 10:00         ` Siva Chandra
2012-02-17 13:14           ` Phil Muldoon
2012-02-17 10:09         ` Siva Chandra

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=20111222114821.GT23376@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sivachandra@google.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