Open TenCoKaciStromy opened 4 months ago
Something similar exists for real when using else if in the popular sonar scanner: https://rules.sonarsource.com/csharp/RSPEC-126/?search=Else
Something similar exists for real when using else if in the popular sonar scanner: https://rules.sonarsource.com/csharp/RSPEC-126/?search=Else
That's horrible ðŸ˜
The Sonar rule is actually not that horrible 😅 It's the equivalent to an exhaustive pattern match, which is enforced in many languages to avoid a lot of logic flaws at compile time.
Why? It's a protection against 10x ADHD developers who jumps from one project to another and stops coding in the middle of method and forgots the
else
part. (Instead of properly reporting every line of code to company timesheets and follow waterfall roadmap.)Wrong:
Right: