Finally got to try ReSharper
Here at my current gig at Lamps Plus I've been hearing more and more about ReSharper, and a couple days ago my license key arrived via email. Hard to believe it's been out since 2004 and I have never even seen it before, but I guess you don't miss what you've never had.
I've heard of ReSharper before of course, @scottw or peeps have mentioned it, sure, but I figured it was a simple app that would probably die off when Visual Studio added those few refactoring options back in VS2005.
Yeah, I know that sounds dumb and naive when you know the answer (smartass).
Turns out I like ReSharper A LOT.
As a test, I took a new small project that I wrote last week and opened all the source files and started hitting Alt+Page down to see all the red and yellow lightbulbs. RED? Jeez, this code was as good as I can write, wasn't it?
After nunit, I hate red...and being anal like all good programmers I can't just walk away and leave them red, can I?
First, I'm more impressed by the fact that they can remove the unused 'using' statements than by them actually being gone. Yes, I'm sure it's child's play really, but it's still cool - I've just always used plain-jane VS and haven't been spoiled by tools that are actually, you know, helpful.
As I look at some of the warnings/suggestions it's telling me, I start to get that feeling that I did when Intellisense was introduced. Like, "oh holy SHIT".
Loved the way it showed me my namespace didnt quite match the folder structure.
Loved that it refactored some code to use object initializers
Loved how it gently reminded me I should be using a lambda expression
Loved how little icons appeared on my unit tests so that I can run them immediately. Bye bye nunit-gui!
Loved how it suggested using var when the initializer expicitly declares the type..
..except at this point I had to pause.
I'm not a var fanboy, you see.
No, let's be blunt, I HATE var being used everywhere. I want readable code, thankyouverymuch.
Take this code below:
var lwc = attr.ToLower();
foreach (var a in GetAttributes())
foreach (var v in a.Values)
if (v.ToLower() == lwc)
Nope, not a fan of that. You have no idea what a is, and you only instinctively knew that lwc and v were strings cos of the ToLower()'s. I'm sorry, var might be less keystrokes and less text to read, but I'll stick with var being used in a lot more controlled manner.
But, aside from the fact that ReSharper got the default setting wrong IMO, it was an easy fix in the options dialog. Even better was the fact that even after the refactoring you can Alt+Enter a line to change it right back.
There was one more grumble, but I haven't even looked that hard for an answer yet; why can't I walk through the hints too? I can only find a way to walk through highlights or errors. Can I somehow highlight hints?
Anyway, it'll probably take a few months and lots of code to get half way decent with ReSharper. And after seeing this Jedi Coding video I may not even get half decent by those standards. Maybe eighth decent.