Archive

Posts Tagged ‘Readability’

Code Issues hints for declaration and initialization

October 12th, 2012 Comments off

Here are a few simple code issues of a hint type (suggestion) for declarations and initializations.

Read more…

Code Issues hints for expressions

September 28th, 2012 Comments off

Here are the code issues for different expressions. If the fix is applied, following a hint it may optimize the code and/or improve its readability.

Read more…

Code Issues of the dead code type for qualifiers

September 14th, 2012 Comments off

Here are some of the code issues of the dead code type that indicate redundant ‘this’ (‘Me’ in VB), ‘base’ (‘MyBase’ in VB) and type qualifiers.

Read more…

Coding Helpers – Add XML Comments

August 14th, 2012 Comments off

Programming languages such as C# and Visual Basic support the creation of XML Documentation Comments, allowing developers to quickly annotate and document their source code to keep the documentation in a standard format and to gain benefit from the information as you code. Documentation is important to ensure that developers can quickly learn and use the source code.

Read more…

Refactoring multi-conditional statements: the switch statement and the “if-else-if” ladder

April 30th, 2012 Comments off

There are two methods for multi-conditional processing: the “if-else-if” ladder and the switch statement. The If-Else-If ladder is a combination of ‘if’ and ‘else’ statements that is used to test a series of conditions. If the condition of the first ‘if’ statement is met, the code within the ‘if’ executes. Otherwise, the program flow is passed to the neighborhood ‘else’ statement, in which the next ‘if’ statement is located. This continues as a series of ‘if’ statements nested within the previous ‘else’ statements until all conditions have been checked. A default branch or a code block may be executed in a final ‘else’ statement if no condition is previously met.

Read more…

Refactorings – Reduce Visibility

February 13th, 2012 Comments off

Each member of a type declaration has an associated visibility (accessibility) modifier, which controls the access to this member for other members. The Reduce Visibility refactoring shipped in Refactor! Pro allows you to quickly reduce the visibility of a member to match the highest calling visibility, in other words, to restrict the visibility as much as possible.

Read more…

Refactorings that work with strings – Use Environment.NewLine

November 25th, 2011 Comments off

The Use Environment.NewLine refactoring is one of the simplest refactoring shipped in DevExpress Refactor! Pro which improves code portability. This refactoring replaces the “\r\n” string with the value of the Environment.NewLine property reference. The Environment.NewLine is a static string property from the System namespace that is tied to the current executing environment (platform). It returns a valid “line feed/carriage return” string that corresponds to the current operating system, for example: “\r\n” for Windows platforms, or a string containing just a line feed (“\n“) for Unix platforms.

Read more…

Refactorings that work with strings – Use StringBuilder

August 31st, 2011 Comments off

In addition to the refactorings that work with the concatenated strings and the String.Format call, there is another useful refactoring called Use StringBuilder. This refactoring replaces the string concatenation operations with corresponding methods of the StringBuilder class.

Read more…