November 30, 2021 https://github.com/kettanaito/naming-cheatsheet

1. S-I-D 짧고, 직관적이며, 설명적

A name must be shortintuitive and descriptive: 이름은 짧고 직관적이며 설명적이어야 합니다.

/* Bad */
const a = 5 // "a" could mean anything
const isPaginatable = a > 10 // "Paginatable" sounds extremely unnatural
const shouldPaginatize = a > 10 // Made up verbs are so much fun!

/* Good */
const postCount = 5
const hasPagination = postCount > 10
const shouldPaginate = postCount > 10 // alternatively

2. Avoid contractions

약어를 사용하지 말자

/* Bad */
const onItmClk = () => {}

/* Good */
const onItemClick = () => {}

3. Avoid context duplication

문맥 중복 피하기

class MenuItem {
  /* Method name duplicates the context (which is "MenuItem") */
  handleMenuItemClick = (event) => { ... }

  /* Reads nicely as `MenuItem.handleClick()` */
  handleClick = (event) => { ... }
}

4. Reflect the expected result

이름은 예상 결과를 반영해야 합니다.

/* Bad */
const isEnabled = itemCount > 3
return <Button disabled={!isEnabled} />
// 부정문 !을 써주지 말고 이름을 직관적으로 지어주자

/* Good */
const isDisabled = itemCount <= 3
return <Button disabled={isDisabled} />