User Tools

Site Tools


development:ohdsi_code_style_for_r

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
development:ohdsi_code_style_for_r [2017/06/09 18:45]
chrisknoll
development:ohdsi_code_style_for_r [2018/02/18 15:37]
schuemie
Line 153: Line 153:
  
 ''#​ Plot data ---------------------------''​ ''#​ Plot data ---------------------------''​
 +
 +===== Curly brackets and new line =====
 +Opening curly brackets should precede a new line. A closing curly bracket should be followed by a new line except when it is followed by ''​else''​ or a closing parenthesis.
 +
 +**Good**
 +<​code>​
 +if (a == b) {
 +  doSomething()
 +} else {
 +  doSomethingElse()
 +}
 +</​code>​
 +
 +**Bad**
 +<​code>​
 +if (a == b) 
 +{
 +  doSomething()
 +
 +else 
 +{
 +  doSomethingElse()
 +}
 +</​code>​
 +
development/ohdsi_code_style_for_r.txt ยท Last modified: 2020/04/06 13:39 by schuemie