From: Russell G. <rus...@ac...> - 2001-10-22 16:20:55
|
At 08:54 AM 10/22/2001 -0700, Kent Beck wrote: >But what does "get" mean? It seems to mean "I'm sending a message and expect >a reply". That is obvious from context. > >I don't mean to re-start a war that has probably been fought 1000 times, but >under what circumstances do you have a method with a non-void return type >and you don't prefix its name with "get"? well, if it has a boolean value, you often prefix it's name with "is"... I agree with you that I don't like the 'get' prefix; however, with the introduction of JavaBeans in JDK 1.1, getXXX became a Java language naming convention. Most Java programmers now expect a getXXX method for any "property" of a class. For those of us who came to Java from other languages it is annoying - but it is widespread enough that it probably should not be changed. |