Skip to content

Coding Conventions

임성빈 edited this page Jan 14, 2024 · 3 revisions

Indent Rule:

Decide whether to use 2 spaces and use them consistently.

Of course, Eslint will solve it.

Naming rules:

Variables

Use concise names that convey meaning well. Instead of userCount, we prefer clear expressions such as numberOfUsers.

Functions/Methods

Use a combination of verbs and nouns to clearly express your intent.

Use it with getUserData or postUserData.

Class

Use Camel Case and select a name that illustrates the class's role or responsibility.

Tpye

Use Pascal Case, and for interfaces, put an I in front.

Annotation rules:

Add annotations to the logic where the purpose of the code is difficult to understand or important. Comments should be concise and clear, and they should serve to help you understand the code.

For annotation of a function, annotate the function in /** Here comes annotation */ above it to make it easier to see the annotation of the function in other files.

Code Structure Rules:

Group the relevant files in the appropriate directory and define file and directory naming rules. Minimize dependence between modules and define interfaces if necessary to promote modularity.

Code Style Rules:

Specify the position of brackets (e.g., on the next line or on the current line) Increase the readability of the code by limiting the length of a line.

Library and framework usage rules:

Be careful about version management when using external libraries or frameworks. Minimize external dependence and understand well through documents about the library you use.# Indent Rule Leave all spaces free of tabs

This is side bar

Clone this wiki locally