Google Java Style Guidewhitespace characters in string and character literals are escaped. 2. Tab characters are not used for indentation. 2.3.2 Special escape sequences For any character that has a special escape sequence (\b, \t multiple blocks: if/else-if/else or try/catch/finally). Example: void doNothing() {} 4.2 Block indentation: +2 spaces Each time a new block or block-like construct is opened, the indent increases by two When there are multiple continuation lines, indentation may be varied beyond +4 as desired. In general, two continuation lines use the same indentation level if and only if they begin with syntactically0 码力 | 19 页 | 84.76 KB | 1 年前3
Google Python Style GuideDecorators Threading Power Features 1 Python Style Rules Semicolons Line length Parentheses Indentation Blank Lines Whitespace Shebang Line Comments Classes Strings Files and Sockets TODO Comments Imports 0/csv_file_name_extension_full_specification.html Make note of the indentation of the elements in the line continuation examples above; see the indentation section for explanation. Parentheses link Use parentheses bar() return foo for (x, y) in dict.items(): ... No: if (x): bar() if not(x): bar() return (foo) Indentation link Indent your code blocks with 4 spaces. Never use tabs or mix tabs and spaces. In cases0 码力 | 30 页 | 94.81 KB | 1 年前3
Google C++ Style Guidenamespace mynamespace { // All declarations are within the namespace scope. // Notice the lack of indentation. class MyClass { public: ... void Foo(); }; } // namespace mynamespace // In the .cc file namespace extensively). Spaces vs. Tabs Use only spaces, and indent 2 spaces at a time. We use spaces for indentation. Do not use tabs in your code. You should set your editor to emit spaces when you hit the tab key parenthesis and the open curly brace. • All parameters should be aligned if possible. • Default indentation is 2 spaces. • Wrapped parameters have a 4 space indent. Unused parameters that are obvious from0 码力 | 83 页 | 238.71 KB | 1 年前3
Google's R Style Guidename (or variableName), FunctionName, kConstantName 3. Line Length: maximum 80 characters 4. Indentation: two spaces, no tabs 5. Spacing 6. Curly Braces: first on same line, last on own line 7. else: match (e.g., lm). • kConstantName Syntax Line Length The maximum line length is 80 characters. Indentation When indenting your code, use two spaces. Never use tabs or mix tabs and spaces. Exception: When0 码力 | 8 页 | 47.42 KB | 1 年前3
共 4 条
- 1













