From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH kvm-unit-tests 2/4] Introduce a C++ wrapper for the kvm APIs Date: Wed, 24 Nov 2010 19:36:46 +0200 Message-ID: <20101124173646.GJ20014@redhat.com> References: <20101124154006.GE15111@redhat.com> <4CED344B.3030000@codemonkey.ws> <4CED3FE6.50900@redhat.com> <4CED41A0.8060003@redhat.com> <4CED4276.9090103@redhat.com> <4CED445E.30105@redhat.com> <4CED4629.2060804@redhat.com> <4CED4738.2020406@redhat.com> <4CED488D.40806@redhat.com> <4CED4A74.80706@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jes Sorensen , Anthony Liguori , Alexander Graf , Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:31592 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753997Ab0KXRgu (ORCPT ); Wed, 24 Nov 2010 12:36:50 -0500 Content-Disposition: inline In-Reply-To: <4CED4A74.80706@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Nov 24, 2010 at 07:25:08PM +0200, Avi Kivity wrote: > On 11/24/2010 07:17 PM, Jes Sorensen wrote: > >> > >> Anyone wishing to implement this interface is forced to implement read > >> and write methods (callbacks) with exactly the right signature. The > >> compiler will complain if they don't. So if File is a good interface, > >> we can make the compiler force people to use it correctly. > >> > >> We can emulate this in C with ->ops-> things, but that's just > >> boilerplate and more places for people to get things wrong, or lazy and > >> take shortcuts. > > > >In the mean time we spend our time debugging the runtime because the > >virtual functions don't behave as expected. In C we know what is going > >on, in C++ it is pray and hope. > > That is pure bullshit. All major browsers are written in C++, all > major office suites, one leading free desktop, google, countless > other projects. There is a lot more C++ code in the world than C > code. If virtual functions didn't behave as expected, surely we'd > hear by now. > Google don't use exceptions though :) They claim it is hard to integrate with legacy code if exceptions are used. Our case BTW. -- Gleb.