Don't fear the code. It's just code. Never write (or copy) a line of code that you don't fully understand. Figure out how things really work and why they work they way they do. If you don't understand something, go deeper. Read the source code for the library you're using.