Have you ever wondered how Sherlock would react, and cope if John were to die?
In ASIP he had just met John. Before that he did everything he could to separate himself from normal and boring people. By HLV, he had spent plenty of time around John, watching his behavior, seeing others responses to it, and learning how to mimic it. He has developed a need to make John happy, and alters his behavior in order to do so.