Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Fabian Cenedese <Cenedese@indel.ch>
To: gdb@sourceware.org
Subject: Re: GDB in C++
Date: Tue, 03 Jul 2007 07:03:00 -0000	[thread overview]
Message-ID: <5.2.0.9.1.20070703084716.01a5eec0@localhost> (raw)
In-Reply-To: <1183434783.4689c81fa4016@myaccount.bayarea.net>

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



  reply	other threads:[~2007-07-03  7:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-30 14:56 Michael Eager
2007-07-01 20:54 ` Daniel Jacobowitz
2007-07-02  1:33   ` Joel Brobecker
2007-07-03  3:49     ` Michael Eager
2007-07-03  7:55       ` Mark Kettenis
2007-07-11 21:04     ` Jan Kratochvil
2007-07-02  7:21   ` Mark Kettenis
2007-07-03  3:57     ` Michael Eager
2007-07-03  7:03       ` Fabian Cenedese [this message]
2007-07-03 12:14         ` Robert Dewar
2007-07-03 19:09           ` Gary Funck
2007-07-11 19:47             ` Thiago Jung Bauermann
2007-07-11 19:59               ` Paul Koning
2007-07-11 20:41                 ` Jim Blandy
2007-07-11 21:00                   ` Gary Funck
2007-07-11 21:32                   ` Daniel Jacobowitz
2007-07-11 21:38                     ` Robert Dewar
2007-07-12  3:16                     ` Eli Zaretskii
2007-07-12  2:24               ` Michael Eager
2007-07-13 20:21                 ` Thiago Jung Bauermann
2007-07-13 20:55                   ` Eli Zaretskii
2007-07-13 21:24                     ` Thiago Jung Bauermann
2007-07-12  3:11               ` Eli Zaretskii
2007-07-11 21:11           ` Gary Funck
2007-07-02 20:21   ` David Daney
2007-07-02 20:28     ` Daniel Jacobowitz

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=5.2.0.9.1.20070703084716.01a5eec0@localhost \
    --to=cenedese@indel.ch \
    --cc=gdb@sourceware.org \
    /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