The Desirability of Implementation is directly proportional to the Probability of Value and the Potential Value of Implementation, and inversely proportional to the total effort, consisting of the Effort of Implementation plus the Effort of Maintenance.

— Max Kanat-Alexander, Code simplicity

In mathematical terms:

D = (V_{i} * V_{f}) / (E_{i} + E_{m})

Where:

V_{i} = Value of Implementation, having that change now.

V_{f} = Value in the Future, or the lifetime value for the user.

E_{i} = Effort of Implementation.

E_{m} = Effort of Maintenance.

When considering how time affects the equation:

- if the time your software is supposed to be used is long, the effort of maintenance (E
^{m}) and the lifetime value for the user (V^{f}) will likely outweigh the effort and value of implementation. - if the time your software is supposed to be used is short (a demo, etc), the cost of implementation will likely outweigh the maintenance effort, so you should optimize for speed of implementation.

Note that the user that would receive the value can be the end user of your software (change as a new feature, performance, etc) of another developer (change as a refactoring, new pattern, etc).