False.
The Jedi Code is designed to stop attachments to stop the flow of powerful emotions that lead to the darkside of the force. This is perfectly explained and shown in all three of the prologues. Obi-Wan cares greatly for his Master, when his Master is killed he skirts the line of the darkside to avenge him. Anakin loves his mother, when she dies he slaughters an entire Tusken Tribe. When Anakin loves Padme he begins to fear for her death and thus...well falls to the darkside and becomes one of the worst Sith ever.
Attachment is forbidden by the code because attachment inevitably breeds powerful and uncontrollable emotion, said emotions lead to the darkside. This is a theme throughout the prequel trilogy.
“Fear is the path to the dark side. Fear leads to anger. Anger leads to hate. Hate leads to suffering.”
When Yoda says this he leaves out what causes that fear, but that cause is revealed by Anakin, by Obi-Wan, and many others who have fallen(or nearly have).