I write ruby code. I have used snippets that I didn't fully understand. It turn out in the usual way "it works but I don't understand exactly how...". I ended with simpler code that I understand, was able to write test and all by reading the documentation.
Depends on the example, as other users said.