GNOME Bugzilla – Bug 472740
Generates correct, but not easy to read code for reference handling
Last modified: 2009-09-17 11:30:46 UTC
Hi, vala does not create code that humans would write for reference handling and is rather hard to read. For example: return (__temp0 = 0, (sample == NULL ? NULL : (sample = (g_object_unref (sample), NULL))), __temp0); (sample == NULL ? NULL : (sample = (g_object_unref (sample), NULL))); A human would probably write this with if, else, etc. Every other part of generated code is perfectly readable though, good work :) Bye PS: the two example lines are taken from the code generated from the Gtk sample. I wonder why there is an expression after the return, it's never called anyway?
This is with vala 0.1.2 btw...
Confirming. Readability of the generated code is not our highest priority but we'll try to improve it as far as possible without complicating the code generator code too much.
*** Bug 588123 has been marked as a duplicate of this bug. ***
commit 599bebc78755313cb08e2ab62b2053e0bf69b40a Author: Jürg Billeter <j@bitron.ch> Date: Thu Sep 17 12:09:02 2009 +0200 Improve readability of reference counting Fixes bug 472740.