# 代码风格

### 标识符

不能以数字开头，可以包含大小写字母，数字，下划线

**易读** . 下划线，如 variable\_name . 驼峰，如 variableName

**语义** . 常量，大写，如 NAME

#### 空隙

常规空隙用ide格式化一下就好。

缩进：四个空格 &#x20;

一行的最大字符数：79  &#x20;

大括号： 换行或者不换行都行，但是要统一 &#x20;

空行分割不同的逻辑代码段

### c

函数的定义中，返回类型单独写一行，函数的名字另起一行。（大概是因为有头文件的原因）

### 参考

有实际参考的比如： &#x20;

* \[pointers on c -- chapter2.3 ]\(书籍)
* \[python的官方文档]\(<https://docs.python.org/3/tutorial/controlflow.html#intermezzo-coding-style>) &#x20;
* \[kotlin的官方文档]\(<https://www.kotlincn.net/docs/reference/coding-conventions.html>) &#x20;
* \[google风格文档]\(<https://google.github.io/styleguide/>)
* \[唯品会]\(<https://github.com/vipshop/vjtools>)
* \[阿里Java开发手册]..
* [https://nickjanetakis.com/blog/80-characters-per-line-is-a-standard-worth-sticking-to-even-today ](<https://nickjanetakis.com/blog/80-characters-per-line-is-a-standard-worth-sticking-to-even-today >) &#x20;

类型测试：<https://stitcher.io/blog/tests-and-types> &#x20;

```
为什么类型声明在右边：https://medium.com/@elizarov/types-are-moving-to-the-right-22c0ef31dd4a
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tpout.gitbook.io/workspace/common/dai-ma-feng-ge.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
