Of course every situation is different. Some doctors refuse to make their patient a no code - feeling it would be a personal failure no doubt, unless a family member requests it. Here in my hospital a lot of doctors absolutely hate addressing the code status issue. They are there for just minutes usually, while we have the 98% the rest of the time. If a patient is going sour, depending on his age, secondary diagnosis etc, I will bring it up with the family. I encourage them to get together to discuss the situation, and whatever they decide, to let thier doctor know, or I will write it on the doctors board to be addressed. I think there should be a trainex film entitled "CPR. LIVE!" Then these family members who want everything done for their 96 year old father who has a history of everything and is dying of everything, can see dad's ribs cracking, and being zapped and the beauty of being intubated. By all means, save the ones you can, but be realistic. I believe in death with dignity. Some family members have even chosen to ignore their parent's living will for heavens sakes.
As for discussing it with the patient, I can usually take clues from a conversation. Sometimes the patient will say, I've had a good life, or I'm tired of being sick, I hope I sleep and never wake up. Those are usually good clues, to perhaps expand on.