Source code structure 代码结构
Separate concepts vertically.
Related code should appear vertically dense.
Declare variables close to their usage.
Dependent functions should be close.
Similar functions should be close.
Place functions in the downward direction.
Keep lines short.
Don't use horizontal alignment.
Use white space to associate related things and disassociate weakly related.
Don't break indentation.
用空行分割不同概念的代码。
相关的代码应该放在一块。
变量在使用前声明。
依赖的函数应靠近。
功能相似的函数应靠近。
被调用的函数在下面。
代码行要短。
不要水平对齐。
勿破坏缩进。
Last updated
Was this helpful?