After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 530759 - update the gobject tutorial to the XXI century
update the gobject tutorial to the XXI century
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: docs
2.15.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-04-30 17:10 UTC by Emmanuele Bassi (:ebassi)
Modified: 2008-07-18 17:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] Fixes for the GObject tutorial (60.86 KB, patch)
2008-04-30 17:19 UTC, Emmanuele Bassi (:ebassi)
none Details | Review
[PATCH] Fixes for the GObject tutorial (96.78 KB, patch)
2008-04-30 20:07 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Emmanuele Bassi (:ebassi) 2008-04-30 17:10:11 UTC
the GObject tutorial is providing valuable information but using questionable examples that don't follow the 'best practises' approach that a tutorial should employ.

the most glaring are:
- lack of G_DEFINE_TYPE() usage
- poor description of the instance private data set up
- horrid dispose implementation
- lack of finalize example
- awful code style (should follow GObject and GTK+ for consistency)
- signal ids exposed in the class structure
  - and accessed using a costly GET_CLASS() lookup

the tutorial is also expressing personal thoughts that should not be imposed on the reader (the GObject initialization process *might* be complicated, but this is a tutorial inside the GObject documentation, so it's not good practise to say so to the user, especially since it cannot be changed).
Comment 1 Emmanuele Bassi (:ebassi) 2008-04-30 17:19:11 UTC
Created attachment 110172 [details] [review]
[PATCH] Fixes for the GObject tutorial

initial attempt at cleaning up the GObject tutorial.

the signals section is missing.

diffstat -w 74 /tmp/gobject-tutorial-fixes.patch 
 tut_gobject.xml |  310 ++++++++++++----------------
 tut_gsignal.xml |   44 +--
 tut_howto.xml   |  551 ++++++++++++++++++++++++++------------------------
 3 files changed, 455 insertions(+), 450 deletions(-)
Comment 2 Emmanuele Bassi (:ebassi) 2008-04-30 20:07:25 UTC
Created attachment 110186 [details] [review]
[PATCH] Fixes for the GObject tutorial

another attempt at fixing the tutorial.

the signals section is beyond hope (actually: beyond despair); I sincerely hope nobody ever pointed a new user towards it and expected anything more than confusion. it needs to be rewritten - I'll try and come up with something sensible before the 2.18 release.

the rest of the tutorial is mostly harmless; this new patch fixes the interfaces section, which was clearly copy and pasting existing code without changing it to fit the rest of the examples.

diffstat -w 74 /tmp/gobject-tutorial-fixes.patch 
 tut_gobject.xml |  310 ++++++-------
 tut_gsignal.xml |   44 -
 tut_howto.xml   | 1171 ++++++++++++++++++++++++--------------------------
 3 files changed, 749 insertions(+), 776 deletions(-)
Comment 3 Matthias Clasen 2008-06-11 17:05:13 UTC
I notice an instance of missing-space-after-comma, other than that, it looks fine to me. Please commit.
Comment 4 Matthias Clasen 2008-07-18 17:55:32 UTC
2008-07-18  Matthias Clasen  <mclasen@redhat.com>

        Bug 530759 – update the gobject tutorial to the XXI century

        * gobject/*: Some updates to the tutorial. Patch by Emmanuele
        Bassi.