Keep your code tidy with JustCode

by Just* Team | Comments 7

For the 2011 Q1 release Telerik JustCode brought to its users the ability to easily reorganize code - solution, project or folder wise. One major release later - 2011 Q2, taking into account your feedback, the JustCode Cleaner has now grown even more.

With only few clicks you can change thousands of lines of code to match your requirements. Just right-mouse-click in the Solution Explorer on your solution and select Just Clean All... from the menu or you can do it folder by folder and project by project. You will see a window with available options. Two default profiles are provided (Basic and Full), but custom profiles can also be created.

 

If you select Format Code, your code will be formatted based on the settings in JustCode -> Options -> Code Style. We really wanted for the user to control every new line and white space, so there are a lot of settings there to alter.

Another cleaning step which was requested a lot is Reorder Using Directives, we listen so now you have it. When you select it, all of your using directives will be reordered alphabetically:

 

The Introduce File Header Text cleaning step will add the specified header in JustCode -> Options -> Code Style -> Common to all your files. You can read more about the command itself here.

We have also added several steps to remove useless code: Remove redundant casts, Remove empty statements, Remove redundant overrides, Remove unused variables, Remove unused private members and Remove unused using directives. All of those were previously available for specific places in your code as quick-fixes, now you can execute them for your whole solution with just few clicks.

You want the read only fields to be consistent with their purpose and have the readonly modifier used? Easily done. Just select Make private fields readonly where possible and all your private fields which are used only in constructors for writing in them will be made readonly.

And last but not least for today: Use String.Format() where possible. By selecting it you will have all your addition expression, which you have used to construct a string, replaced by the more clear for the eye String.Format() method. More about the command - here .

 

When the code cleaning is over, all edited files will be opened if you choose to – that way you won’t miss any change made and you will be able to undo it.

You can also clean only the current file, using the default profile (which can be changed by clicking Set as Default from the Code Cleaning Options shown above), by going to JustCode -> Code -> Clean Code with Default Profile or use the provided shortcut: Ctrl + Shift + Alt + F.

So, let’s wrap this up. We hope you like the new additions to Telerik JustCode, there is much more to come. If you have any feedback, something you’d like to see in JustCode – do write to us (in forum or in support)

Happy coding!

The JustCode Team

About the author

Chris Eargle

Chris Eargle

is a Telerik Technical Evangelist and Microsoft C# MVP with over a decade of experience designing and developing enterprise applications, and he runs the local .NET User Group: the Columbia Enterprise Developers Guild. He is a frequent guest of conferences and community events promoting best practices and new technologies. Chris is a native Carolinian; his family settled the Dutch Form region of South Carolina in 1752. He currently resides in Columbia with his wife, Binyue, his dog, Laika, and his three cats: Meeko, Tigger, and Sookie. Amazingly, they all get along... except for Meeko, who is by no means meek.

Posted in: justcode

7 Comments

Jaime Bula
String.Format() feature, should use the Invariant Culture Paramenter as a default.                
John Smith
Wow, these are really great features! And they've been available in ReSharper for no more than 4 years.
Martin
Why can't the telerik blog posts be read in google reader? It only shows asmall part of the blog posts and I have to click a link to visit blogs.telerik.com.
Stefan Dobrev
H John Smith (or whoever you are),

You are absolutely right that R# has those features for quite some time now. We have a deep respect for the R# product, because it is a great and mature tool. Actually it has been for 7 years on the market, whereas JustCode is relatively new - first release was in late 2009. We have a long road ahead of us, but we are still able to be first in some areas - for example you can look at our industry first Visual Studio Async support here. As an ending if you would like to see more features from R# implemented in JustCode please share them through the channels mentioned in the end of the blog post.

All the best,
Stefan Dobrev

Jeff
@John
Tried to do this for an entire project with ReSharper 6 and my Visual Studio crashed. Oh well... will try again in 4 years. JustCode stays.
Stefan Avramov
Hi Jaime,
Thanks for the feedback. We will consider your request and see what's the best approach there, maybe an option.
Regards,
Stefan Avramov
Arran
Have got JustCode, stayed with it after trying Resharper.
Whilst Justcode is not as fully featured (but here's to hoping it can be), it is not as much of a hungry hippo as Resharper is. Resharper crawls my whole machine to a complete standstill - whilst JustCode flies!

Comments

  1.    
      
      
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)
Read more articles by Just* Team - or - read latest articles in Developer Tools