Every where I find people saying it is better to use state design pattern over if else , I want to know how :
- It is an improvement to if-else in real world use case ?
- Does it make code more testable ?
can any one please provide an example where state pattern actually improves the case, it is difficult to make sense of why i shall take the overhead of following state pattern when i can use if-else.
Examples over the internet is not enough to show how this pattern solves the real world problem or makes code more maintainable.
Aucun commentaire:
Enregistrer un commentaire