Posts Tagged ‘Convertion’

Refactorings for graphics – Convert to Size

March 23rd, 2012 Comments off

The Convert to Size refactoring from DevExpress Refactor! Pro consolidates selected numeric parameters into a System.Drawing.Size (System.Windows.Size in WPF projects) or SizeF object. It might be useful to combine two parameters into a single parameter, reducing the overall number of method parameters and increasing code readability.

Read more…

Converting methods to functions or procedures

October 31st, 2011 Comments off

The simplest type of method is one that performs a task without requiring any parameters and without returning any information – let’s call them procedures (or void methods). Methods that use some type as the return value – are functions.

Sometimes, when we declare a method with a return value, we may realize that we don’t actually need this return value, and instead, need a simple void method that does not return anything. On the other hand, we marked a method as void, but may require it to be a function, returning a value.

Read more…