Complete the code to apply the YAGNI principle by avoiding unnecessary features.
if user_needs_feature: implement_feature() else: [1]
YAGNI means you should do nothing if the feature is not needed yet.
Complete the code to follow YAGNI by not adding unused parameters.
def process_data(data[1]): # process data pass
Only include required_param which is necessary; avoid unused parameters.
Fix the error in the design by removing the unnecessary caching layer as per YAGNI.
class DataFetcher: def fetch(self): [1] # unnecessary cache layer removed
YAGNI suggests removing unused cache; fetch directly from database.
Fill both blanks to implement a simple feature without extra complexity, following YAGNI.
def calculate_total(items): total = 0 for item in items: total [1] item.price return total [2] discount
Use += to add prices and + to add discount simply, avoiding unnecessary complexity.
Fill all three blanks to create a minimal class design that avoids unnecessary features, following YAGNI.
class User: def __init__(self, [1], [2]): self.name = [3] self.email = [4]
Only include name and email in constructor to keep design simple and avoid unused features.