Code review comment for lp:~camptocamp/margin-analysis/7.0-port-product_historical_margin-xml-retab-yvr

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

I prefer 2 spaces indentations as in xml you can have a lot of indentation levels
In python with max width of 80 or 100 and for readability you better have a maximum of 5 indentation level and can have only 3 levels.

class:
4s def:
8s code
12s nested code

In XML if you want to do inheritance you will need at least 6 levels

<openerp>
4s <data>
8s <record id=
12s <field name="arch"
16s <xpath
20s <field name="my_new_field"

Furthermore, with html and v7 style you get even more indentation levels

Let's take the kanban view of res.partner as a bad example:
line 237 in res_partner_view.xml
it begins at columns 77
(19 levels of indentation and if should be 20 levels as sheet tag isn't properly indented)

In my opinion, 2 spaces in XML doesn't make it less readable.

But I don't intend to indent by 2 if we choose 4 for our code.

3 spaces would be a compromise and tabs would let people decide how to display it and reduce file size.
But let's keep the discution on 2 or 4 as it would start being more philosophical :)

« Back to merge proposal