Google C++ Style Guidegovern our C++ code. The term Style is a bit of a misnomer, since these conventions cover far more than just source file formatting. Most open-source projects developed by Google conform to the requirements people are unlikely to do it anyway. This principle mostly explains the rules we don’t have, rather than the rules we do: for example, goto contravenes many of the following principles, but is already vanishingly most of our code than writing it. We explicitly choose to optimize for the experience of our av- erage software engineer reading, maintaining, and debugging code in our codebase rather than ease when writing0 码力 | 83 页 | 238.71 KB | 1 年前3
Google Python Style GuideCatches 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: a) Write around it b) Suppress its warnings or This is often useful for cleanup, i.e., closing a file. • When capturing an exception, use as rather than a comma. For example: try: raise Error except Error as error: pass Global variables link Avoid the use of map(), filter(), or lambda. Pros: Simple list comprehensions can be clearer and simpler than other list creation techniques. Generator expressions can be very efficient, since they avoid the0 码力 | 30 页 | 94.81 KB | 1 年前3
02 Scientific Reading and Writing - Introduction to Scientific Writing WS2021/22adopt. Some proof-of- concept experiments show that on a few data sets, the results are slightly better than the most naïve prior methods. 13 706.015 Introduction to Scientific Writing – 02 Scientific References Recommendations Avoid sections with only one subsection (e.g., 2 and 2.1) Avoid more than two or at most three nesting levels Clearly separate motivation/background from your own work Theorem, Definition, Examples Refine theorem environments as needed Algorithms Can be clearer than text, but not always Carefully select the right level of abstraction Scientific Writing 18 7060 码力 | 26 页 | 613.57 KB | 1 年前3
01 Structure of Scientific Papers - Introduction to Scientific Writing WS2021/22estimators Initially slow compressed operations cache-conscious operations, selected operations with better asymptotic behavior Structure of Scientific Papers 19 706.015 Introduction to Scientific Writing0 码力 | 36 页 | 1.12 MB | 1 年前3
Google's R Style Guideparenthesis, except in a function call. GOOD: if (debug) BAD: if(debug) Extra spacing (i.e., more than one space in a row) is okay if it improves alignment of equals signs or arrows (<-). plot(x = x.coord BAD: x = 5 Semicolons Do not terminate your lines with semicolons or use semicolons to put more than one command on the same line. (Semicolons are not necessary, and are omitted for consistency with covariance is to be calculated. # y: The other vector. x and y must have the same length, greater than one, # with no missing values. # verbose: If TRUE, prints sample covariance; if not, not. Default0 码力 | 8 页 | 47.42 KB | 1 年前3
Google Java Style Guidethat has a special escape sequence (\b, \t, \n, \f, \r, \", \' and \\), that sequence is used rather than the corresponding octal (e.g. \012) or Unicode (e.g. \u000a) escape. 2.3.3 Non-ASCII characters uppercase L suffix, never lowercase (to avoid confusion with the digit 1). For example, 3000000000L rather than 3000000000l. 5 Naming 5.1 Rules common to all identifiers Identifiers use only ASCII letters and capital letter T (examples: RequestT, FooBarT). 5.3 Camel case: defined Sometimes there is more than one reasonable way to convert an English phrase into camel case, such as when acronyms or unusual0 码力 | 19 页 | 84.76 KB | 1 年前3
共 6 条
- 1













