About the author

Steven HarmanSteven Harman is a passionate developer who believes that writing great software isn't just a job, its a craft.

ASP.NET MVP

For recent posts and more about me, scroll to the bottom.

Subscribe

  • Subscribe to my feed. via RSS
  • Subscribe via email via email

Jobs

Badges

  • Subtext Project
  • Support Subtext
  • HiddenNetwork.com Banner

Avoiding Accidental Recursion with ReSharper 3.0

Who here loves ReSharper? I do, I do!

Now that I’ve got that out of the way, let me tell you yet one more reason that I <3 ReSharper.

ReSharper Warning LightsWhile doing a little Subtexting tonight I was looking through a new class and noticed a couple those little yellow ReSharper (R# from now on) warning lights. You know, the ones it so kindly puts next to the vertical scroll bar to let you know there are some things that need your attention.

The first one was safe to ignore - a warning about an unused local variable. It was safe to ignore because I hadn’t yet used the variable, but was going to... I promise!

Danger Will Robinson - Recursion!The second light was a different case. Look at the screen shot to the left and tell me if you see the problem.

Go ahead and look, I’ll wait.

Yeah, it’s that little circular icon with the arrow head near the top. That little puppy is how R# 3.0 tells you that you’ve just called a recursive loop. Recursion is awesome when used correctly, but can be really tough to debug when used incorrectly - like this case.

Without the guiding hand of R# I would have banged my head into my desk at least five times before I realized my mistake... no doubt due to a little fat-fingering.

Stupid fingers... do what I mean, not what I tell you!

Thanks ReSharper!

I’ve been an R# fan for a long time and don’t know how I would get anything done, in Visual Studio, without it. Actually, I probably wouldn’t and I’d still be writing Java code in IntelliJ - or I’d be on to Ruby in E Text Editor.

So what other cool tips or R# functions, warnings, etc... do you love and use? How does R# help reduce the friction in your daily development grind?

What others are saying.

# Links (8/12/2007)
Gravatar Member Blogs
Aug 12, 2007
.NET Argument Modifiers: 'ref', 'out', 'params' and 'this' Changes in the .NET BCL between 2.0 and 3.5
# re: Avoiding Accidental Recursion with ReSharper 3.0
Gravatar Jeff Atwood
Aug 15, 2007
Did you ever stop to think that perhaps "id" and "Id" are difficult to tell apart?

Another reason to hate case sensitive languages, as if I needed one..

http://www.codinghorror.com/blog/archives/000458.html

personally, I use the underscore technique. I always strongly, STRONGLY advise developers not to discriminate between public and private solely on the basis of case. It's a Bad Idea(tm).
# re: Avoiding Accidental Recursion with ReSharper 3.0
Gravatar Ben Scheirman
Aug 17, 2007
Yes R# and e-texteditor both rock. I love them!
Comments have been closed on this topic.