 Google Python Style Guidespurious warnings should be fairly infrequent. Pros: Catches easy-to-miss errors like typos, using-vars-before-assignment, etc. 2 Cons: pylint isn’t perfect. To take advantage of it, we’ll need to sometimes: braces. Yes: spam(ham[1], {eggs: 2}, []) No: spam( ham[ 1 ], { eggs: 2 }, [ ] ) No whitespace before a comma, semicolon, or colon. Do use whitespace after a comma, semicolon, or colon except at the Yes: if x == 4: print x, y x, y = y, x No: if x == 4 : print x , y x , y = y , x No whitespace before the open paren/bracket that starts an argument list, in- dexing or slicing. Yes: spam(1) No: spam0 码力 | 30 页 | 94.81 KB | 1 年前3 Google Python Style Guidespurious warnings should be fairly infrequent. Pros: Catches easy-to-miss errors like typos, using-vars-before-assignment, etc. 2 Cons: pylint isn’t perfect. To take advantage of it, we’ll need to sometimes: braces. Yes: spam(ham[1], {eggs: 2}, []) No: spam( ham[ 1 ], { eggs: 2 }, [ ] ) No whitespace before a comma, semicolon, or colon. Do use whitespace after a comma, semicolon, or colon except at the Yes: if x == 4: print x, y x, y = y, x No: if x == 4 : print x , y x , y = y , x No whitespace before the open paren/bracket that starts an argument list, in- dexing or slicing. Yes: spam(1) No: spam0 码力 | 30 页 | 94.81 KB | 1 年前3
 Google C++ Style GuideDeclaration Order Use the specified order of declarations within a class: public: before private:, methods before data members (variables), etc. Your class definition should start with its public: section input-only parameters before any output parameters. In particular, do not add new parameters to the end of the function just because they are new; place new input-only parameters before the output parameters the older form, the return type appears before the function name. For example: int foo(int x); The new form, introduced in C++11, uses the auto keyword before the function name and a trailing return0 码力 | 83 页 | 238.71 KB | 1 年前3 Google C++ Style GuideDeclaration Order Use the specified order of declarations within a class: public: before private:, methods before data members (variables), etc. Your class definition should start with its public: section input-only parameters before any output parameters. In particular, do not add new parameters to the end of the function just because they are new; place new input-only parameters before the output parameters the older form, the return type appears before the function name. For example: int foo(int x); The new form, introduced in C++11, uses the auto keyword before the function name and a trailing return0 码力 | 83 页 | 238.71 KB | 1 年前3
 Google Java Style Guide(Note: this is not the same as the import statements being in ASCII sort order, since ‘.’ sorts before ‘;’.) 3.4 Class declaration 3.4.1 Exactly one top-level class declaration Each top-level class nonempty blocks and block-like constructs: • No line break before the opening brace. • Line break after the opening brace. • Line break before the closing brace. • Line break after the closing brace, only higher syntactic level. Also: 1. When a line is broken at a non-assignment operator the break comes before the symbol. (Note that this is not the same practice used in Google style for other languages, such0 码力 | 19 页 | 84.76 KB | 1 年前3 Google Java Style Guide(Note: this is not the same as the import statements being in ASCII sort order, since ‘.’ sorts before ‘;’.) 3.4 Class declaration 3.4.1 Exactly one top-level class declaration Each top-level class nonempty blocks and block-like constructs: • No line break before the opening brace. • Line break after the opening brace. • Line break before the closing brace. • Line break after the closing brace, only higher syntactic level. Also: 1. When a line is broken at a non-assignment operator the break comes before the symbol. (Note that this is not the same practice used in Google style for other languages, such0 码力 | 19 页 | 84.76 KB | 1 年前3
 Google's R Style GuideCommenting Guidelines: all comments begin with # followed by a space; inline comments need two spaces before the # 12. Function Definitions and Calls 13. Function Documentation 14. Example Function 15. TODO 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 < 0, 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, "campaign.id"]) # Needs spaces around <- total <- sum(x[0 码力 | 8 页 | 47.42 KB | 1 年前3 Google's R Style GuideCommenting Guidelines: all comments begin with # followed by a space; inline comments need two spaces before the # 12. Function Definitions and Calls 13. Function Documentation 14. Example Function 15. TODO 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 < 0, 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, "campaign.id"]) # Needs spaces around <- total <- sum(x[0 码力 | 8 页 | 47.42 KB | 1 年前3
 03 Experiments, Reproducibility, and Projects - Introduction to Scientific Writing WS2021/22Motivation  Worst Mistake: Schrödinger's Results  Postpone implementation and experiments till last before the deadline  No feedback, no reaction time (experiments require many iterations)  Karl Popper:0 码力 | 31 页 | 1.38 MB | 1 年前3 03 Experiments, Reproducibility, and Projects - Introduction to Scientific Writing WS2021/22Motivation  Worst Mistake: Schrödinger's Results  Postpone implementation and experiments till last before the deadline  No feedback, no reaction time (experiments require many iterations)  Karl Popper:0 码力 | 31 页 | 1.38 MB | 1 年前3
 01 Structure of Scientific Papers - Introduction to Scientific Writing WS2021/22Experiments  Worst Mistake: Schrödinger's Results  Postpone implementation and experiments till last before the deadline  No feedback, no reaction time (experiments require many iterations)  Karl Popper:0 码力 | 36 页 | 1.12 MB | 1 年前3 01 Structure of Scientific Papers - Introduction to Scientific Writing WS2021/22Experiments  Worst Mistake: Schrödinger's Results  Postpone implementation and experiments till last before the deadline  No feedback, no reaction time (experiments require many iterations)  Karl Popper:0 码力 | 36 页 | 1.12 MB | 1 年前3
共 6 条
- 1













