On Thu, 2010-08-19 at 15:48 -0500, Bob Friesenhahn wrote:
> On Thu, 19 Aug 2010, Garrett D'Amore wrote:

> 
> Since 1996, all of my professional programming work (for products) has 
> been done in C++.  Most of my open source work has been done in C. 
> There should be little doubt that C++ is a much better 
> implementation/design language than C, however, it does suffer from 
> the interoperability concerns (and cross-compiler portability 
> concerns) that Garrett mentions.  I have not encountered issues with 
> excessive memory consumption or slow execution.

My most recent experience with excessive memory consumption came when
trying to take a certain chunk of C++ code from a third party vendor,
and insert it into a tiny kernel.  The code basically added encryption,
and should not have been huge.  But it doubled the memory footprint of
the project.  (The rest of the code was the Sun Ray firmware.)  It was
significantly challenging to prune enough space to make the code fit in
this embedded environment.  The problems largely come, I think, from the
standard C++ library.  I know that it is *possible* to write C++ code
that doesn't do this -- but then you're basically writing C code using
the C++ compiler. :-)

> 
> There are plenty of people who don't know how to program in C++ or 
> other object oriented languages.  Most of these people should not be 
> programming at all.

Yes.  The problem is that C++ makes it too easy, IMO, to write code that
is completely illegible even when they don't mean to.  C can do this to,
but at least for the most part the language is explicit.  Use the +
operator generally doesn't cause memory allocations to occur, for
example.

> 
> Zfs could have been implemented in C++, but it would not be as 
> friendly in a kernel which is already implemented in C.

Which includes all of the kernels which currently use it.

        -- Garrett


_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to