I have been reading Refactoring: Improving the Design of Existing Code by Martin Fowler and came across a statment from Chapter 8 that seemed rather ironic. "Magic numbers, numbers with special meaning, have long been a problem. I remember being told in my earliest programming days not to use them." To me, this statement does not go far enough. I believe that magic strings are equally odious.
I am certainly a big offender, but I am getting better. The reason that this seems pretty ironic for me is that the entire book uses examples written in Java. I have programmed in Java for a couple years and while the language is OK, it seemed to me to violate this very simple tenet. The problem is that there are lots of places in Java where giving a method a "special" name changes the way the method is handled.
Java, the language, does not understand the concept of Properties. You have fields and you have methods. Yet Sun and the rest of the Java community really like the concept of properties. The Solution: If you name your methods getSomeValue and setSomeValue and use the specified method signature then we can pretend they are property accessors. The major IDEs treat these methods as properties, yet to the compiler they are nothing but another method. To me having special "names" is only one step removed from magic numbers and magic strings.
To me it is one thing to follow naming conventions so that it is easier to read someone elses code. It is something else altogether to alter your tool or system behavior based on those naming conventions. And that is why I prefer C# and VB to programming in Java. To me Java properties seem like a hack rather than a fully supported language feature.