Situation: several developers working remotely on different section/modules of a SPA.
As a result they may accidentally introduce HTML elements with the same id
. W
For instance, if developer X is developing a module Y, his prefix should be one of x_
, y_
or xy_
.
Assuming x_
was picked, IDs created by him would look like x_foo
, x_bar
, x_thing
etc.
Avoids colliding IDs (obviously).
While integrating modules, the IDs clearly indicate where they belong.
This provides improved readability, and that is pristine!!
Writing x_something
is irritating enough to avoid overindulgence in ID usage.
At the same time, it is not so irritating that no one will use them.
It'll make at least some developers unhappy. (Some are less flexible than others.)
A possible remedy is to ask them to change IDs to the x_
form,
only towards the end of development, just before integration.
Until then, they may use prefix-less ID names.
Some modules depend on other modules. Before integration,
appropriate ID names must be shared and correctly used.
While this may take some additional time, it would (hopefully) be worth it.