Bibi's DevLog ๐Ÿค“๐ŸŽ

Camel case, Kebab case, Snake case ๊ทธ๋ฆฌ๊ณ  Pascal case ๋ณธ๋ฌธ

๐Ÿ–ฅ BE ๋ฐฑ์—”๋“œ

Camel case, Kebab case, Snake case ๊ทธ๋ฆฌ๊ณ  Pascal case

๋น„๋น„ bibi 2021. 3. 17. 00:27

Camel case, Kebab case, Snake case ๊ทธ๋ฆฌ๊ณ  Pascal case

์œ„ ๋งํฌ์—์„œ ๋„ˆ๋ฌด ์„ค๋ช…์„ ์ž˜ ํ•ด์ฃผ์…”์„œ ๋‚˜๋Š” ์š”์•ฝ์ •๋ฆฌ๋งŒ ํ–ˆ๋‹ค!

  • -case ๊ทœ์น™์œผ๋กœ ๋„ค์ด๋ฐ์„ ํ•˜๋Š” ์ด์œ ?

    • ํ”„๋กœ๊ทธ๋ž˜๋ฐ์—์„œ ๊ณต๋ฐฑ์„ ์ œ๊ฑฐํ•˜๊ธฐ ์œ„ํ•ด์„œ์ด๋‹ค.
  • Camel Case

    • ๋‚™ํƒ€ ํ˜น์ฒ˜๋Ÿผ ์˜ค๋ฅด๋ฝ๋‚ด๋ฆฌ๋ฝํ•ด์„œ camel case์ž„
    • ์ฒซ ๋ฌธ์ž๋ฅผ ์ œ์™ธํ•˜๊ณ  ๋‹จ์–ด์˜ ์ฒซ ๊ธ€์ž๋ฅผ ๋Œ€๋ฌธ์ž๋กœ ํ‘œ๊ธฐ
    • My Visitor Count -> myVisitorCount
  • Snake Case

    • ์–ธ๋”์Šค์ฝ”์–ด(_)๋ฅผ ๊ตฌ๋ถ„์ž๋กœ ํ•œ ํ‘œ๊ธฐ๋ฐฉ์‹
    • My Visitor Count -> my_visitor_count
    • ์ƒ์ˆ˜์˜ ๊ฒฝ์šฐ MY_VISITOR_COUNT์™€ ๊ฐ™์ด ๋ชจ๋‘ ๋Œ€๋ฌธ์ž๋กœ ํ‘œ๊ธฐ
    • ์ฃผ๋กœ ์ƒ์ˆ˜ ํ‘œํ˜„์— ์‚ฌ์šฉ
  • Kebab Case

    • ๋จน๋Š” ์ผ€๋ฐฅ์—์„œ ์œ ๋ž˜ํ•จ
    • ๋Œ€์‹œ(-)๋ฅผ ๊ตฌ๋ถ„์ž๋กœ ํ•˜๋ฉฐ, ๋ชจ๋‘ ์†Œ๋ฌธ์ž๋กœ ํ‘œ๊ธฐํ•จ
    • My Visitor Count -> my-visitor-count
    • URL์ฃผ์†Œ, ์Šคํ”„๋ง ymlํŒŒ์ผ์— ์‚ฌ์šฉ
    • HTMLํƒœ๊ทธ์˜ id, class ์†์„ฑ์œผ๋กœ ์‚ฌ์šฉ
  • Pascal Case

    • ์นด๋ฉœ ์ผ€์ด์Šค์™€ ์œ ์‚ฌํ•˜๋‚˜ ์ฒซ ๋ฌธ์ž๊นŒ์ง€ ๋Œ€๋ฌธ์ž๋กœ ํ‘œํ˜„.
    • My Visitor Count -> MyVisitorCount