In this week’s recitation, we have a workshop for map() and the fellows set up 3 more different workshops to further explore processing skills on different aspects. I choose the object oriented programming because I think the skill can really help me a lot on my final project. It helps me create lots of images in the similar format in a more effective way. Also, the skill is what I feel a little bit confused about during the lecture.
The basic principle object oriented programming is that you start two labels in a project. The second one is the framework. For example, I want to create a picture that is full of cartoon bears with different colors and positions. I use class() to write the code to create one bear. And then, in the first label, I write codes to display the bear by plugging in different exact numbers. This technique is quite useful and efficient, and also make the code displayed in a more clear layout.
During the process, I faced one question that although I have declared some X and Ys in the code, it failed to recognize the X and Ys in the subsequent codes. Tristan taught us that because it is common to face problems like this, it is better for as to write things like float x or int y at the very beginning of the code. It is not only clear for us, but also helps to decrease the risk of such errors.
After the 1-hour practice, I manage to understand how the object oriented programming really works. The skills are really useful when I want to create different images for each person. I think I can also include arrays to make the process even much easier.