User Tools

Site Tools


stephens_coding_standards

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
stephens_coding_standards [2013/03/25 03:53] – [Switch Case] stephenstephens_coding_standards [2017/01/01 20:05] (current) – external edit 127.0.0.1
Line 1: Line 1:
-<term YAGNI>You Ain't Gunna Need It</term> 
- 
 ====== Stephen's Coding Standards ====== ====== Stephen's Coding Standards ======
  
 ===== Commented Code ===== ===== Commented Code =====
  
-No commented code, unless there is a comment clearly explaining under what circumstances the code should be uncommented. The YAGNI principle should be kept in mind. If there are no circumstances in which the code should be uncommented, it should be deleted.+No commented code, unless there is a comment clearly explaining under what circumstances the code should be uncommented. The <html><acronym title="You Ain't Gunna Need It">YAGNI</acronym></html> principle should be kept in mind. If there are no circumstances in which the code should be uncommented, it should be deleted.
  
 **Justification:** Commented code adds no value to the source. It does not clarify or explain functionality. It is old rubbish that should be removed. Source control is for looking at old code. **Justification:** Commented code adds no value to the source. It does not clarify or explain functionality. It is old rubbish that should be removed. Source control is for looking at old code.
Line 68: Line 66:
  
 To get a visual margin guide in Visual Studio 2010, ensure the Productivity Power Tools extension is installed, right click the 130th column and select Guidelines -> Add Guidelines from the context menu. To get a visual margin guide in Visual Studio 2010, ensure the Productivity Power Tools extension is installed, right click the 130th column and select Guidelines -> Add Guidelines from the context menu.
 +
 +===== Blank Lines =====
 +
 +Code shall not contain more than one blank line in a row. There's just no need.
  
 ===== Unnecessary Parentheses ===== ===== Unnecessary Parentheses =====
Line 108: Line 110:
   * To do a comparison like a human, use ''StringComparison.CurrentCulture'' or ''StringComparison.CurrentCultureIgnoreCase''.   * To do a comparison like a human, use ''StringComparison.CurrentCulture'' or ''StringComparison.CurrentCultureIgnoreCase''.
   * It is extremely unlikely that ''StringComparison.InvariantCulture'' or ''StringComparison.InvariantCultureIgnoreCase'' would ever need to be used.   * It is extremely unlikely that ''StringComparison.InvariantCulture'' or ''StringComparison.InvariantCultureIgnoreCase'' would ever need to be used.
 +
 +==== Machine or Human? WTF? ====
  
 The German alphabet has the letter '[[http://en.wikipedia.org/wiki/%C3%9F|ß]]', which basically means 'double S'. So a German-speaking human will see 'Boss' and 'Boß' as meaning exactly the same thing. A machine won't: The German alphabet has the letter '[[http://en.wikipedia.org/wiki/%C3%9F|ß]]', which basically means 'double S'. So a German-speaking human will see 'Boss' and 'Boß' as meaning exactly the same thing. A machine won't:
Line 173: Line 177:
  
 The names of user database objects are title cased (tables, columns, views, stored procedures etc.) The names of user database objects are title cased (tables, columns, views, stored procedures etc.)
 +
 +===== Web.config =====
 +
 +The ''<connectionStrings>'' section shall be directly after the ''<configSections>'' section if it exists or the first element in the ''<configuration>'' if it does not.
  
 {{tag>code standard rant}} {{tag>code standard rant}}
  
stephens_coding_standards.1364183586.txt.gz · Last modified: 2017/01/01 19:53 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki