태그된 제품에 대해 수수료를 받습니다.
728x90
반응형
네이밍 컨벤션(naming convention)
소프트웨어 개발에서 변수, 함수, 클래스, 파일 등의 이름을 정하는 규칙이나 관례를 의미합니다.
네이밍 컨벤션은 코드의 가독성, 유지보수성, 일관성을 높이기 위해 사용되며,
팀 내 또는 프로젝트 내에서 개발자들 간의 협업을 원활하게 할 수 있도록 도와줍니다.
대표적인 네이밍 컨벤션
1. 카멜 표기법 (Camel Case)
소문자로 시작하고, 각 단어의 첫 글자는 대문자로 표기
예: firstName, getUserInfo
2. 파스칼 표기법 (Pascal Case)
모든 단어의 첫 글자를 대문자로 표기
예: FirstName, GetUserInfo
3. 스네이크 표기법 (Snake Case)
모든 단어를 소문자로 작성하며, 단어 사이를 언더스코어(_)로 구분
예: first_name, get_user_info
4. 케밥 표기법 (Kebab Case)
소문자 단어들 사이를 하이픈(-)으로 구분합니다. 주로 URL 또는 파일 이름에서 사용
예: first-name, get-user-info
5. 헝가리안 표기법 (Hungarian Notation)
변수의 데이터 타입이나 목적을 앞에 붙여 네이밍하는 방식
예: strName (문자열 변수), iCount (정수형 변수)
네이밍 컨벤션은 언어, 프레임워크, 팀의 문화에 따라 다를 수 있으며, 특정 컨벤션을 일관되게 따르는 것이 중요합니다.
728x90
반응형
태그된 제품에 대해 수수료를 받습니다.