Wednesday, July 13, 2011

Is renaming worth the effort?

"Is renaming worth the effort? Absolutely. Good code should communicate what it is doing clearly, and variable names are a key to clear code. Never be afraid to change the names of thing to improve clarity. (...)

Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

Code that communicates its purpose is very important. I often refactor just when I'm reading some code. That way as I gain understanding about the program, I embed that understanding into the code for later so I don't forget what I learned."

-- Martin Fowler in Refactoring

No comments:

Post a Comment