Week 11 - Implementation - Coding Principles
Week 11 - Implementation - Coding Principles
CT026-3-1
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 2 of 19
Learning Outcomes
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 3 of 19
Key Terms you must be able to use
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 4 of 19
Coding Standards
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 5 of 19
Coding Standards
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 6 of 19
Why do we need coding
standards?
• Consistent look
• Improve readability
• Simplifies copying, editing and
maintenance
• Company wide standardization
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 7 of 19
Principles of Good Programming
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 9 of 19
Principles of Good Programming
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 10 of 19
Naming Conventions
• No abbreviations
– OnButtonClick vs OnBtnClk
• Meaningful names
– Intention revealing
• int t; //Time to complete single lap
• int singleLapTime;
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 11 of 19
Naming Conventions
Incorrect:
$currentuser
$currentUser
Correct:
$current_user
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 12 of 19
Loop Indices
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 13 of 19
Code Smells
• Duplicated code
• Large classes
• Long methods
• Long parameter list
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 14 of 19
Refactoring
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 15 of 19
Quick Review Question
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 16 of 19
Summary of Main Teaching Points
• Input Design
– Coding Standards
– Principles of Good Programming
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 17 of 19
Question and Answer
Session
Q&A
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 18 of 19
What we will cover next
• Implementation
– Types of testing
– Test plan
CT026-3-1 Systems Analysis and Design Coding Standards and Principles Page 19 of 19