LWN.net Logo

Release Notes and GTK3

Release Notes and GTK3

Posted Sep 25, 2008 10:30 UTC (Thu) by epa (subscriber, #39769)
In reply to: Release Notes and GTK3 by tetromino
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.
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.


(Log in to post comments)

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