15
Why Coding Conventions ?

Why coding convention ?

Embed Size (px)

Citation preview

Page 1: Why coding convention ?

Why Coding Conventions ?

Page 2: Why coding convention ?

–Wikipedia

“a set of guidelines for a specific programming language that recommend programming style,

practices and methods for each aspect of a piece program”

Page 3: Why coding convention ?

in most cases, we’ll write

in a style that we want

$userName $username $user_name

Page 4: Why coding convention ?
Page 5: Why coding convention ?

consistent

Page 6: Why coding convention ?

easier to understand

Page 7: Why coding convention ?

maintainable code

Page 8: Why coding convention ?

–Paul M. Jones

“coding style not because one is better than another, but because we need a standard by

which to collaborate”

Page 9: Why coding convention ?

indentation tabs vs spaces

Page 10: Why coding convention ?

or…hit TAB and let the IDE do the conversion for the appropriate number of space

Page 11: Why coding convention ?

brace style Allman vs 1TBS

http://www.terminally-incoherent.com/blog/2009/04/10/the-only-correct-indent-style

Page 12: Why coding convention ?

naming convention CamelCase vs underscore_case

www.terminally-incoherent.com/blog/2009/04/10/the-only-correct-indent-style

toCamelCase

or_to_underscore

Page 13: Why coding convention ?

Android Code Style Guidelines

Page 14: Why coding convention ?

in the end it doesn't matter which coding styles we pick.

Page 15: Why coding convention ?

what does matter is everyone sticks with those conventions and uses them

consistently.