Is it good practice to teach using real life experiences of the student? I am not a professional teacher but I have students that seek me for clarification and knowledge. At times I use their personal real life experiences like how they relate to others to simplify the answer. Is it right professionally? 
In the case of programming, when teaching of classes, using their families to signify inheritance. For example your father was tall so will you be... your mother is intelligent so will you be... with no interest of motivate them but educate them.
Yes - to answer your question. If it helps them understand the materials then you should do it.