I try to keep em at least 36" from where the eventual cieling fan is going to be in the bedroom. Usually where the light is now is going to be a fan someday. Over by the door is a good place on a flat ceiling in case the smoke comes in the cracks around the door.
Hallway outside the door of bedrooms, one on each floor. Don't like em in garages, I would rather a flame or a rapid rise in heat sensor in there.