I have a piece of code that runs pretty much the same except in certain situations/contexts it has some minor modifications when it's called in that situation/context.
Is it better to capture the states of the context in state variables? Pros: less code/more reusability Cons: will make the code less readable and more complex as more state modifications are added.
OR
Is it better to create a new file for that specific context?
pros: easy readability because no state variables, one file per state .
cons: less dry.
Aucun commentaire:
Enregistrer un commentaire