I have come across the following problem many times in various guises in my programming career. As a simple example, consider the following:
Let's say there is a method (B) that could differ depending on customer requirements. This could be for any number of reasons. Common sense tells you that as things are now, you should write them as a common method and add branching code in the future to handle any future edge cases.
Customer 1: A-->B-->C Customer 2: A-->B-->C
However, your experience tells you that this particular bit of code is likely to change so it would be easier to have separate methods (B1 & B2) and change the logic for one customer rather than continually add branching code making method (B) non-generic.
Customer 1: A-->B1-->C Customer 2: A-->B2-->C
Are there any rules of thumb that can be applied in such cases or does every case have to be taken on its merits?
As an aside, I've come across plenty of people who staunchly advocate one approach over the other and I can see the merits of both. But surely there is some middle ground that can be reached based on reasoned arguments?