On Wed, Apr 27, 2011 at 09:35:32AM +0200, Matthias Bolte wrote:
2011/4/27 Daniel Veillard <veillard(a)redhat.com>:
> Not sure I fully understand but looks regular and okay, ACK :-)
>
> Daniel
>
Actually, this shows that even I'm not always aware of all the details
in the ESX driver, otherwise this regression fix wouldn't have be
necessary and I wouldn't have needed two attempts to get it right. So
don't feel too bad about not fully understanding it :)
This is probably a sign that I should try to reduce the complexity and
levels of indirection in the generated code and the code generator.
Reminds me of docs/apibuild.py , that's code I wrote like 10 years
ago for libxml2, and I certainly don't remember all the subtelties,
it's certainly not very nice code, but being a generator and automated
parser the good point is that I don't have to remember it, and very
seldomly hack it. I think there is no shame to having "imperfect" code
which does this kind of things as long as it's done in a generic enought
way that you don't have to tweak it often.
If the extra indirections don't cost anything (except extra code) then
maybe it's fine keeping. I would say the main driver to clean such code
would be if you feel others need to hack on it and it need to be cleaner
and easier to understand.
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine
http://rpmfind.net/
http://veillard.com/ | virtualization library
http://libvirt.org/