ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Clean Code and Coding
Standards
Clean code and Coding Standards
Clean code and Coding Standards
Clean code and Coding Standards
Boy Scout Rule:
¡°Always leave the campground cleaner than you found it.¡±
Meaningful Names (Open Discussion)
? Avoid Disinformation
? Make Meaningful Distinctions
? Use Pronounceable Names
? Use Searchable Names
? Member Prefixes (Avoid encodings)
? Hungarian Notation (Avoid encodings)
? Avoid Mental Mapping
? Class and Method Names
? Pick One Word per Concept
Functions (Open Discussion)
? Small functions
? Do One Thing
? One Level of Abstraction per Function
? Reading Code from Top to Bottom
? Use Descriptive Names
? Function Arguments
? Don¡¯t Repeat Yourself (DRY)
? Structured Programming
? Indentation
Comments (Open Discussion)
? Comments Do Not Make Up for Bad Code // don¡¯t comment bad code,
rewrite it!
? Explain Yourself in Code
? Legal Comments
? Informative Comments
? Explanation of Intent
? Clarification
? Warning of Consequences
? TODO Comments
? Bad comments examples (/* The * variable */)
Formatting (Open Discussion)
? Team Rules: every programmer has his own favorite formatting rules
but if he works in a team then the team rules.
? Single template and color scheme for whole team.
Error Handling (Open Discussion)
? Prefer Exceptions to Returning Error Codes
? Extract Try/Catch Blocks
? Don¡¯t Return Null
Coding Standards
? Java: http://www.oracle.com/technetwork/java/codeconvtoc-
136057.html
? PHP http://www.php-fig.org/psr/psr-2/
? C# https://msdn.microsoft.com/en-us/library/ff926074.aspx
? Android https://source.android.com/source/code-style.html
? Objective C https://github.com/raywenderlich/objective-c-style-guide
? Swift https://github.com/raywenderlich/swift-style-guide
? AngularJS https://google.github.io/styleguide/angularjs-google-
style.html
Questions?
Thank You!
Mahesh Salaria

More Related Content

What's hot (20)

Introduction to Knowledge Graphs: Data Summit 2020
Introduction to Knowledge Graphs: Data Summit 2020Introduction to Knowledge Graphs: Data Summit 2020
Introduction to Knowledge Graphs: Data Summit 2020
Enterprise Knowledge
?
Successful Content Management Through Taxonomy And Metadata Design
Successful Content Management Through Taxonomy And Metadata DesignSuccessful Content Management Through Taxonomy And Metadata Design
Successful Content Management Through Taxonomy And Metadata Design
sarakirsten
?
Clean Code I - Best Practices
Clean Code I - Best PracticesClean Code I - Best Practices
Clean Code I - Best Practices
Theo Jungeblut
?
Sql joins inner join self join outer joins
Sql joins inner join self join outer joinsSql joins inner join self join outer joins
Sql joins inner join self join outer joins
Deepthi Rachumallu
?
Introduction to Knowledge Graphs and Semantic AI
Introduction to Knowledge Graphs and Semantic AIIntroduction to Knowledge Graphs and Semantic AI
Introduction to Knowledge Graphs and Semantic AI
Semantic Web Company
?
Chapter 6.pptx
Chapter 6.pptxChapter 6.pptx
Chapter 6.pptx
RanjanaShevkar
?
Neural Machine Translation (D3L4 Deep Learning for Speech and Language UPC 2017)
Neural Machine Translation (D3L4 Deep Learning for Speech and Language UPC 2017)Neural Machine Translation (D3L4 Deep Learning for Speech and Language UPC 2017)
Neural Machine Translation (D3L4 Deep Learning for Speech and Language UPC 2017)
Universitat Polit¨¨cnica de Catalunya
?
Introduction to Overleaf Workshop
Introduction to Overleaf WorkshopIntroduction to Overleaf Workshop
Introduction to Overleaf Workshop
Olga Scrivner
?
How to Quickly Prototype a Scalable Graph Architecture: A Framework for Rapid...
How to Quickly Prototype a Scalable Graph Architecture: A Framework for Rapid...How to Quickly Prototype a Scalable Graph Architecture: A Framework for Rapid...
How to Quickly Prototype a Scalable Graph Architecture: A Framework for Rapid...
Enterprise Knowledge
?
mysql-Tutorial with Query presentation.ppt
mysql-Tutorial with Query presentation.pptmysql-Tutorial with Query presentation.ppt
mysql-Tutorial with Query presentation.ppt
aptechaligarh
?
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
Md.Mojibul Hoque
?
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
Dr-Dipali Meher
?
Training Week: Introduction to Neo4j Aura Free
Training Week: Introduction to Neo4j Aura FreeTraining Week: Introduction to Neo4j Aura Free
Training Week: Introduction to Neo4j Aura Free
Neo4j
?
Graph-Based Customer Journey Analytics with Neo4j
Graph-Based Customer Journey Analytics with Neo4jGraph-Based Customer Journey Analytics with Neo4j
Graph-Based Customer Journey Analytics with Neo4j
Neo4j
?
MySQL
MySQLMySQL
MySQL
Gouthaman V
?
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
Dan D'Urso
?
Talend Open Studio Fundamentals #1: Workspaces, Jobs, Metadata and Trips & Tr...
Talend Open Studio Fundamentals #1: Workspaces, Jobs, Metadata and Trips & Tr...Talend Open Studio Fundamentals #1: Workspaces, Jobs, Metadata and Trips & Tr...
Talend Open Studio Fundamentals #1: Workspaces, Jobs, Metadata and Trips & Tr...
Gabriele Baldassarre
?
data manipulation language
data manipulation languagedata manipulation language
data manipulation language
JananiSelvaraj10
?
Schema migrations in no sql
Schema migrations in no sqlSchema migrations in no sql
Schema migrations in no sql
Dr-Dipali Meher
?
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8
Talha Ocak??
?
Introduction to Knowledge Graphs: Data Summit 2020
Introduction to Knowledge Graphs: Data Summit 2020Introduction to Knowledge Graphs: Data Summit 2020
Introduction to Knowledge Graphs: Data Summit 2020
Enterprise Knowledge
?
Successful Content Management Through Taxonomy And Metadata Design
Successful Content Management Through Taxonomy And Metadata DesignSuccessful Content Management Through Taxonomy And Metadata Design
Successful Content Management Through Taxonomy And Metadata Design
sarakirsten
?
Clean Code I - Best Practices
Clean Code I - Best PracticesClean Code I - Best Practices
Clean Code I - Best Practices
Theo Jungeblut
?
Sql joins inner join self join outer joins
Sql joins inner join self join outer joinsSql joins inner join self join outer joins
Sql joins inner join self join outer joins
Deepthi Rachumallu
?
Introduction to Knowledge Graphs and Semantic AI
Introduction to Knowledge Graphs and Semantic AIIntroduction to Knowledge Graphs and Semantic AI
Introduction to Knowledge Graphs and Semantic AI
Semantic Web Company
?
Neural Machine Translation (D3L4 Deep Learning for Speech and Language UPC 2017)
Neural Machine Translation (D3L4 Deep Learning for Speech and Language UPC 2017)Neural Machine Translation (D3L4 Deep Learning for Speech and Language UPC 2017)
Neural Machine Translation (D3L4 Deep Learning for Speech and Language UPC 2017)
Universitat Polit¨¨cnica de Catalunya
?
Introduction to Overleaf Workshop
Introduction to Overleaf WorkshopIntroduction to Overleaf Workshop
Introduction to Overleaf Workshop
Olga Scrivner
?
How to Quickly Prototype a Scalable Graph Architecture: A Framework for Rapid...
How to Quickly Prototype a Scalable Graph Architecture: A Framework for Rapid...How to Quickly Prototype a Scalable Graph Architecture: A Framework for Rapid...
How to Quickly Prototype a Scalable Graph Architecture: A Framework for Rapid...
Enterprise Knowledge
?
mysql-Tutorial with Query presentation.ppt
mysql-Tutorial with Query presentation.pptmysql-Tutorial with Query presentation.ppt
mysql-Tutorial with Query presentation.ppt
aptechaligarh
?
Training Week: Introduction to Neo4j Aura Free
Training Week: Introduction to Neo4j Aura FreeTraining Week: Introduction to Neo4j Aura Free
Training Week: Introduction to Neo4j Aura Free
Neo4j
?
Graph-Based Customer Journey Analytics with Neo4j
Graph-Based Customer Journey Analytics with Neo4jGraph-Based Customer Journey Analytics with Neo4j
Graph-Based Customer Journey Analytics with Neo4j
Neo4j
?
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
Dan D'Urso
?
Talend Open Studio Fundamentals #1: Workspaces, Jobs, Metadata and Trips & Tr...
Talend Open Studio Fundamentals #1: Workspaces, Jobs, Metadata and Trips & Tr...Talend Open Studio Fundamentals #1: Workspaces, Jobs, Metadata and Trips & Tr...
Talend Open Studio Fundamentals #1: Workspaces, Jobs, Metadata and Trips & Tr...
Gabriele Baldassarre
?
Schema migrations in no sql
Schema migrations in no sqlSchema migrations in no sql
Schema migrations in no sql
Dr-Dipali Meher
?
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8
Talha Ocak??
?

Viewers also liked (10)

Clean Code and Common Engineering Practices
Clean Code and Common Engineering PracticesClean Code and Common Engineering Practices
Clean Code and Common Engineering Practices
Ruth Sperer
?
Coding standards
Coding standardsCoding standards
Coding standards
Mimoh Ojha
?
Clean Code
Clean CodeClean Code
Clean Code
Hendrik Ebel
?
Clean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
Clean Code - Design Patterns and Best Practices at Silicon Valley Code CampClean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
Clean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
Theo Jungeblut
?
Clean Code summary
Clean Code summaryClean Code summary
Clean Code summary
Jan de Vries
?
Coding standards and guidelines
Coding standards and guidelinesCoding standards and guidelines
Coding standards and guidelines
brijraj_singh
?
Clean code
Clean codeClean code
Clean code
Arturo Herrero
?
What is Ubuntu - presentation
What is Ubuntu - presentationWhat is Ubuntu - presentation
What is Ubuntu - presentation
Ahmed Mamdouh
?
Ÿo覵ijÌʽ´a Clean Code Ðĵ÷ÖÏí
Ÿo覵ijÌʽ´a Clean Code Ðĵ÷ÖÏíŸo覵ijÌʽ´a Clean Code Ðĵ÷ÖÏí
Ÿo覵ijÌʽ´a Clean Code Ðĵ÷ÖÏí
Win Yu
?
Clean coding-practices
Clean coding-practicesClean coding-practices
Clean coding-practices
John Ferguson Smart Limited
?
Clean Code and Common Engineering Practices
Clean Code and Common Engineering PracticesClean Code and Common Engineering Practices
Clean Code and Common Engineering Practices
Ruth Sperer
?
Clean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
Clean Code - Design Patterns and Best Practices at Silicon Valley Code CampClean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
Clean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
Theo Jungeblut
?
Coding standards and guidelines
Coding standards and guidelinesCoding standards and guidelines
Coding standards and guidelines
brijraj_singh
?
What is Ubuntu - presentation
What is Ubuntu - presentationWhat is Ubuntu - presentation
What is Ubuntu - presentation
Ahmed Mamdouh
?
Ÿo覵ijÌʽ´a Clean Code Ðĵ÷ÖÏí
Ÿo覵ijÌʽ´a Clean Code Ðĵ÷ÖÏíŸo覵ijÌʽ´a Clean Code Ðĵ÷ÖÏí
Ÿo覵ijÌʽ´a Clean Code Ðĵ÷ÖÏí
Win Yu
?

Similar to Clean code and Coding Standards (20)

Code Review
Code ReviewCode Review
Code Review
Erik Ecoologic
?
Clean code coding like a professional
Clean code   coding like a professionalClean code   coding like a professional
Clean code coding like a professional
Nh?t Nguy?n Kh?c
?
Coderetreat - Practice to Master Your Crafts
Coderetreat - Practice to Master Your CraftsCoderetreat - Practice to Master Your Crafts
Coderetreat - Practice to Master Your Crafts
Lemi Orhan Ergin
?
Make a better with clean code
Make a better with clean codeMake a better with clean code
Make a better with clean code
Keattiwut Kosittaruk
?
Kata Your Way to SW Craftsmanship
Kata Your Way to SW CraftsmanshipKata Your Way to SW Craftsmanship
Kata Your Way to SW Craftsmanship
Camille Bell
?
Tips for Writing Better Code
Tips for Writing Better CodeTips for Writing Better Code
Tips for Writing Better Code
Jamshid Hashimi
?
Style & Design Principles 01 - Code Style & Structure
Style & Design Principles 01 - Code Style & StructureStyle & Design Principles 01 - Code Style & Structure
Style & Design Principles 01 - Code Style & Structure
Nick Pruehs
?
Pair Programming Styles
Pair Programming StylesPair Programming Styles
Pair Programming Styles
Attila Bert¨®k
?
JOSA TechTalks - Compilers, Transpilers, and Why You Should Care
JOSA TechTalks - Compilers, Transpilers, and Why You Should CareJOSA TechTalks - Compilers, Transpilers, and Why You Should Care
JOSA TechTalks - Compilers, Transpilers, and Why You Should Care
Jordan Open Source Association
?
Clean code presentation
Clean code presentationClean code presentation
Clean code presentation
Bhavin Gandhi
?
Global Day of Coderetreat'14 - Istanbul Event
Global Day of Coderetreat'14 - Istanbul EventGlobal Day of Coderetreat'14 - Istanbul Event
Global Day of Coderetreat'14 - Istanbul Event
Lemi Orhan Ergin
?
Being Good Developer
Being Good DeveloperBeing Good Developer
Being Good Developer
Sally Ahmed
?
Eurosport's Kodakademi #2
Eurosport's Kodakademi #2Eurosport's Kodakademi #2
Eurosport's Kodakademi #2
Benjamin Baumann
?
A Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and UnderstandingA Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and Understanding
mametter
?
Software Design
Software DesignSoftware Design
Software Design
Ahmed Misbah
?
TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012
Alan Christensen
?
Code Review Matters and Manners
Code Review Matters and MannersCode Review Matters and Manners
Code Review Matters and Manners
Trisha Gee
?
Coding conventions
Coding conventionsCoding conventions
Coding conventions
systemcrashed
?
Clean Code
Clean CodeClean Code
Clean Code
Abdelhakim Bachar
?
Clean code
Clean codeClean code
Clean code
Simon S?nnby
?
Clean code coding like a professional
Clean code   coding like a professionalClean code   coding like a professional
Clean code coding like a professional
Nh?t Nguy?n Kh?c
?
Coderetreat - Practice to Master Your Crafts
Coderetreat - Practice to Master Your CraftsCoderetreat - Practice to Master Your Crafts
Coderetreat - Practice to Master Your Crafts
Lemi Orhan Ergin
?
Kata Your Way to SW Craftsmanship
Kata Your Way to SW CraftsmanshipKata Your Way to SW Craftsmanship
Kata Your Way to SW Craftsmanship
Camille Bell
?
Tips for Writing Better Code
Tips for Writing Better CodeTips for Writing Better Code
Tips for Writing Better Code
Jamshid Hashimi
?
Style & Design Principles 01 - Code Style & Structure
Style & Design Principles 01 - Code Style & StructureStyle & Design Principles 01 - Code Style & Structure
Style & Design Principles 01 - Code Style & Structure
Nick Pruehs
?
JOSA TechTalks - Compilers, Transpilers, and Why You Should Care
JOSA TechTalks - Compilers, Transpilers, and Why You Should CareJOSA TechTalks - Compilers, Transpilers, and Why You Should Care
JOSA TechTalks - Compilers, Transpilers, and Why You Should Care
Jordan Open Source Association
?
Clean code presentation
Clean code presentationClean code presentation
Clean code presentation
Bhavin Gandhi
?
Global Day of Coderetreat'14 - Istanbul Event
Global Day of Coderetreat'14 - Istanbul EventGlobal Day of Coderetreat'14 - Istanbul Event
Global Day of Coderetreat'14 - Istanbul Event
Lemi Orhan Ergin
?
Being Good Developer
Being Good DeveloperBeing Good Developer
Being Good Developer
Sally Ahmed
?
A Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and UnderstandingA Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and Understanding
mametter
?
TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012
Alan Christensen
?
Code Review Matters and Manners
Code Review Matters and MannersCode Review Matters and Manners
Code Review Matters and Manners
Trisha Gee
?

Recently uploaded (20)

???????? ???? ?????? ???????? ( ?????)kkkjjj kkkkk .pptx
???????? ???? ?????? ???????? ( ?????)kkkjjj  kkkkk .pptx???????? ???? ?????? ???????? ( ?????)kkkjjj  kkkkk .pptx
???????? ???? ?????? ???????? ( ?????)kkkjjj kkkkk .pptx
zeidali3
?
GRAPHS AND DISCONTINUITIES POWERPOINT.pptx
GRAPHS AND DISCONTINUITIES POWERPOINT.pptxGRAPHS AND DISCONTINUITIES POWERPOINT.pptx
GRAPHS AND DISCONTINUITIES POWERPOINT.pptx
ChrisPuyoc1
?
02.BigDataAnalytics curso de Legsi (1).pdf
02.BigDataAnalytics curso de Legsi (1).pdf02.BigDataAnalytics curso de Legsi (1).pdf
02.BigDataAnalytics curso de Legsi (1).pdf
ruioliveira1921
?
Virtual Power plants-Cleantech-Revolution
Virtual Power plants-Cleantech-RevolutionVirtual Power plants-Cleantech-Revolution
Virtual Power plants-Cleantech-Revolution
Ashoka Saket
?
PLANT CELL REACTORS presenation PTC amity
PLANT CELL REACTORS presenation PTC amityPLANT CELL REACTORS presenation PTC amity
PLANT CELL REACTORS presenation PTC amity
UrjaMoon
?
Airport Components Part1 ppt.pptx-Site layout,RUNWAY,TAXIWAY,TAXILANE
Airport Components Part1 ppt.pptx-Site layout,RUNWAY,TAXIWAY,TAXILANEAirport Components Part1 ppt.pptx-Site layout,RUNWAY,TAXIWAY,TAXILANE
Airport Components Part1 ppt.pptx-Site layout,RUNWAY,TAXIWAY,TAXILANE
Priyanka Dange
?
Cloudera Partner Network Enablement Full.pdf
Cloudera Partner Network Enablement Full.pdfCloudera Partner Network Enablement Full.pdf
Cloudera Partner Network Enablement Full.pdf
Nguy?n H?i
?
Chapter1-Introduction ¦¥¦É¦Ò¦Á¦Ã¦Ø¦Ã¦É¦Ê?? ?¦Í¦Í¦Ï¦É¦Å?
Chapter1-Introduction ¦¥¦É¦Ò¦Á¦Ã¦Ø¦Ã¦É¦Ê?? ?¦Í¦Í¦Ï¦É¦Å?Chapter1-Introduction ¦¥¦É¦Ò¦Á¦Ã¦Ø¦Ã¦É¦Ê?? ?¦Í¦Í¦Ï¦É¦Å?
Chapter1-Introduction ¦¥¦É¦Ò¦Á¦Ã¦Ø¦Ã¦É¦Ê?? ?¦Í¦Í¦Ï¦É¦Å?
ssuserb91a20
?
Why the Engineering Model is Key to Successful Projects
Why the Engineering Model is Key to Successful ProjectsWhy the Engineering Model is Key to Successful Projects
Why the Engineering Model is Key to Successful Projects
Maadhu Creatives-Model Making Company
?
Lecture 16 - 17 - NonTraditional Machining Presentation.ppt
Lecture 16 - 17 - NonTraditional Machining Presentation.pptLecture 16 - 17 - NonTraditional Machining Presentation.ppt
Lecture 16 - 17 - NonTraditional Machining Presentation.ppt
INSTITUTE OF ENGINEERING /BKC
?
Telehealth technology ¨C A new horizon in health care
Telehealth technology ¨C A new horizon in health careTelehealth technology ¨C A new horizon in health care
Telehealth technology ¨C A new horizon in health care
Dr INBAMALAR T M
?
UHV UNIT-5 IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON ...
UHV UNIT-5    IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON ...UHV UNIT-5    IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON ...
UHV UNIT-5 IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON ...
ariomthermal2031
?
Disruption channel in business model innovation topic
Disruption channel in business model innovation topicDisruption channel in business model innovation topic
Disruption channel in business model innovation topic
anandraj930873
?
Airport Components Part2 ppt.pptx-Apron,Hangers,Terminal building
Airport Components Part2 ppt.pptx-Apron,Hangers,Terminal buildingAirport Components Part2 ppt.pptx-Apron,Hangers,Terminal building
Airport Components Part2 ppt.pptx-Apron,Hangers,Terminal building
Priyanka Dange
?
Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...
Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...
Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...
Ignacio J. J. Palma Carazo
?
UHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptx
UHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptxUHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptx
UHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptx
ariomthermal2031
?
DBMS Nested & Sub Queries Set operations
DBMS Nested & Sub Queries Set operationsDBMS Nested & Sub Queries Set operations
DBMS Nested & Sub Queries Set operations
Sreedhar Chowdam
?
Scalling Rails: The Journey to 200M Notifications
Scalling Rails: The Journey to 200M NotificationsScalling Rails: The Journey to 200M Notifications
Scalling Rails: The Journey to 200M Notifications
Gustavo Araujo
?
applicationof differential equation.pptx
applicationof differential equation.pptxapplicationof differential equation.pptx
applicationof differential equation.pptx
PPSTUDIES
?
CCNA_Product_OverviewCCNA_Productsa.pptx
CCNA_Product_OverviewCCNA_Productsa.pptxCCNA_Product_OverviewCCNA_Productsa.pptx
CCNA_Product_OverviewCCNA_Productsa.pptx
UdayakumarAllimuthu
?
???????? ???? ?????? ???????? ( ?????)kkkjjj kkkkk .pptx
???????? ???? ?????? ???????? ( ?????)kkkjjj  kkkkk .pptx???????? ???? ?????? ???????? ( ?????)kkkjjj  kkkkk .pptx
???????? ???? ?????? ???????? ( ?????)kkkjjj kkkkk .pptx
zeidali3
?
GRAPHS AND DISCONTINUITIES POWERPOINT.pptx
GRAPHS AND DISCONTINUITIES POWERPOINT.pptxGRAPHS AND DISCONTINUITIES POWERPOINT.pptx
GRAPHS AND DISCONTINUITIES POWERPOINT.pptx
ChrisPuyoc1
?
02.BigDataAnalytics curso de Legsi (1).pdf
02.BigDataAnalytics curso de Legsi (1).pdf02.BigDataAnalytics curso de Legsi (1).pdf
02.BigDataAnalytics curso de Legsi (1).pdf
ruioliveira1921
?
Virtual Power plants-Cleantech-Revolution
Virtual Power plants-Cleantech-RevolutionVirtual Power plants-Cleantech-Revolution
Virtual Power plants-Cleantech-Revolution
Ashoka Saket
?
PLANT CELL REACTORS presenation PTC amity
PLANT CELL REACTORS presenation PTC amityPLANT CELL REACTORS presenation PTC amity
PLANT CELL REACTORS presenation PTC amity
UrjaMoon
?
Airport Components Part1 ppt.pptx-Site layout,RUNWAY,TAXIWAY,TAXILANE
Airport Components Part1 ppt.pptx-Site layout,RUNWAY,TAXIWAY,TAXILANEAirport Components Part1 ppt.pptx-Site layout,RUNWAY,TAXIWAY,TAXILANE
Airport Components Part1 ppt.pptx-Site layout,RUNWAY,TAXIWAY,TAXILANE
Priyanka Dange
?
Cloudera Partner Network Enablement Full.pdf
Cloudera Partner Network Enablement Full.pdfCloudera Partner Network Enablement Full.pdf
Cloudera Partner Network Enablement Full.pdf
Nguy?n H?i
?
Chapter1-Introduction ¦¥¦É¦Ò¦Á¦Ã¦Ø¦Ã¦É¦Ê?? ?¦Í¦Í¦Ï¦É¦Å?
Chapter1-Introduction ¦¥¦É¦Ò¦Á¦Ã¦Ø¦Ã¦É¦Ê?? ?¦Í¦Í¦Ï¦É¦Å?Chapter1-Introduction ¦¥¦É¦Ò¦Á¦Ã¦Ø¦Ã¦É¦Ê?? ?¦Í¦Í¦Ï¦É¦Å?
Chapter1-Introduction ¦¥¦É¦Ò¦Á¦Ã¦Ø¦Ã¦É¦Ê?? ?¦Í¦Í¦Ï¦É¦Å?
ssuserb91a20
?
Lecture 16 - 17 - NonTraditional Machining Presentation.ppt
Lecture 16 - 17 - NonTraditional Machining Presentation.pptLecture 16 - 17 - NonTraditional Machining Presentation.ppt
Lecture 16 - 17 - NonTraditional Machining Presentation.ppt
INSTITUTE OF ENGINEERING /BKC
?
Telehealth technology ¨C A new horizon in health care
Telehealth technology ¨C A new horizon in health careTelehealth technology ¨C A new horizon in health care
Telehealth technology ¨C A new horizon in health care
Dr INBAMALAR T M
?
UHV UNIT-5 IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON ...
UHV UNIT-5    IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON ...UHV UNIT-5    IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON ...
UHV UNIT-5 IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON ...
ariomthermal2031
?
Disruption channel in business model innovation topic
Disruption channel in business model innovation topicDisruption channel in business model innovation topic
Disruption channel in business model innovation topic
anandraj930873
?
Airport Components Part2 ppt.pptx-Apron,Hangers,Terminal building
Airport Components Part2 ppt.pptx-Apron,Hangers,Terminal buildingAirport Components Part2 ppt.pptx-Apron,Hangers,Terminal building
Airport Components Part2 ppt.pptx-Apron,Hangers,Terminal building
Priyanka Dange
?
Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...
Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...
Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...
Ignacio J. J. Palma Carazo
?
UHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptx
UHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptxUHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptx
UHV UNIT-3 HARMONY IN THE FAMILY AND SOCIETY.pptx
ariomthermal2031
?
DBMS Nested & Sub Queries Set operations
DBMS Nested & Sub Queries Set operationsDBMS Nested & Sub Queries Set operations
DBMS Nested & Sub Queries Set operations
Sreedhar Chowdam
?
Scalling Rails: The Journey to 200M Notifications
Scalling Rails: The Journey to 200M NotificationsScalling Rails: The Journey to 200M Notifications
Scalling Rails: The Journey to 200M Notifications
Gustavo Araujo
?
applicationof differential equation.pptx
applicationof differential equation.pptxapplicationof differential equation.pptx
applicationof differential equation.pptx
PPSTUDIES
?
CCNA_Product_OverviewCCNA_Productsa.pptx
CCNA_Product_OverviewCCNA_Productsa.pptxCCNA_Product_OverviewCCNA_Productsa.pptx
CCNA_Product_OverviewCCNA_Productsa.pptx
UdayakumarAllimuthu
?

Clean code and Coding Standards

  • 1. Clean Code and Coding Standards
  • 5. Boy Scout Rule: ¡°Always leave the campground cleaner than you found it.¡±
  • 6. Meaningful Names (Open Discussion) ? Avoid Disinformation ? Make Meaningful Distinctions ? Use Pronounceable Names ? Use Searchable Names ? Member Prefixes (Avoid encodings) ? Hungarian Notation (Avoid encodings) ? Avoid Mental Mapping ? Class and Method Names ? Pick One Word per Concept
  • 7. Functions (Open Discussion) ? Small functions ? Do One Thing ? One Level of Abstraction per Function ? Reading Code from Top to Bottom ? Use Descriptive Names ? Function Arguments ? Don¡¯t Repeat Yourself (DRY) ? Structured Programming ? Indentation
  • 8. Comments (Open Discussion) ? Comments Do Not Make Up for Bad Code // don¡¯t comment bad code, rewrite it! ? Explain Yourself in Code ? Legal Comments ? Informative Comments ? Explanation of Intent ? Clarification ? Warning of Consequences ? TODO Comments ? Bad comments examples (/* The * variable */)
  • 9. Formatting (Open Discussion) ? Team Rules: every programmer has his own favorite formatting rules but if he works in a team then the team rules. ? Single template and color scheme for whole team.
  • 10. Error Handling (Open Discussion) ? Prefer Exceptions to Returning Error Codes ? Extract Try/Catch Blocks ? Don¡¯t Return Null
  • 11. Coding Standards ? Java: http://www.oracle.com/technetwork/java/codeconvtoc- 136057.html ? PHP http://www.php-fig.org/psr/psr-2/ ? C# https://msdn.microsoft.com/en-us/library/ff926074.aspx ? Android https://source.android.com/source/code-style.html ? Objective C https://github.com/raywenderlich/objective-c-style-guide ? Swift https://github.com/raywenderlich/swift-style-guide ? AngularJS https://google.github.io/styleguide/angularjs-google- style.html