Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411423 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 19, 2024, 05:53:04 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Resharper
Pages: [1]
Print
Author Topic: Resharper  (Read 841 times)
InfiniteStateMachine
Level 10
*****



View Profile
« on: April 12, 2015, 09:47:05 AM »

Morley, I know you said you used resharper. I've heard constantly it's supposed to be great but it's a little expensive for me. I did buy Visual Assist X but I work in C/C++ the majority of the time. C# I would like to spend more time with but it only really comes up for me when I'm developing tools.

What's so great about resharper? One funny thing i've heard it does is that it converts your loops to linq queries whenever it can. That seems a bit odd because aren't linq queries generally a bit more taxing than a comparable loop?

The code generation templates also seem interesting.

Anyone here used resharper much? Is it worth the 250$?
Logged

MorleyDev
Level 0
***

"It is not enough for it to just work"


View Profile WWW
« Reply #1 on: April 12, 2015, 10:42:50 AM »

The main advantages of Resharper are it basically adds the missing re-factoring features to Visual Studio.

A good way to get a feel for what it adds are to use the free community edition of IntelliJ for Java, and then look at the many refactoring options it adds to Java that Visual Studio lacks for C#. Almost all of those features are added by Resharper. I find it speeds up how quickly you can change code by several factors, which is vital for when you want to use best-practices like Red-Green-Refactor Test-Driven-Development. Or if you've inherited a set of legacy code and need to maintain it, since it makes refactoring the code much easier and not something you need to be as afraid of doing.

It also highlights where code can be simplified, such as where you can remove or invert ifs and loops to reduce nesting, or unused functions and variables. I've managed to, just by using ALT+ENTER, reduce 50 line functions to 10 lines. And then break those functions into two 5 line functions that are much more expressive, readable and testable than the previous code was. Then, for good measure, extract those functions into independent injected dependencies that I can easily write unit tests for. All of that almost entirely using keyboard shortcuts.

The for-to-linq isn't it forcing a conversion, it just highlights where it's possible. And it can unroll the linq into for statements too, if you want. Either way, it's something it just tells you it can do and you have to tell it to do. And you can turn it off if you like, so it won't even highlight where it thinks linq would be simpler than loops.

This is often useful because after you learn to read Linq functions (the .Where(x).Select(x)), it's often much more readable than for loops and for data processing you don't see much performance difference in the more complex cases. Or it's situations where the potential for performance increase isn't worth the readability-hit.

It also adds "Code Style enforcement" where it highlights where you break the specified coding style. Very useful for working in a team.

Is it worth the $250? Depends. For personal hobby development, probably not. For professional work, I consider it a good investment. It comes with a 30 day trial, so I'd recommend downloading it and seeing if you think it's worth it. Personally, after using it professionally for a year, I found coding in Visual Studio highly frustrating without it which made me go and buy it for personal use.
« Last Edit: April 12, 2015, 10:59:09 AM by MorleyDev » Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #2 on: April 13, 2015, 11:38:30 AM »

Interesting. It sounds like Visual AssistX for C# in that regard.

I may have to convince my work to get me a copy if I start doing more WPF again. I see it actually handles XAML too! That's pretty awesome.

Thanks for going over that Smiley

Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic