This week was our final lesson on p5.js, where Jamie demonstrated how to create and animate shapes and objects on the canvas. He also introduced some useful techniques to help keep our code structured and efficient, which I found particularly helpful. One of the key things I learned was how to reduce clutter in my code by using object-oriented programming principles, something I can see being extremely beneficial in future projects.
During a group tutorial, I had the chance to see how others approached the 2D grid artwork task. It was interesting to compare different styles and interpretations, which gave me some inspiration for how I might approach similar projects in the future. I also got to see other two group’s final data visualization of environmental change, which made me realize that I had misunderstood part of the original brief; my project included 3D elements, even though the task was for a 2D visualization. While this was frustrating to realize late in the process, it was still a valuable learning experience, as it reminded me to always carefully check the requirements before starting a project. Despite this, I was still happy with what I created, and I think the extra depth enhanced my visualization.
One of the most important techniques I learned this week was how to use class inheritance in JavaScript. By using the extends keyword, I was able to create a Square class that inherited properties and methods from a Shape class, which meant I didn’t have to repeat code unnecessarily. The super() function was another important concept, as it allowed the child class to access and reuse the parent class’s constructor. Understanding how to structure code this way is something that will be useful as I work on more complex projects in the future.
class Disk extends Shape {
constructor(x, y, d) {
super(x, y, d)
}
draw() {
fill(this.colour)
circle(this.x, this.y, this.d)
}
}
I really enjoyed this week’s session, as I find object-oriented programming and creative coding a great mix of logic and design. However, I know I still need to work on fully grasping class-based structures and how to implement them effectively. Moving forward, I’d like to continue experimenting with these concepts and possibly revisit my data visualization project to refine it further.

