Is it okay to keep your pregnancy a secret? And how far is too far?

What are your thoughts? And would it be different if you weren't the one pregnant, say a close loved one/friend were. How would you feel?