☑️ 코드 컨벤션

<aside> <img src="https://cdn-icons-png.flaticon.com/512/7350/7350737.png" alt="https://cdn-icons-png.flaticon.com/512/7350/7350737.png" width="40px" /> 문자열을 처리할 때는 쌍따옴표를 사용하도록 합니다.

// Good
public int someFunction() {
  ...
	// good
  String statements = "값 입니다."
}

</aside>

<aside> <img src="https://cdn-icons-png.flaticon.com/512/7500/7500264.png" alt="https://cdn-icons-png.flaticon.com/512/7500/7500264.png" width="40px" /> 문장이 종료될 때는 세미콜론을 붙여줍니다.

public int someFunction() {
  ...
	// good
  int statements;
}

</aside>

<aside> 🐫 함수명, 변수명은 카멜케이스로 작성합니다.

// Good
public int someFunction() {
  ...
	// good
  int statements;
}

</aside>

<aside> ☝ 가독성을 위해 한 줄에 하나의 문장만 작성합니다.

// Good
public int someFunction() {
  ...
	// bad
  int statements1; int statements2; 
  
  // good
  int statements3;
}

</aside>

<aside> <img src="https://cdn-icons-png.flaticon.com/512/3602/3602241.png" alt="https://cdn-icons-png.flaticon.com/512/3602/3602241.png" width="40px" /> 주석은 설명하려는 구문에 맞춰 들여쓰기 합니다.

// Good
public int someFunction() {
  ...

  // statement에 관한 주석
  statements
}

</aside>

<aside> <img src="https://cdn-icons-png.flaticon.com/512/3978/3978575.png" alt="https://cdn-icons-png.flaticon.com/512/3978/3978575.png" width="40px" /> 연산자 사이에는 공백을 추가하여 가독성을 높입니다.

a+b+c+d // bad
a + b + c + d // good

</aside>

<aside> ☝ 콤마 다음에 값이 올 경우 공백을 추가하여 가독성을 높입니다.

int[] arr = [1,2,3,4]; //bad
int[] arr = [1, 2, 3, 4]; //good

</aside>

<aside> 🔠 생성자 함수명의 맨 앞글자는 대문자로 합니다.

public Person(){}

</aside>


☑️ 코드 컨벤션이 필요한 이유

참고

코딩컨벤션