[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: "dselect" replacement team

On Fri, 11 Apr 1997, David Frey wrote:

> On Fri, Apr 11 1997 12:14 +0200 Wichert Akkerman writes:
> > This should start with a C-library and could later be extended with a
> > C++-wrapper.

> I agree. IMO a C++-library for dpkg is unecessary, a C-one is enough
> (is there anything in it where C++ features would be needed???)

I recommend the use of C++ simply because it would result in a much
cleaner client side implementation, a reduced function C translation
library could be added at some later date if it is really needed, in truth
traditional C programers can realtively easially make use of a C++ class
library without a very big learning curve.

As an example, an attractive reason is G Lib++'s bstring class, a
reference counted string. Using a class like this and carefully parseing
the status/avil files could easially cut memory use in half. Doing
something similar in C is.. Unpleasant. 

Of course I'd much rather write Object Oriented C++ with clear evidence of
communication and control than write Object Oriented C with nothing but
comments to act as a guide. (I've long since given up on procedural C)

There is only one compelling reason to ever choose C, and this is if you
do not know C++, or the people who are going to be using your code do not
understand enough C++ to make sense of it. dpkg-lib is going to be simple
enough C++ that nothing complex like virtual functions, iheritance and
whatnot will be a major issue.


Reply to: