Re: [GnomeMeeting-devel-list] Refactoring of the addressbook code



Éric Bischoff a écrit :
Le Jeudi 8 Juin 2006 05:08, Jan Schampera a écrit :
Indeed! Excepted that you are just using the possibilities of the
programming  language, not of some library.
Please note, regardless all other arguments, that an own C++-object
system will be totally independant of the used framework. In case we
leave GTK and GLib some day, the OOP approach won't need any changes.

The GObject approach would need either an equivalent in the new
framework, or a rewrite to (finally) OOP.

Yes. That was precisely my point.

Beside that, I tend to say "a matter of taste".

Yes. Sometimes programming has to do with aesthetics. Compare:

=== GObject way ===
struct _GmBook {
  GObject parent;
};

struct _GmBookClass {
  GObjectClass parent;

  const gchar *(*get_name)(GmBook *self);
};
==================

with:

=== C++ way ===
class GmBook {
  public:
    virtual get_name() const;
}
==================

My tastes tell me that second code, besides from being much shorter, has more "beauty" than the first one. But as you say, tastes are a very personal thing.

My experience is that when it comes to export the object on DBUS, you're better off with a gobject than with a C++ object. One has some introspection, the other doesn't.

I prefer working a little harder upfront, then have an easy life, than writing easy code then feel miserable :-)

Snark



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]