|
|
Subscribe / Log in / New account

Release Notes and GTK3

Release Notes and GTK3

Posted Sep 25, 2008 7:21 UTC (Thu) by tetromino (guest, #33846)
In reply to: Release Notes and GTK3 by alankila
Parent article: GNOME 2.24 available

If you allow direct access to structure fields, there is basically no sane way to implement new classes in languages such as Python or Java. One of the goals of Gtk+ 3 is to make non-C languages into first-class citizens.


to post comments

Release Notes and GTK3

Posted Sep 25, 2008 9:28 UTC (Thu) by alankila (guest, #47141) [Link]

Can you expand a bit on this idea? I do not understand what new classes you are talking about, and how does it help to make it more difficult to access the public members?

Release Notes and GTK3

Posted Sep 25, 2008 10:30 UTC (Thu) by epa (subscriber, #39769) [Link]

If you allow direct access to structure fields, there is basically no sane way to implement new classes in languages such as Python or Java.
That's often true, and yet it is a real annoyance to cruft up the syntax with 'a.setY(b.getX())' instead of 'a.y = b.x', and to write boilerplate methods for every field you want to expose.

C# deals with this in an elegant way by allowing properties with 'get' and 'set' methods which are exposed through the normal syntax. If you don't want the accessor to do anything except set the field, it can be generated for you, so no boilerplate is necessary. I hope other languages will adopt something similar.

Release Notes and GTK3

Posted Sep 25, 2008 11:36 UTC (Thu) by dgm (subscriber, #49227) [Link]

Can you propose an use case for this (somebody writing new GTK classes in Java or Python)?
It's not clear to me if you mean mere subclassing in an application's code, or subclassing for writing new classes for others to consume.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds