LoginSignup
0
0

More than 3 years have passed since last update.

Naming Convention Pattern

Last updated at Posted at 2019-08-09

Capitalization

Title case

句の先頭が大文字で、単語区切りが半角スペース。

/**
 * Title case.
 */

lowercase

すべて小文字で、単語区切りなし。

public string lowercase = "string";

UPPER_CASE

すべて大文字で、単語区切りは_snake_caseの亜種。

public static string UPPER_CASE = "string";

CamelCase

UpperCamelCase

単語の先頭が大文字で、単語区切りなし。

別名:PascalCase, CapWords

public class UpperCamelCase {}

lowerCamelCase

句の先頭が小文字で、各単語の先頭が大文字で、単語区切りなし。

別名:dromedaryCase

public void lowerCamelCase(){}

snake_case

単語の先頭が小文字で、単語区切りはアンダースコア_

def snake_case():

Kebab-Case

単語の先頭は小文字・大文字問わないが統一させる、単語区切りはアンダースコア-

別名:lisp-case, COBOL-CASE, kebab-case or brochette-case

Get-Process

Underscore

_single_leading_underscore

伝統的に、Pythonではprivate変数を意味する。

def _private_method():
    pass

single_trailing_underscore_

__double_leading_underscore

__double_leading_and_trailing_underscore__

伝統的に、Python や C言語(gcc)では予約された特殊な変数名を意味し、ユーザは使ってはならない。

__init__
__line__
0
0
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
0
0