The benefit of class not relying on code outside of its own definition is that it can create a self-contained unit that can be easily understood and maintained. This makes it easier for code to not rely on external code and more modular. It can be reused and modified independently from other parts.
What makes it challenging is maintain consistency with the code as well complementing the existing code (making sure it works across different interfaces).
Modularity: In the context of my Dancer class, modularity includes separating different aspects of a dancer’s behavior (movement) into separate methods within the class.
Reusability: Reusability involves designing the class in a different a way without having to rewrite the core of the code functionality. Reusable components within the class can be applied to different parts of the Dancer class to enhance the efficiency of my code.
p5 sketch: https://editor.p5js.org/ssc10042/full/TpmmcioRd