by kirupa | 24 December 2015
Up until this point, we've been drawing each shape individually. That was fine for learning how the various draw commands work. In real life, you'll rarely issue draw commands directly. You'll instead delegate the drawing to a helper function or custom object or something else that makes drawing things more maintainable.
This is a companion discussion topic for the original entry at http://www.kirupa.com/canvas/structuring_your_drawing_code.htm