I found the Visitor Pattern cumbersome as well, especially in languages that don’t have to use class for everything.
It’s arguably cleaner to use pattern matching with destructuring, for example:
I found the Visitor Pattern cumbersome as well, especially in languages that don’t have to use class for everything.
It’s arguably cleaner to use pattern matching with destructuring, for example: