From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11721 invoked by alias); 29 Jul 2008 19:45:58 -0000 Received: (qmail 11708 invoked by uid 22791); 29 Jul 2008 19:45:57 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 29 Jul 2008 19:45:39 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id m6TJjSsV004566; Tue, 29 Jul 2008 21:45:28 +0200 (CEST) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id m6TJjSUX022805; Tue, 29 Jul 2008 21:45:28 +0200 (CEST) Date: Tue, 29 Jul 2008 23:59:00 -0000 Message-Id: <200807291945.m6TJjSUX022805@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: cagney@gnu.org CC: mark.kettenis@xs4all.nl, stanshebs@earthlink.net, gdb@sourceware.org In-reply-to: <488F4AA7.7060001@gnu.org> (message from Andrew Cagney on Tue, 29 Jul 2008 12:51:51 -0400) Subject: Re: Move GDB to C++ ? References: <487658F7.1090508@earthlink.net> <200807101901.m6AJ1UMQ007185@brahms.sibelius.xs4all.nl> <488F4AA7.7060001@gnu.org> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-07/txt/msg00309.txt.bz2 > Date: Tue, 29 Jul 2008 12:51:51 -0400 > From: Andrew Cagney > > Mark Kettenis wrote: > >> Date: Thu, 10 Jul 2008 11:46:15 -0700 > >> From: Stan Shebs > >> > >> As many know, there is a project afoot to investigate the recoding of > >> GCC from C into C++. I believe the C++ idea was briefly touched on for > >> GDB at the summit, although I don't remember much discussion. Anyway, > >> this would be a good time to start thinking about it, and if people are > >> generally in favor of the idea, we can start small by tweaking the > >> sources to be C++-friendly, avoiding keywords and so forth; GCC has a > >> new warning flag -Wcxx-compat that can help. > >> > > > > I think this is an absolutely retarded idea. C++ is a horrible > > programming language. > > > Mark, > > I appreciate your pain here - as some would put it "C++ is the answer, > now what was the question? :-)" - and having considered this further, > wonder if both this thread and a proposed implementation as part of the > archer project are being too quick to put the C++ cart before the > architectural horse :-) > > Instead of changing GDB to C++ and hoping the change will magically > transform GDB's code base into a clean ideal design; should we instead > be focused on trying to address what I suspect is the underlying > motivation here - a desire to clean up and re-structure GDB's code base > so that it more clearly corresponds to a more modern Object Oriented design? > > If we consider this as an important goal, and find a way to more > smoothly facilitate this development (multi-arch, at 9 years, in my not > so humble opinion, was too slow) we'll be able to improve GDB's > internal architecture without using C++. Then, in time, with a clearer > O-O design, we can re-consider choices such as language. > > Thoughts? Andrew, I agree with much of what you're saying here. There are many areas in GDB that could use the attention of someone who can take astep back from it and see whether a subsystem can be transformed in something that's constructed in a simpler and more straightforward way. I don't believe for a moment that switching to C++ will help with that (let alone that switching to C++ will make this happen automagically). Virtually every C++ software project that I've seen in my life suffers from overdesign (useless abstraction layers, misapplied "design patterns", escalated generic programming). I stronly believe it is better to invest our time in cleaning up and extending the existing codebase instead of converting it to a new programming language. I really feel all these discussions about our toold (switching from cvs to svn or git, replacing C with C++, migrating our bugs from gnats to bugzilla) are a waste of time.