[Zope3-dev] Re: Code cleanup day

Sidnei da Silva sidnei at awkly.org
Wed Feb 25 11:29:14 EST 2004


| >I think the main differences are:
| >
| > - Don't skip the first identation level
|
| I prefer indenting stuff below the DocumentElement, too.

Good :)

| > - Use 2 instead of 4 chars for identing attributes in new lines
|
| -1
|
| Using 2 spaces for sub-element indention and 4 for attributes makes it a
| lot easier to read, IMO. You may laugh, but it helps me to distinguish
| attributes from sub-elements.

I can live with that. ;)

| Btw, I also dislike this notation::
|
|     <security:permission id="zope.View"
|                          title="View"
|                          />

Yeah, but its better than:

|     <security:permission id="zope.View"
|         title="View"
|         />

While the optimal would be:

|     <security:permission
|         id="zope.View"
|         title="View"
|         />

I can live with the last one, but I prefer the first for elements with
<3 attributes.

| > - Indent attribute value to the same level as the starting `"` on the
| >   previous line, if the value spans multiple lines
|
| Can you give an example? I'm not sure what you mean, and even if, how is
| it currently violated by current ZCML?

I don't think it is violated somewhere, but here goes an example:

Optimal:

    keyword_arguments="type_id other_id name technician_id
                       subject_type_id subject_id comments
                       commit_message collection_date"

Ugly:

    keyword_arguments="type_id other_id name technician_id
    subject_type_id subject_id comments commit_message
    collection_date"

Not-so-good:

    keyword_arguments="type_id other_id name technician_id
        subject_type_id subject_id comments commit_message
        collection_date"

--
Sidnei da Silva <sidnei at awkly.org>
http://awkly.org - dreamcatching :: making your dreams come true
http://plone.org/about/team#dreamcatcher

Variables don't; constants aren't.



More information about the Zope3-dev mailing list