On Mon, Aug 9, 2010 at 3:49 PM, Fabrizio Giudici < fabrizio.giud...@tidalwave.it> wrote:
> > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 8/9/10 15:33 , Viktor Klang wrote: > >> May I ask how you figure it's easier to misuse a symbol than a > >> word? (wrong implementation of equals and hashCode is one of the > >> most common java problems.) > For the same reason it's considered a good practice to have long > identifiers with self describing names. Single characters are at the > opposite side. Of course, single-character operators are excellent > when they are backed up by a specific formalism, such as maths. But > the problem is that now we're requiring people to know that formalism > (of course, + - and such on vectors or matrices or complex numbers is > not a problem). In some cases, even the formalism is not enough: I > could implement an integral operation with an operator, but when we > move from maths to computer science there are many alternate ways to > approximate the value of an integral. Which way does that > "integral-symbol" operator mean? > So basically what you're saying that we have a problem where we cannot assign a verified contract with the symbols/words? if the equals-method was linked to a contract that was tested against your implementations/overrides of it, I, by learning that contract, could instinctively know what the equals-method does? Another good example is java.net.URL whose hashCode does a call to teh intarwebz: http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html > > - -- > Fabrizio Giudici - Java Architect, Project Manager > Tidalwave s.a.s. - "We make Java work. Everywhere." > java.net/blog/fabriziogiudici - www.tidalwave.it/people > fabrizio.giud...@tidalwave.it > -----BEGIN PGP SIGNATURE----- > Version: GnuPG/MacGPG2 v2.0.14 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAkxgB4YACgkQeDweFqgUGxdUKgCfW6Q1qN4V8m7ATPpxAwsT7V+s > de0An2g03z3fOpXo9n6eViKf273GxqRV > =jboE > -----END PGP SIGNATURE----- > > -- > You received this message because you are subscribed to the Google Groups > "The Java Posse" group. > To post to this group, send email to javapo...@googlegroups.com. > To unsubscribe from this group, send email to > javaposse+unsubscr...@googlegroups.com<javaposse%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/javaposse?hl=en. > > -- Viktor Klang, Code Connoisseur Work: www.akkasource.com Code: github.com/viktorklang Follow: twitter.com/viktorklang Read: klangism.tumbler.com -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to javapo...@googlegroups.com. To unsubscribe from this group, send email to javaposse+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.