QuestionQ126

VerifiedDevelopment and Testing

During a code review, you observe that a team member duplicated a section of code that sends email notifications within the same workflow.

What is the MOST effective way to address this issue while following the DRY principle?

Explanation

The DRY principle calls for a single source of truth for repeated logic. Moving the email-notification code into a reusable function or component and invoking it from both locations removes duplication while preserving the workflow structure.

Community Discussion

No comments yet. Be the first to start the discussion!