Changes between Version 28 and Version 29 of TracDev/CodingStyle
- Timestamp:
- Dec 16, 2015, 12:51:11 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/CodingStyle
v28 v29 50 50 * Avoid using `except Exception`, instead making the exception clause as narrow as necessary to catch the excepted exception. 51 51 52 == Java Script52 == Javascript 53 53 54 !JavaScript code should follow [http://javascript.crockford.com/code.html these conventions] with the following exceptions and additions:54 Javascript code should follow [http://javascript.crockford.com/code.html these conventions] with the following exceptions and additions: 55 55 * Lines shouldn't exceed a length of 79 characters. 56 56 * Use two spaces for indentation and refrain from using tabs. … … 67 67 * Omit the curly braces for variables in Genshi templates, using `$var` rather than `${var}`. 68 68 69 == SQL 70 71 While the Python and Javascript coding conventions differ from the SQL coding conventions, it is still important that we have them for code consistency and code legibility. Both of these make SQL code maintenance easier. 72 * Table and column names are singular and lowercase. 73 * Separate by underscore: `milestone_name` instead of `milestonename`. 74 * Reserved words are uppercase: `SELECT` instead of `select`, `INTEGER` instead of `integer`. 75 * Avoid abbreviations and if you have to use them make sure they are commonly understood. 76 * Do not prefix with `tbl` or any other prefix or Hungarian notation. 77 * Do not give a table the same name as one of its columns and vice versa. 78 79 When presenting SQL code in the wiki, use the #sql preprocessor, as in `{{{!#sql`, so that the code highlights neatly. 80 69 81 ---- 70 82 See also: TracDev