There are several aspects to consider in such a design:
- the structural dependencies
- the ownership relation (i.e.composition vs. other kind of associaton)
- the navigation needs
Structural dependency between classes:
If you aim at reusing component classes, you should avoid unnecessary dependency and avoid such closed circular structures.
Nevertheless sometimes two classes are conceptually strongly interlinked. In this case, avoiding dependency is not a real option. Example: a tree and its leafes, or more generally a composite and its components.
Ownership of objects:
Does one object owns the other ? Or otherwise stated: if one object is destroyed, shall the other be destroyed as well ?
THis topic was addressed in depth by Snowman, so I'll not going to address it here.
Navigation needs between objects:
A last issue is navigation need. Let's take my favourite example, the composite design pattern of the Gang of four.
Gamma & al. explictely mention the potential need to have an explicit parent reference: "Maintaining reference from child componenents to their parent can simplify traversal and management of a composite structure" Of course you could imagine a systematic top-down traversal, but for very large composite objects it can significantly slow down the operations and in an exponential manner. A direct reference, even circular can significantly ease manipulation of your composites.
An example could be a graphical model of an electronic system. A composite structure could represent the electronic boards, circuits, elements. To display and manipulate the model, you'd need some geometrical proxies in a GUI view. It is then certainly much easier to navigate from the GUI element selected by the user to the component, to find out which is the parent and with are the related brother/sister elements, than to start a top down search.
Of course, as Gamma & al pointed out, you have to ensure the invarients of the circular relationship. This can be tricky, as the SO question you refer to has shown. But it's perfectly manageable and in a safe manner.
The navigation need shall not be understimated. It is not without reason that UML has explicitely adressed it in the modelling notation. And yes, there are perfectly valid situation where circular references are needed.
The only point is that sometimes people tend to go into such a direction to quickly. So it's worth to consider all the 3 aspects involved before taking the decision to go for it or not.