Always use a transit (two objects in line) to make sure your anchor is not dragging. A compass bearing is not nearly so accurate, and is far more cumbersome to arrive at. Even at night, you will generally find a couple of shore lights or silhouettes whose relative disposition is easily definable. The compass is at its most useful when all you can see is one solitary light or shape.