From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14316 invoked by alias); 10 Jul 2008 21:54:22 -0000 Received: (qmail 14304 invoked by uid 22791); 10 Jul 2008 21:54:21 -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; Thu, 10 Jul 2008 21:54:04 +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 m6ALrlNr025867; Thu, 10 Jul 2008 23:53:47 +0200 (CEST) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id m6ALrjjm017722; Thu, 10 Jul 2008 23:53:46 +0200 (CEST) Date: Thu, 10 Jul 2008 21:54:00 -0000 Message-Id: <200807102153.m6ALrjjm017722@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: stanshebs@earthlink.net CC: gdb@sourceware.org In-reply-to: <48766A88.1050402@earthlink.net> (message from Stan Shebs on Thu, 10 Jul 2008 13:01:12 -0700) Subject: Re: Move GDB to C++ ? References: <487658F7.1090508@earthlink.net> <200807101901.m6AJ1UMQ007185@brahms.sibelius.xs4all.nl> <48766A88.1050402@earthlink.net> 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/msg00094.txt.bz2 > Date: Thu, 10 Jul 2008 13:01:12 -0700 > From: Stan Shebs > > 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. > > > Okay... so, uh, since C++ is basically a superset of C, presumably the > horribleness you are thinking of relates to specific extensions. The > basic idea of classes? Templates? Overloading? Exception handling? We > would get to codify the set of C++ features that we will allow, > certainly I'd never want to allow in patches that used arcane features > of the language in twisted ways. Classes are mostly ok, but they tend to distract people in doing architectures, and stupid programming paradigms like setter/getter. Templates are absolutely horrible syntactically and make it almost impossible to debug your code. Function overloading is unecessary syntactic sugar that confuses compilers and humans alike. Exception handling is an excellent idea, but I've never seen it used properly in any non-trivial C++ code. The subset of C++ that I like is pretty much that what is called C. I don't think the benefits of using a few C++ outweighs the loss of the ability to compile GDB with a bog standard C compiler. I also don't really want to waste much time on discussing this topic. If people really want to waste their time on moving GDB to C++, I'll probably find mysef another project to spend my spare time on. Mark