From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25914 invoked by alias); 30 Jul 2008 18:30:43 -0000 Received: (qmail 25892 invoked by uid 22791); 30 Jul 2008 18:30:41 -0000 X-Spam-Check-By: sourceware.org Received: from mtaout1.012.net.il (HELO mtaout1.012.net.il) (84.95.2.1) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 30 Jul 2008 18:30:21 +0000 Received: from HOME-C4E4A596F7 ([84.229.228.238]) by i-mtaout1.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0K4U00IVF0QQUM60@i-mtaout1.012.net.il> for gdb@sources.redhat.com; Wed, 30 Jul 2008 21:30:27 +0300 (IDT) Date: Wed, 30 Jul 2008 18:45:00 -0000 From: Eli Zaretskii Subject: Re: Move GDB to C++ ? In-reply-to: X-012-Sender: halo1@inter.net.il To: Vladimir Prus Cc: gdb@sources.redhat.com Reply-to: Eli Zaretskii Message-id: References: <487658F7.1090508@earthlink.net> <200807101901.m6AJ1UMQ007185@brahms.sibelius.xs4all.nl> <488F4AA7.7060001@gnu.org> 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: 2008-07/txt/msg00331.txt.bz2 > From: Vladimir Prus > Date: Wed, 30 Jul 2008 11:18:09 +0400 > > > Unless we can answer this question, refactoring and rewriting is > > simply waste of resources, nothing less, nothing more. > > And here, you also surely know what is generally goal of refactoring -- > to make code simpler and more amendable for future change. No, refactoring always has some specific goal. Only given a specific goal, can one weigh the alternatives -- one to keep existing design and code and change it, the other to refactor it and then extend the result. You need to have a clear goal so that you could balance advantages against disadvantages. Without a goal, all you have is disadvantages (the overhead and effort of refactoring), because advantages cannot be estimated without a specific goal in sight. How do you estimate an advantage of ``making code simpler and more amenable to change''? You can't. > I do think that struct value needs refactoring -- because I know > that adding new kind of value was a pain in current codebase. But if we won't add another kind in 10 years, maybe that's not a problem? And anyway, can you present a convincing case for refactoring struct value, one that shows the details of adding a new kind each way? > I do think that target stack needs cleanup, because we ran in some > inconveniences during non-stop work, and because multi-process work > will have to change it seriously. Again, please be specific: show me how doing this in C++ would be much better than in C. > Those areas do need to be refactored to be hackable-on, and such refactoring > better make use of a language suited for OOP -- which those areas try to > approximate using C, now. Sorry, this is circular reasoning. I'm hacking GDB since 1999 (although not as much as I would like to), and I never had any special need for OOP. Not even when I introduced cross-platform code such as x86 watchpoint support. It will take more than just general hand-waving to convince me.