21

I'm in the middle of an ASP.NET MVC project and recently installed the free trial of ReSharper 4.5. Immediately I realized the benefits, simply because of the refactoring it wanted me to do.

Things like inverting if statements to reduce nesting, changing some of my if/else statements that were returning Views to ?/?? operators - drastically reduced the number of lines of code in my application.

The capability of performing a null reference check from a single click, removing unused directives/variables or removing redundant code (calling .ToString() when it wasn't necessary). Or, that it can see into my views to let me know I'm accessing a property that no longer exists, makes solution-wide renames more thorough... really saves a lot of time.

But I get the feeling that I'm only seeing the tip of the iceberg. So I ask this:

What do YOU use ReSharper for? Anything beyond the immediate benefits I described above?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Chaddeus
  • 13,134
  • 29
  • 104
  • 162
  • 9
    This is programming related and should not be closed! There is no shortage of dumb stuff to close! – rp. Jul 22 '09 at 03:54
  • 1
    I think the vote to close came from someone that wanted this to be community wiki, if you want it to be wiki, flag it for moderator attention or leave a comment saying: jeez I'd love to upvote this if it were community wiki. – Sam Saffron Jul 22 '09 at 04:18
  • Does "general badassery" count? :) – JP Alioto Jul 22 '09 at 05:40

7 Answers7

13

ReSharper provides a huge set of tools beyond the simple refactorings it suggests. In addition to providing additional code auto-formatting capabilities, ReSharper provides an integrated unit test runner that works with all of the known unit-test frameworks (such as NUnit, MBUnit, and my personal favorite, XUnit.NET). ReSharper also provides a very powerful template-based code generation platform that can improve your productivity by leaps and bounds.

For a full list of all the capabilities ReSharper can offer you, check here:

http://www.jetbrains.com/resharper/features/index.html

jrista
  • 32,447
  • 15
  • 90
  • 130
  • Could someone explain what the down vote was for? – jrista Jul 22 '09 at 04:14
  • Oh man, the screenshot of the Code Templates link shows a join "snippet" for LINQ. Very cool... gonna have to get used to this. – Chaddeus Jul 22 '09 at 04:16
  • About the down vote, no idea... I up-voted it. :D – Chaddeus Jul 22 '09 at 04:16
  • @Chad: ReSharper is definitely THE programmers toolkit to get. It completely changed the way I write code...and I've been writing code since I was 8. Enjoy the wonderful new world of ReSharper! :D – jrista Jul 22 '09 at 04:22
  • I love this tool. I wouldn't consider programming in Visual Studio without it. The code templates are very helpful. As an example I've got two on my website if your interested: http://jarloo.com/tips-tricks/resharper-live-templates/ – Kelly Jan 17 '11 at 21:21
  • Basically R# is useless. Comparing to overhead it adds those small extra features are not worth it. – Ivan G. Dec 10 '15 at 17:47
  • Vote Down: no really answering question. What has Resharper that VS is really missing? Nothing. – Eru Apr 26 '21 at 09:03
6

What don't I use it for is more like it. Here's a shortlist of my most often-used shortcuts:

  • Running unit tests. Their GUI unit test runner is awesome (sort by project/namespace is great), and I shortcut Alt+X to run a test.

  • Adding a class for unit tests, templated out with live templates

  • Multiple custom livetemplates for filling in code, especially complex attributes

  • Weeding dead code on our enterprise codebases

  • Converting properties to auto-properties

  • Combining variable declarations with their setup code

  • Making methods static that can and should be static

  • Looking at the pre-compilation errors/warnings bar saves me tons of time

  • StyleCop for ReSharper puts all my styling warnings inline for me.

Pretty much most of these are done with just Alt+Enter. The time saved is incalculable.

Community
  • 1
  • 1
womp
  • 115,835
  • 26
  • 236
  • 269
3

Geez, where to begin?

  • Refactoring.
  • Code formatting.
  • Code templates.
  • Marker bar (the red/yellow/green stripes in the sidebar to show code warnings).
  • Highlighting of unused code.
  • Code generation.
  • Shortcuts to save typing (for example, Alt + Enter to remove unneeded braces, change visibility, etc.)
  • Code browsing. (Find References, Class Hierarchy, etc.)
  • Unit testing.
  • I could go on...

If you want a thorough overview of what ReSharper can do, check out my blog series, 31 Days of ReSharper. It's missing the latest and greatest features (it was written for ReSharper 2.5), but it shows a lot of ReSharper in action.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Joe White
  • 94,807
  • 60
  • 220
  • 330
1

It can be used to keep the headers of each file up to date in an open source project. By headers I mean license text.

Scott Whitlock
  • 13,739
  • 7
  • 65
  • 114
1

I used a really early version and found that it became really annoying when you were typing and the silly thing paused while it loaded the IntelliSense.

No key strokes were lost, but the pause annoyed me to no end.

Has this been fixed or not?

So at the moment my answer is I don't.

gotnull
  • 26,454
  • 22
  • 137
  • 203
griegs
  • 22,624
  • 33
  • 128
  • 205
0

I use ReSharper for:

  1. Creating fields automatically.
  2. Generating classes and methods (while doing TDD).
  3. Automatically adding namespaces.
  4. Finding usages.
  5. Solution wide background compilation.
  6. Templates to standardize conventions among a team.
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
leora
  • 188,729
  • 360
  • 878
  • 1,366
  • Ah yes, automatic fields, auto namespacing... What sort of templates do you use? – Chaddeus Jul 22 '09 at 03:52
  • we standardize on conventions with variables (member and argument variables). also there are addin like agent smith to have resharper show errors when you dont follow other rules as well – leora Jul 22 '09 at 03:54
  • Nice.. I suppose since I'm developing alone at the moment that the templates could simply be used as code snippets of sorts? – Chaddeus Jul 22 '09 at 04:08
0

If you're using ASP.NET MVC, you might be interested in the new ReSharper 5 beta. It adds some nice features specifically.

  • Ctrl + click navigation, find usages and refactoring from 'magic strings' ActionLink to Controllers/Actions.

  • Ctrl + click navigation find usages for your Views referenced in your controller actions, and to the partial views referenced in your views.

  • Displays errors (even solution wide) when your ActionLink references a non-existing Controller/Action and allows you to automatically create stubs for it.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Wiebe Tijsma
  • 10,173
  • 5
  • 52
  • 68