|
From: | Anthony Liguori |
Subject: | Re: [Qemu-ppc] [Qemu-devel] [PATCH 27/28] sysbus: apic: ioapic: convert to QEMU Object Model |
Date: | Wed, 25 Jan 2012 08:25:50 -0600 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15 |
On 01/25/2012 02:33 AM, Andreas Färber wrote:
Am 25.01.2012 00:03, schrieb Anthony Liguori:On 01/24/2012 04:06 PM, Jan Kiszka wrote:On 2012-01-24 22:53, Anthony Liguori wrote:But I don't like this. The problem is that the declarative syntax we have doesn't distinguish between "not-specified" and "zero-initialized".That's surely solvable.Please try :-) I've spent a good chunk of time mulling this over and could not find an acceptable solution. I think the same is true for the GObject folks. There is a declarative solution for this that I know of, a C++ class definition ;-)So what's the reason not to go with one of the object-oriented, C-compatible languages GCC supports, like C++ or Objective-C/C++? (Objective-C has native reflection capabilities fwiw.)
I actually prefer C++ but much in the same fashion that I prefer 8-space indenting.I think it's objectively better, but not significantly better enough to warrant the disruption of introducing it.
C++ makes polymorphism easier and declaring classes a little nicer, but it doesn't help significantly with factories, properties, or introspection.
Polymorphism in C is mostly a one-time cost so once you have the infrastructure (object.c), it's not really that bad.
Regards, Anthony Liguori
Personally I disliked those trivial mini init functions in the initial 2/4 series, too, but I don't really mind an imperative approach either. Andreas
[Prev in Thread] | Current Thread | [Next in Thread] |