I’m about 75% through the course (and loving it) but had a more general question and wasn’t sure where to put it. I’m a newer developer (about 5 months) so this course is my first exposure to hierarchical state machines. I’ve been watching other videos on youtube about state machines and I noticed other people tend to declare instances of the states in the state machine and store them as a variable. In this course we have been instantiating new instances of the state with each switch state. So my question is…
Is there any advantage or disadvantage to creating a new instance of the state with each switch state? Or is this just two different ways to accomplish the same outcome? Thanks