GraphHopper.com | Forum | GitHub | Maps | Blog

Underscores in method names


#1

Is there any special intent for using underscores in some of the method names like
EdgeAccess#_getLinkPosInEdgeArea or EdgeAccess#setFlags_ ?
If yes, is there a difference between a leading and a trailing underscore ?


#2

I have no idea if this is the actual reason, but I think there was a time when private methods were started with an _, so make it clear to oder developers not to use this method outside of the class. I think this is still heavily used in other languages like Python and PHP. The trailing _ seem to be used to avoid naming conflicts. Since this is not Java naming standard, I would vote to rename the methods, unless there is a good reason for the naming, but I cannot see one right now.


#3

Yeah, these are probably private methods that clashed with some more public or some methods where access is too open and the underscore should indicate that they are not intended to be used outside. But why sometimes it is at the beginning and sometimes at the end I do not know :wink:

BTW: In #1112 those method are no longer necessary