views:

1707

answers:

14

I've been trying resharper casually for about a week, without delving into it too deeply. What I've found useful so far is the ability to eliminate redundant Using statements, ToString() calls, and casts. I guess in theory this should reduce the expense of my code-behind and dlls and such. What is Resharper best at, what justifies its cost? Your answers will help whet my appetite for further Resharper delving. Thanks people!

+4  A: 

for me it's the shortcuts... specifically

  1. ctrl b - Navigates to declaration/definition
  2. ctrl alt b - Navigates to inheritor (eg. ctrl alt b on an abstract method)
  3. ctrl n - open a class/interface
  4. ctrl shift n - open a file
  5. ctrl alt F7 - finds all usages

As for killer features, Resharper's NUnit Runner is worth the cost. Also, file templating and the code snippet editor are all pretty fantastic. I've had and have upgraded my resharper license since version 1.0... I can't live without it.

cranley
+2  A: 

All the features of ReSharper is aimed at improving developer productivity. These are the features i value the most:

  • Smart navigation, try to CTRL + Click on a type, and ReSharper will take you to the class definition
  • Refactoring, like Extract Method, insert Constructors and properties (auto-generation of code).
  • Warnings against common pitfalls in your code as you type. Things like "possible null-reference" if you try to use a reference variable that ReSharper can determine is posssibly null.

There are of course lot's more.

driis
Ah yes, love the ctrl+click and the gentle warnings. It's just so satisfying eliminating the little warning indicator lines on the right-hand column, like a game of tetris or something.
MrBoJangles
"Smart navigation, try to CTRL + Click on a type, and ReSharper will take you to the class definition" - doesn't F12 do the exact same thing without resharper?
ForeverDebugging
+1  A: 

ReSharper is nice for a lot of things. The first of course being it's ability to find problems in code. It also offers some nice hints on how you can better your code. The Live Templates are a great way to reduce the number of key strokes you need to take. Nifty built-ins like Ctrl+Left Click to go to definitions and the Find Usages option. There are a lot of very cool plugins for it as well. Agent Smith is nice for code comments and its dictionary. RGreatEx plugin was awesome when we needed to locate all the strings throughout our code for localizability. I don't know how I would live without the build in NUnit test runner. Also really like the customizable code cleanup tool. Makes wrapping up your code a snap.

Adam Driscoll
+2  A: 

I like all the cleanup features (nothing like seeing the green mark) but I have two favorite features, one for improving productivity and one for eliminating bugs.

For productivity, I like the reduced number of keystrokes. Resharper is smart enough to save many repetitive symbols like (), {}, new lines and a few more. I tried working on a computer without Resharper and simply couldn't adjust. This saves time. Period. For eliminating bugs, I like the warnings that show unused variables or incorrect code practices like calling a virtual property from within a constructor. These warnings help fix bugs that most developers wouldn't notice while coding and will usually take very long time to fix.

Rami
I wonder if VS 2011 or whatever will incorporate a lot of Resharper features or if MS will buy JetBrains or some such thing.
MrBoJangles
+2  A: 

Refactoring support. That's why it's called ReSharper. If you don't know what refactoring is, read up, the topic is too big to cover here. Start with THE website, and go on from there. Fowler's must-read book on the subject is a great read.

That is definitely on my reading list. I've heard that it's pretty much the refactoring bible.
MrBoJangles
+10  A: 

Navigation Features:

  1. Ctrl-N Goto Type
  2. Ctrl-F12 Goto file member
  3. Ctrl-U Goto Base
  4. Ctrl-Alt-B Goto Inheritor

Refactoring features:

  1. Ctrl-Shift-R Refactor This!
  2. F2 Rename
  3. Ctrl-F6 Change Signature
  4. Extract Interface/Extract Baseclass via Ctrl-shift-R

Documentation/Autocomplete:

  1. Ctrl-Shift-Space Smart Code Complete
  2. Ctrl-P Parameter Information

These are the ones that I use daily. Note that there are two different keyboard shortcuts sets. Above are the ReSharper2.x/IDEA scheme the other is the Visual Studio scheme which I belive is new to Resharper 4.0.

The shortcuts mappings in a PDF can be downloaded from http://snipurl.com/3qvwq [www_jetbrains_com].

rathkopf
Very useful link there, thanks.
MrBoJangles
+3  A: 

The best thing for me about Resharper is its on-the-fly code analysis and error highlighting. It means I'm not constantly using the compiler to track down typos and coding errors.

Lee
Thanks. This'll help justify the cost to my boss.
MrBoJangles
+1  A: 

I've found that "Introduce variable" and "Extract method" are invaluable tools to keep my code concise and with less comments (more readable).

I end up having two kinds of methods: high level and low level methods. When you read a high level methods it's like business logic scripts while low level methods do the actual weight lifting.

Also "Rename" allows me to keep thinking about a better name for that method in my mind's second core :)

Leonardo Constantino
+1  A: 

Extract Method and Change Signature. Very, very, very nice when you are dealing with very large legacy systems.

Jon Limjap
+1  A: 

Code Generation is my favorite part, particularly for creating properties and constructors.

Greg
+1  A: 

This answer is a tad tangential but hopefully useful. I recently caused some problems by setting a property in a library class as read-only because resharper said I could. The problem is that other people are using the library in different projects, where said property can't be read-only.

Moral: Know the impact of what you are doing in Resharper, don't just go all hobbledy-hoy and higgledy-piggledy doing whatever Resharper suggests. That said, I still love Resharper, and this issue was a user issue, not a Resharper issue.

MrBoJangles
+1  A: 

Private field to property!

Austin
A: 

The shortcuts I use:

alt-enter ctrl-shift-r ctrl-n ctrl-shift-n

Fixup, refactoring, and navigation.

Refactoring is kind of a state of mind, if you haven't delved into the literature on that you'll probably miss a lot of the appeal.

Frank Schwieterman
+3  A: 

For my (not popular) opinion: I hate it.

  • Slows down my machine
  • I get by fine with VS shortcuts
  • It, IMHO, encourages bad practices with too many things happening automatically

But mainly, it's about the speed.

The top rated answers here (as at posting time), can all be done (albeit with slightly more button presses) in VS itself: control-shift-f for searchin in solution, various uses of F-12, and F-11, etc.

Tried it once, never went back.

For me you go with what you're most productive in anyway; there is no use arguing really, just offering my opinion on a subjective matter :)

Noon Silk
There is a machine cost, and the shortcuts throw the non-users off, but I'd say it reinforces good practices. It doesn't do anything automatically. It gives you the option to do certain things automatically with machine-accuracy, taking the human error element out of the equation. But regardless, you say you hate it? You reveal your own weakness in your argument, that you used it once and never went back. So go back, and do it right this time. Hate? Easy there, fella.
MrBoJangles