Suppose I have a function that performs some task (this is in Python pseudocode):
def doTask():
...
But I have several optional features on the platform which results in having code that looks like this:
def doTask():
...
if FEATURE_1_ENABLED:
...
if FEATURE_2_ENABLED:
...
...
Unfortunately, this gets rather messy with many different optional features that coincide with one another. What kinds of design patterns solve this issue?