I don’t know how better to describe this. So take this example.
var a = {
x: 1,
y: 2 };
var b = {
z: 3,
refA = a };
a.refB = b;
I have a preference that this is sort of behavior is ugly. So at best, I have a personal disagreement with this sort of coding. You should not need to have these types of references, and it leads to code that is difficult to comprehend.
However, does anyone see a technical penalty for doing these sort of references.
Mutual references (what you call reference loops) are necessary for some data structures. Many trees have links pointing from parent to child and vice-versa; double-linked lists have a
prevandnextpointer.Is there a particular reason you don’t like this?