Using code samples when learning new programming languages, frameworks and libraries is a great way that speeds up the learning process. I usually start with running a simple code sample and then proceed with more sophisticated ones. Each code sample I run I try to change a bit, and verify my understanding by comparing the output with the one I expected to get. Doing so together with reading the explanations contributes to my understanding of the new topic. Side by side with executing the code samples I read the explanations. It can be either a textbook I buy or the main documentation website (of the programming language, framework or the library I learn). Usually, the explanations I find in the main documentation website are more accurate. I hope this tip will assist you in your endless continuous process of learning new programming languages, frameworks, and libraries.
The Visitor Design Pattern
The visitor design pattern allows us to add operations to objects that already exist without modifying their classes and without extending them.