From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7087 invoked by alias); 5 Apr 2012 11:46:36 -0000 Received: (qmail 7078 invoked by uid 22791); 5 Apr 2012 11:46:35 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Apr 2012 11:46:14 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q35BkEKB011098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 5 Apr 2012 07:46:14 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q35BkC03009349; Thu, 5 Apr 2012 07:46:13 -0400 Message-ID: <4F7D8603.90801@redhat.com> Date: Thu, 05 Apr 2012 11:46:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: mark.kettenis@xs4all.nl CC: gdb@sourceware.org Subject: Re: Will therefore GDB utilize C++ or not? References: <20120330161403.GA17891@host2.jankratochvil.net> <87aa2rjkb8.fsf@fleche.redhat.com> <201204042155.q34LtJNB013402@glazunov.sibelius.xs4all.nl> In-Reply-To: <201204042155.q34LtJNB013402@glazunov.sibelius.xs4all.nl> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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: 2012-04/txt/msg00049.txt.bz2 On 04/04/2012 10:55 PM, Mark Kettenis wrote: >> From: Tom Tromey >> Date: Wed, 04 Apr 2012 14:47:39 -0600 >> >>>>>>> "Jan" == Jan Kratochvil writes: >> >> Jan> To C++ or not to C++? Unfortunately the discussion was here >> Jan> already before and I am aware several contributors are not welcome >> Jan> with it, I think it does not need to affect readability of C code >> Jan> much, there is not enough workforce to rewrite all the GDB code >> Jan> into C++ style anyway. Still C++ would help a lot, some kinds of >> Jan> bugs are not solvable without it. >> >> I'm strongly in favor of C++ for reasons I'll lay out below. > > And my position on this has not changed: I'm strongly against. C++ is > horrible language that should never have been invented. Beyond the obvious question of "why is it a horrible language", I'd like to ask you to consider another approach. Is it because of some horribly obfuscated C++ code out there you may have witnessed? You know the type, takes take the OOP concept and batters it to atoms? Useless implementation of esoteric template designs, not because it is needed, but because it was cool? There is a lot of C++ code that I do not like, but there is also a lot of C code that sucks too. I've written some. We all have, at some point. There is some in GDB. My belief is that you can write clear, concise, efficient code in any language; similarly, you can write complete rubbish in any language too. C++ debates seem to be a fertile garden for this kind of discussion, but, eventually, I recognized I was criticizing the implementer/implementation of the project, not the language itself. So focusing on the language, and not any previous implementations one might have witnessed, what is acceptable? My approach to the discussion is C++ is OK, as in a "C with objects" approach. That may be too far for you, and not far enough for others. But it is a point to defend and/or compromise on. Personally, I don't think GDB is going to go crazy with variadic templates, or other concepts I am not totally keen on. And, I think, maintainers need a balance of skeptics and champions, to balance this out. Every line of code that goes into GDB is subject to review -- even by global maintainers themselves. That's why this discussion is not opening the flood-gates, but creaking them open a little. Say this discussion results in C++ being acceptable. Every patch still has to be posted, reviewed and (if not a maintainer) approved. There are safeties at every turn. So, please, if you can write a concise argument, I for one would like to read it. Balance is good, but arguments that we cannot challenge, or defend just lead us to a dead-end. Cheers, Phil