LoginSignup
3
4

More than 3 years have passed since last update.

キャメルケースとスネークケース

Posted at

キャメルケース

companyIdblogCategoryのように2語3語と単語同士をつづけた書く書き方。

  • 先頭の単語が小文字

    • 関数名は先頭小文字。例:createBlogCategory()
    • 変数名(引数名)は先頭小文字。例:companyId
  • 先頭の単語が大文字をパスカルケースまたはアッパーキャメルケースと呼ぶ

    • class名は先頭大文字。例:BlogCategory

スネークケース

company_idblog_catefgoryのように2語3語と単語同士をアンダーバーで挟んでつなげる書き方。

  • 定数はすべて大文字。例:BLOG_CATEGORY
  • データベースなどで使われます。

ケバブケース

company-idblog-catefgoryのように2語3語と単語同士をハイフンで挟んでつなげる書き方。

  • HTMLのclass名で使われます。
3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4