카멜케이스 camelCase(lowerCamelCase, UpperCamelCase), 스네이크케이스 snake_case(Train_Case, spinal_case) 표기법

Song·2022년 8월 1일
0

프로그래밍 네이밍컨벤션 종류 여러가지에 대한 설명이다!

먼저 카멜케이스는 여러 단어가 합쳐졌을 때, 각 단어의 맨 첫글자를 알파벳 대문자로 표기하는 방법이다. 카멜케이스(camelCase)에는 두 종류가 있는데 lowerCamelCase, UpperCamelCase가 있다. 이 중 UpperCamelCase는 PscalCase라고도 한다!

CamelCase - lowerCamelCase

lowerCamelCase는 맨 앞글자를 알파벳 소문자로 표기하고, 두번째 단어부턴 대문자로 표기하는 것이다.

ex) buttonComponent, arrowComponent, ...

CamelCase - UpperCamelCase(=PascalCase)

UpperCamelCase(PascalCase)는 맨 앞글자부터 알파벳 대문자로 표기하는 것이다. 동일하게 두번째 이후 단어의 첫글자도 알파벳 대문자로 표기한다.

ex) ButtonComponent, ArrowComponent, ...

스네이크케이스는 단어사이에 언더라인(_)을 붙이는 방법이다. 스네이크케이스는 Train_Case와 spinal_case 두가지가 있다.

snake_case - Train_Case

Train_Case는 각 단어의 앞글자를 알파벳 대문자로 표기하는 것이다.

ex) Button_Component, Arrow_Component, ...

snake_case - spinal_case

spinalcase는 언더바()로만 구분하고 각 단어의 앞글자는 알파벳 소문자로 표기하는 것이다.

ex) button_component, arrow_component, ...
profile
Hello, My World!

0개의 댓글