This is the mail archive of the gdb@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: GDB in C++


At 20:53 02.07.2007 -0700, Michael Eager wrote:
>Quoting Mark Kettenis <mark.kettenis@xs4all.nl>:
>> > From: Daniel Jacobowitz <drow@false.org>
>
>> > I'm in favor of switching to C++.  I'm not going to argue about it if
>> > others disagree, but I'll offer to do most of the work if the
>> > consensus is positive.
>>
>> My position on this subject has not been changed.  The more C++ code I
>> see, the more convinced I get that the language should die.
>
>I, too, have worked on convoluted and poorly written C++ programs.
>That's partially poor programming practices, rather than the language.
>Trying to use every feature in the language is not a good plan.
>
>The features which recommend C++ are classes and the encapsulation
>and data hiding which it offers.  Along with this comes inlining
>and error checking.  A limited use of inheritance is useful.
>
>Features which I would avoid are templates, overloading, and the STL.
>
>I think that implementing the parts of GDB which attempt to emulate
>classes in C++ would have benefits in clarity and performance.

I'm not a gdb-developer, so I don't have a vote on this, I just speak as
an outsider. I occasionally look into the gdb sources when I'm trying
to find an error (of course mostly in my code :) I find the gdb source
code very difficult to understand with function pointers, that look
like C++ member functions (as described), the overuse of macros
(e.g. to access structure members or to create function names),
the cleanup mechanism and some other things I haven't understood
yet. I know that gdb has grown over years and part of this comes
from the versatility of hosts and targets it needs to work with. But
still most C++ code I looked at or wrote myself is far easier to
understand if templates and STL are left aside.

>Trying to use every feature in the language is not a good plan.

This is valid for both C++ and C.

Sorry for my mumbling, going back to where I came from...

bye  Fabi



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