Refactoring

Code refactoring means spring cleaning existing code. It usually implies changing the way the code is expressed without modifying what it does.

A refactor could improve code readability, reduce complexity, increase mainanability, etc.

A simple example could be improving the expressiveness of code by renaming variables. Silly example below: class Rm  def initialize (n, a, v)     @n = n.to_i @a = a    @v = v   end end
 * 1) Original code

class Room def initialize (no_of_windows, floor_area, volume) @no_of_windows = no_of_windows @floor_area = floor_area @volume = volume end end # aah, much better
 * 1) Refactored code

Uncategorized Links

 * (Refactoring in Java, correlate with Rubty workbook) --> Refactoring in Ruby (workbook and cheatsheet )
 * Video at Sunny Conf 2010