This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] A new command 'explore'


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]