determining which verb to use for method names in Java

后端 未结 7 2212
半阙折子戏
半阙折子戏 2021-01-30 23:02

I understand that naming conventions are important for a number of reasons, most having to do with making your code more readable and easier to integrate into larger projects, e

7条回答
  •  自闭症患者
    2021-01-30 23:24

    (My opinion) You don't need a verb in the method name if the object has no state, like a math-library. Compare computeSquareRoot(x) and getJoin(listOfStrings) with squareRoot(x) and join(listOfStrings).

提交回复
热议问题