Refactoring vs Just Changin' Crap
hamletdarcy.blogspot.com
hamletdarcy.blogspot.com
Moving from C to Java you really appreciate tools like IntelliJ and Eclipse which can automate some refactorings with a fairly high amount of certainty that it's not going to change the behaviour.
Enough certainty that you won't want to test it?
For example, they might make mistakes, like changing only the code references and not the comments; or be mildly annoying by screwing up indentation.
I feel better being forced to visit every line, to see the whole scope of the change and realize just what it's doing to the code. Occasionally, this has made me realize that the refactor is not even the right thing to do. Also, it is one of the few chances I have to force myself to read code that I don't visit often; it can result in me writing down a few other things to go back and fix later (a mini-code-review, basically).
Don't get your value EQUALITY and pointer equality or IDENTITY confused, hacker!
http://www.nhplace.com/kent/PS/EQUAL.html
When speaking with arab-speaking programmers, I find myself using the translation of words like "congruence" more often. It actually sounds better in arabic too:
"yusawi" --> equals
"yuwazi" --> is similar/congruent to
"Equal", however, means neither equivalence nor identity; it's generally just a math term, meaning "identical/equivalent in magnitude" (where numbers are the only things for which "equivalence" is "identity.") Phrases like "equal rights" imply that the total value of the rights can be reduced to a number, and compared; to put it another way, that the rights are sortable. "Equal" has no meaning for things which cannot be sorted—there can be "equivalent paintings", or "identical paintings", but never "equal paintings."
"Equal" is basically the worst possible term to have absorbed for talking about the comparison of anything other than numbers. The underlying comparison is always one of either identity, or equivalence, and this should be simply stated outright—it causes no confusion, nor are there any special cases for which "equal" is necessary.
That's still a minority of the objects we deal with in programming, though, and again, there's no reason to say "equals" when you can specify "is equivalent to" or "is identical to" instead; value objects will happily give you your expected answer under either comparison, and it will force you to define the comparison for business/model objects (that is, those with IDs) as well.