Before answering the question mentioned in the title, we should learn the function of every attribute.
“name” is a block identifier in XML layout with the help of which a block can be applied. “name” attribute should be unique within a page. It is appropriate to compare this attribute with “id” for HTML tags. If we do not assign the attribute, it is assigned automatically by the system in the ANONYMOUS_n format (“n” is a sequence element number with unspecified “id” attribute).