At 04:29 PM 8/11/2005 -0700, John Anderson wrote:
I mildly prefer the class.classMethod syntax. In some cases I could imagine more than one classMethod to create an Item.

I also prefer it, because it gives you more opportunity to look up the template() or make() method and find out what it does.


In your example below, it's unclear which parenthesis matches the one just before ".install(...

It would probably be better formatted more like:

Menu.template('FileMenu', _('File'), childrenBlocks=[
    MenuItem.template('NewNote', _('New Note..'), ...),
    MenuItem.template(...),
]).install(parcel)

Or, if the other parameters to the outermost template require more than one line:

Menu.template('FileMenu', _('File'),
    otherParam=....,
    childrenBlocks=[
        MenuItem.template('NewNote', _('New Note..'), ...),
        MenuItem.template(...),
    ]
).install(parcel)

The nesting is somewhat deeper in that case, but more readable, at least for me.

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Open Source Applications Foundation "Dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/dev

Reply via email to