 Google Java Style Guidecharacters 2.3.1 Whitespace characters Aside from the line terminator sequence, the ASCII horizontal space char- acter (0x20) is the only whitespace character that appears anywhere in a source file. This implies the language or other style rules, and apart from lit- erals, comments and Javadoc, a single ASCII space also appears in the following places only. 1. Separating any reserved word, such as if, for or catch any open curly brace ({), with two exceptions: • @SomeAnnotation({a, b}) (no space is used) • String[][] x = {{"foo"}}; (no space is required between {{, by item 8 below) 4. On both sides of any binary or0 码力 | 19 页 | 84.76 KB | 1 年前3 Google Java Style Guidecharacters 2.3.1 Whitespace characters Aside from the line terminator sequence, the ASCII horizontal space char- acter (0x20) is the only whitespace character that appears anywhere in a source file. This implies the language or other style rules, and apart from lit- erals, comments and Javadoc, a single ASCII space also appears in the following places only. 1. Separating any reserved word, such as if, for or catch any open curly brace ({), with two exceptions: • @SomeAnnotation({a, b}) (no space is used) • String[][] x = {{"foo"}}; (no space is required between {{, by item 8 below) 4. On both sides of any binary or0 码力 | 19 页 | 84.76 KB | 1 年前3
 Google Python Style Guidesquares = [x * x for x in range(10)] eat(jelly_bean for jelly_bean in jelly_beans if jelly_bean.color == 'black') No: result = [(x, y) for x in range(10) for y in range(5) if x * y > 10] return ((x expres- sion. Yes: foo_bar(self, width, height, color='black', design=None, x='foo', emphasis=None, highlight=0) if (width == 0 and height == 0 and color == 'red' and emphasis == 'strong'): When a literal long_dictionary_key: value1 + value2, ... } # 4-space hanging indent; nothing on first line foo = long_function_name( var_one, var_two, var_three, var_four) # 4-space hanging indent in a dictionary foo = { long_dictionary_key:0 码力 | 30 页 | 94.81 KB | 1 年前3 Google Python Style Guidesquares = [x * x for x in range(10)] eat(jelly_bean for jelly_bean in jelly_beans if jelly_bean.color == 'black') No: result = [(x, y) for x in range(10) for y in range(5) if x * y > 10] return ((x expres- sion. Yes: foo_bar(self, width, height, color='black', design=None, x='foo', emphasis=None, highlight=0) if (width == 0 and height == 0 and color == 'red' and emphasis == 'strong'): When a literal long_dictionary_key: value1 + value2, ... } # 4-space hanging indent; nothing on first line foo = long_function_name( var_one, var_two, var_three, var_four) # 4-space hanging indent in a dictionary foo = { long_dictionary_key:0 码力 | 30 页 | 94.81 KB | 1 年前3
 Google C++ Style Guideare not part of Standard C++. More impor- tantly, they allocate a data-dependent amount of stack space that can trigger difficult-to-find memory overwriting bugs: “It ran fine on my machine, but dies mysteriously each binary produced, increasing com- pile time (probably slightly) and possibly increasing address space pres- sure. • The availability of exceptions may encourage developers to throw them when they are abbreviation. Give as descriptive a name as possible, within reason. Do not worry about saving horizontal space as it is far more important to make your code immediately understandable by a new reader. Do not use0 码力 | 83 页 | 238.71 KB | 1 年前3 Google C++ Style Guideare not part of Standard C++. More impor- tantly, they allocate a data-dependent amount of stack space that can trigger difficult-to-find memory overwriting bugs: “It ran fine on my machine, but dies mysteriously each binary produced, increasing com- pile time (probably slightly) and possibly increasing address space pres- sure. • The availability of exceptions may encourage developers to throw them when they are abbreviation. Give as descriptive a name as possible, within reason. Do not worry about saving horizontal space as it is far more important to make your code immediately understandable by a new reader. Do not use0 码力 | 83 页 | 238.71 KB | 1 年前3
 Google's R Style Guide10. General Layout and Ordering 11. Commenting Guidelines: all comments begin with # followed by a space; inline comments need two spaces before the # 12. Function Definitions and Calls 13. Function Documentation Exception: Spaces around =’s are optional when passing parameters in a function call. Do not place a space before a comma, but always place one after a comma. GOOD: tab.prior <- table(df[df$days.from.opt table(df[df$days.from.opt < 0,"campaign.id"]) # Needs a space after the comma tab.prior<- table(df[df$days.from.opt < 0, "campaign.id"]) # Needs a space before <- tab.prior<-table(df[df$days.from.opt < 0,0 码力 | 8 页 | 47.42 KB | 1 年前3 Google's R Style Guide10. General Layout and Ordering 11. Commenting Guidelines: all comments begin with # followed by a space; inline comments need two spaces before the # 12. Function Definitions and Calls 13. Function Documentation Exception: Spaces around =’s are optional when passing parameters in a function call. Do not place a space before a comma, but always place one after a comma. GOOD: tab.prior <- table(df[df$days.from.opt table(df[df$days.from.opt < 0,"campaign.id"]) # Needs a space after the comma tab.prior<- table(df[df$days.from.opt < 0, "campaign.id"]) # Needs a space before <- tab.prior<-table(df[df$days.from.opt < 0,0 码力 | 8 页 | 47.42 KB | 1 年前3
 02 Scientific Reading and Writing - Introduction to Scientific Writing WS2021/22Scientific Writing “The paper’s approach is probably equally sloppy” Looks ugly and wastes lots of space 19 706.015 Introduction to Scientific Writing – 02 Scientific Reading and Writing Matthias Boehm Never Excuse Missing Content by “lack of space” Scientific Writing [Credit: https://twitter.com/ fadeladib/status/132264640 6088347649] Due to the lack of space, we omit [essential details] / [essential0 码力 | 26 页 | 613.57 KB | 1 年前3 02 Scientific Reading and Writing - Introduction to Scientific Writing WS2021/22Scientific Writing “The paper’s approach is probably equally sloppy” Looks ugly and wastes lots of space 19 706.015 Introduction to Scientific Writing – 02 Scientific Reading and Writing Matthias Boehm Never Excuse Missing Content by “lack of space” Scientific Writing [Credit: https://twitter.com/ fadeladib/status/132264640 6088347649] Due to the lack of space, we omit [essential details] / [essential0 码力 | 26 页 | 613.57 KB | 1 年前3
共 5 条
- 1













