26 May 2008

Functional Style -- Highlight Mutable Variables

Once you go for lambdas, lazy computations and other functional techniques in programming, you may want your code to be mostly immutable. With ReSharper 4 we didn't do much about data analysis, like do not detect immutable objects or methods. However, one analysis is already available to you: highlight mutable local variables. Open Tools menu, select Options, browse for Fonts and Colors under Environment group. In the Display items find ReSharper Mutable Local Variable and change the appearance as you like. I use Bold font. ReSharper will now highlight every variable that changes its value after the value has been already used.

Try it, and tell us what do you think!

21 May 2008

ReSharper 4 Beta

Did you use one of the nightly builds we publish for several months already? If you thought it is dangerous for you to run early development bits, today we present you ReSharper 4 Beta, which we optimized, stabilized and verified to be of better quality than ordinary nightlies. It is not complete product yet, we have some more work to do in various areas of product, but otherwise this build is pretty stable and usable.

C# 3.0
This major language update was not an easy thing to support. It was tough to make it right, when tool knows the code inside out and understands every detail of what is written. There are many little things that you probably will not even notice, but which were well thought out and implemented to provide flawless code editing, navigating and refactoring experience.

I'd like to highlight some features: global completion for extension methods, which inserts required namespace imports; optional parameter info in form of lambda, like "IEnumerable<string> => string" instead of Func<IEnumerable<string>,string>; refactorings specific to new language features, like creating named type from anonymous one or converting static method to extension method and updating usages.

.NET Framework Annotations
Since version 2.5 we have "Null Reference Analysis", which is capable to warn developer about potential NullReferenceException in the code. To aid this analysis, developers can annotate methods with NotNull or CanBeNull attributes, which ReSharper then uses to initialize variable states. That's cool enough by itself, but there are thousands of methods you can't annotate in source: the .NET Framework assemblies. We took up a challenge and implemented the way to annotate libraries with external annotations. And we made second step, too. We annotated most of .NET Framework (56 assemblies!), so that you can get potential NullReferenceException warning on the code like (SomeStruct)Marshal.PtrToStructure(...);

Completion-on-steroids
That's something I like most. No, wait, I love new refactorings, recent edits window, to-do browser understanding of NotImplementedException, and all other features mentioned on the official site.

Two things: "CamelHumps Completion" and "Complete Statement" bring my coding speed to a new level. I don't know what it would be called in Jedi hierarchy, but it seems to me that I can create code with lightning teleportation speed.
if(CVM.I.SV(SCV.FU <Ctrl-Shift-Enter>
When I hit keys like above, it is completed into:
if (CodeViewManager.Instance.SupportsView(StandardCodeViews.FindUsages))
{
}
And caret is inside braces for me to type in the body of the "if" statement.

ASP.NET speed-up
The last, but not least thing I'd like to mention is our raid against ASP.NET problems. It is something that had speed and memory problems through all versions of ReSharper, and we finally managed to identify them, and fix. Now, if you develop ASP.NET web sites, go try ReSharper 4 Beta.

Download
In this release we bring you the single installer for both Visual Studio 2005 and 2008, as well as all editions we have. Download, install, select "Free Evaluation", choose edition - and you are ready to be productive.