DEV Community

Discussion on: The State Pattern Exemplified in TypeScript

matteodellirocioli profile image

This pattern actually made my life so much easier when I dealt with microcontrollers at school, really well explained sir πŸ˜„

lifelongthinker profile image
Sebastian Author

I still remember when I created a monster class (God class is the name for this antipattern) twenty years ago when I had just started out programming.

Back then I had not even heard of the state pattern, let alone design patterns. So I was handling all sorts of FSM related state logic in a single class that dealt with text input. It as a mess. A real mess.

Remember that back then we didn't have StackOverflow or anything like it (a newsgroup maybe, if we were lucky). So you had to make do with the little help you could get.

Luckily I came across the Gang of Four book not long after. It changed the way I looked at code and coding dramatically. 😍

Thanks for your feedback. Happy coding!