변수명명법
-
개수를 뜻하는 변수는 어떻게 지어야할까? count? number?개발 흉내 2021. 3. 31. 11:04
객체가 있고 그 객체를 세어서 저장해야할 때가 있다. 보통 countOfItem 을 많이 사용했는데 오늘 JPA의 응답을 보니 numberOfElements 라는 속성이 보여서 당황스러웠다. cntOfItem 이나 numOfItem 같은 보편적인 줄임말도 지양하라는 글을 어디선가 봤는데 또 다른 고민이 생겼다. 개수를 표현하는 말로써 count와 number 중에 어떤게 더 타당할까? https://stackoverflow.com/questions/6358588/how-to-name-a-variable-numitems-or-itemcount How to name a variable: numItems or itemCount? What is the right way to name a variable int ..