Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

Code conventions (Wikipedia) •These conventions usually cover •file organization, •indentation, comments, declarations, statements, white space, naming conventions, •programming practices, programming principles, programming rules of thumb, •architectural best practices, etc.. •Conventions may be formalized in a documented set of rules that an entire team or company follows

Slide 3

Slide 3 text

Agenda •Different Types •Clean Code •Samples •Summary

Slide 4

Slide 4 text

Code Quality •Readability •Maintainability •Testability •...and many more

Slide 5

Slide 5 text

Types of Coding Guidelines •Code formatting •language specific, historical •IDE & Tool support •Clean Code •“Clean Code Developer” •“Understandable Code”

Slide 6

Slide 6 text

10. Classes 11. Systems 12. Emergence 13. Concurrency 14. Successive Refinement 15. JUnit Internals 16. Refactoring SerialDate 17. Smells and Heuristics Book “Clean Code” 1. Clean Code 2. Meaningful Names 3. Functions 4. Comments 5. Formatting 6. Objects and Data Structures 7. Error Handling 8. Boundaries 9. Unit Tests

Slide 7

Slide 7 text

Comments • Comments Do Not Make Up for Bad Code • Explain Yourself in Code • Good Comments •Informative Comments •Explanation of Intent •Clarification •Warning of Consequences •TODO Comments •Javadocs in Public APIs • Bad Comments •Redundant Comments •Misleading Comments •Commented-Out Code •Javadocs in Nonpublic Code

Slide 8

Slide 8 text

Error Handling • Use Exceptions Rather Than Return Codes • Write Your Try-Catch-Finally Statement First • Use Unchecked Exceptions • Provide Context with Exceptions • Define Exception Classes in Terms of a Caller’s Needs • Define the Normal Flow • Don’t Return Null • Don’t Pass Null

Slide 9

Slide 9 text

Summary

Slide 10

Slide 10 text

Further Reading • Book “Clean Code” • Book “The Clean Coder”

Slide 11

Slide 11 text

No content