Insights

Why the ReSharper "Qualifier is Redundant" Can Be Evil

That Feel When ReSharper Breaks The First Law of Robotics

The Good Old Redundant Qualifier

Remember the times Resharper has innocently marked some of your code in grey and stated that your “Qualifier is Redundant”? You think to yourself, “Why yes, that is redundant. Let me clean that up for nice succinct code.”

Redundant code is redundant until it’s not. If you or anyone else introduces new code or code modifications that make your references ambiguous, then you will run into unexpected problems.

The probability of this happening to you may be higher than you think. Files, classes, and methods with the same name can be a very practical occurrence in some solutions.

My advice: don't be a hero. Leave your redundant qualifiers in place. Overall it’s less work deleting the redundant code, and far less work dealing with the possible nuclear fallout from accidental ambiguous references.

Furthermore, when you make references within your views, you might want to be even more specific about the reference location than your IDE requires you to be. This is because views are not compiled. If ambiguities are introduced into your project and your view falls victim, you might not find out about it until you push upstream or specifically navigate to the page by chance.

Good luck out there,

Marcel

👋 Hey Sitecore Enthusiasts!

Sign up to our bi-weekly newsletter for a bite-sized curation of valuable insight from the Sitecore community.

What’s in it for you?

  • Stay up-to-date with the latest Sitecore news
  • New to Sitecore? Learn tips and tricks to help you navigate this powerful tool
  • Sitecore pro? Expand your skill set and discover troubleshooting tips
  • Browse open careers and opportunities
  • Get a chance to be featured in upcoming editions
  • Learn our secret handshake
  • And more!
Sitecore Snack a newsletter by Fishtank Consulting