why coding convention ?
TRANSCRIPT
![Page 1: Why coding convention ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/1.jpg)
Why Coding Conventions ?
![Page 2: Why coding convention ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/2.jpg)
–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 ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/3.jpg)
in most cases, we’ll write
in a style that we want
$userName $username $user_name
![Page 4: Why coding convention ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/4.jpg)
![Page 5: Why coding convention ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/5.jpg)
consistent
![Page 6: Why coding convention ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/6.jpg)
easier to understand
![Page 7: Why coding convention ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/7.jpg)
maintainable code
![Page 8: Why coding convention ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/8.jpg)
–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 ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/9.jpg)
indentation tabs vs spaces
![Page 10: Why coding convention ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/10.jpg)
or…hit TAB and let the IDE do the conversion for the appropriate number of space
![Page 11: Why coding convention ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/11.jpg)
brace style Allman vs 1TBS
http://www.terminally-incoherent.com/blog/2009/04/10/the-only-correct-indent-style
![Page 12: Why coding convention ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/12.jpg)
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 ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/13.jpg)
Android Code Style Guidelines
![Page 14: Why coding convention ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/14.jpg)
in the end it doesn't matter which coding styles we pick.
![Page 15: Why coding convention ?](https://reader033.vdocuments.net/reader033/viewer/2022051122/58eec2021a28ab09298b463b/html5/thumbnails/15.jpg)
what does matter is everyone sticks with those conventions and uses them
consistently.