Agree with the tip, but adding my point I think that because an XML constraint, some comments can’t be as meaningful as they could be because line comments don’t exist on marked based languages.
Example:
In that layout, I’m reusing a @layout/view_price_Header
which is the same for land and portrait configurations.
The reason behind the tools:ignore
attribute is that a lint its shown since the tool is not able to recognise the referred view.
That might be not understood at first sight for others, so a comment would make sense there explaining the reason.
<!-- Known at @layout/view_price_header -->
In an ideal world, I would add a comment right of that line:
That would fail in compilation time, as after the comment, the rest of attributes will be misinterpreted.
The only solution is to write that comment at the end of the tag, and it might appear out of context and is not meaningful as it could be.