is the chain code considered secret? I'm confused by a statement in https://bitcoin.org/en/developer-guide#hardened-keys


  "For this reason, the chain code part of an extended public key should
  be better secured than standard public keys"


I'm confused because I thought the chain code was an intrinsic and easily deciphered part of an extended public key.  For example the top answer here explains how to derive the chain code from any extended public key:

Key derivation in HD wallets using the extended private key vs hardened derivation

So how exactly is one supposed to obey the advice from bitcoin.org to "secure" this chain code when it's openly exposed in the public key itself?  Does a "hardened" public key not likewise expose its chain code?
The idea is that you shouldn't reveal the extended public key (and thus the chaincode) unless you want people to be able to know all of your addresses and potentially recover the extended private key. It should be considered semi-secret; more secret than just the public key itself, but less secret than the private key.

Knowing the extended public key allows someone to know what all of your addresses are, so you lose security. But it does not allow them to know the private keys except in certain circumstances. Because of the extended private key could be derived from the extended public key, you shouldn't give out the extended public key. 

However there are few use cases where others do need to know the extended public key, and if you avoid the insecure case, it is safe and secure to reveal the extended public key. You just need to be extra careful in the future to avoid revealing a child key.