Why this matters
Improves readability and eases coordinated changes.
Extract numeric literals with meaning into named constants or readonly fields.
Improves readability and eases coordinated changes.
Side-by-side examples engineers can pattern-match during review.
Thread.Sleep(2000);private const int RetryDelayMs = 2000;
Thread.Sleep(RetryDelayMs);if (retries > 3) ...const int MaxRetries = 3; if (retries > MaxRetries) ...From the same buckets as this rule.