KEMBAR78
Coding Standards & Conventions for Java and Rails projects | PDF
*




     * splash@dei.uc.pt   26	
  February	
  2011	
  
bonus tips
“
    ”
1     Indentation
1.1      Line length
1.2      Wrapping lines
1.3      Alignment
2     White space
2.1      Blank lines
2.2      Blank spaces
2.3      Trailing white space
3     Naming conventions
4     Declarations
4.1      Placement
5     Dead Code
6     Comments
6.1      Special comments
7     Parenthesis
1 - Indentation
1 - Indentation




     Because it is a Java language coding
       standard presented in the Java
      Language Specification, from Sun
                Microsystems
1 - Indentation




   Because of line wrapping,
    which will be explained
           later on
1 - Indentation




                  Because it is the
                  Ruby convention
1 - Indentation




                  Just because it makes
                      your life easier
1 - Indentation
1.1 – Indentation – Line length




    How it looks like using
      90 cols per line
1.2 – Indentation – Wrapping lines
1.3 – Indentation – Alignment
1.3 – Indentation – Alignment
2.1 – White space - Blank lines
2.2 – White space - Blank spaces
2.2 – White space - Blank spaces
2.3 – White space – Trailing white space




               http://andrei.gmxhome.de/anyedit/
3 – Naming conventions
3 – Naming conventions
4.1 – Declarations – Placement
5 – Dead Code
6.1 – Comments – Special comments
7 – Parenthesis




   By Noel Rappin, from http://www.pathf.com/blogs/2008/10/elements-of-ruby-style/.
7 – Parenthesis




   By Noel Rappin, from http://www.pathf.com/blogs/2008/10/elements-of-ruby-style/.
7 – Parenthesis




   By Noel Rappin, from http://www.pathf.com/blogs/2008/10/elements-of-ruby-style/.
1 – Commit messages
1   Reverting
2   Messages
1 – Reverting

                                                                                  DEV 1	

   DEV 2	





   By Taryn, from http://rubyglasses.blogspot.com/2007/08/actsasgoodstyle.html.
2 – Messages




  By Taryn, from http://rubyglasses.blogspot.com/2007/08/actsasgoodstyle.html.
1   Models
2   Views
3   Controllers
1 – Models




  By Taryn, from http://rubyglasses.blogspot.com/2007/08/actsasgoodstyle.html.
1 – Models




  By Taryn, from http://rubyglasses.blogspot.com/2007/08/actsasgoodstyle.html.
1 – Models




  By Taryn, from http://rubyglasses.blogspot.com/2007/08/actsasgoodstyle.html.
2 – Views




  By Neeraj Choudhary, from http://scribd.com/doc/2889649/Rails-coding-standards-defined.
3 – Controllers




   By Taryn, from http://rubyglasses.blogspot.com/2007/08/actsasgoodstyle.html.
*




     * splash@dei.uc.pt   26	
  February	
  2011	
  

Coding Standards & Conventions for Java and Rails projects