+ All Categories
Home > Software > Code Quality for a Fresh Start

Code Quality for a Fresh Start

Date post: 21-May-2015
Category:
Upload: kosala-nuwan-perera
View: 117 times
Download: 3 times
Share this document with a friend
Description:
A computer program is the most complicated thing on earth, second to a woman's brain. They get outdated more often than women fashion. Maybe it breaks down. Maybe a better program is created to replace it - happens all the time. It is wise to keep an eye on the costs, the technical debt, the cost of change, and the respond to change. It is not easy to teach good practices but it is not hard to teach bad programming practices. Writing quality code is now more than just following simple set of guidelines. There are more principles, and ethics, and discipline in it. When you are matured with these principles and patterns it will become difficult for you to think without those.
Popular Tags:
29
Code Quality @kosalanuwan
Transcript
Page 1: Code Quality for a Fresh Start

Code Quality@kosalanuwan

Page 2: Code Quality for a Fresh Start

get some paper, put it in a typewriter,type FADE IN ... and keep typing

- Peter Falk told to Paul Reiser

Page 3: Code Quality for a Fresh Start

A computer program is the most complicated thing on

earth, second to a woman's brain

- Marvin Silva

Page 4: Code Quality for a Fresh Start

PRE DEMO: What it looks like

Page 5: Code Quality for a Fresh Start

Maybe it breaks down. Maybe a better program is

createdto replace it - happens all the

time- The Oracle told to Neo

Page 6: Code Quality for a Fresh Start

Why do you have to care? - Understandability- Readability- Changeability- Extensibility- Maintainability

Page 7: Code Quality for a Fresh Start

The costs: - Respond to change- Cost of change- Technical debt

Page 8: Code Quality for a Fresh Start

How do you write bad code? - Rigid- Fragile- Immobility- Design debt : Technical debt by taking shortcuts?

- Environment debt : Technical debt by not running build, test, and other tasks

- Needless complexity- Needless repetition- Opacity

Page 9: Code Quality for a Fresh Start

I know it when I see it!- KP told to The Wife

Page 10: Code Quality for a Fresh Start

My gut says it’s clean, so I believe it

- KP

Page 11: Code Quality for a Fresh Start

When you are matured with these principles and patterns it will become difficult for you to think without those

- KP

Page 12: Code Quality for a Fresh Start

Where to begin?

- Good IDE- Static analysis tools- Builds- Test automation tools- Source control- Continuous integration

Page 13: Code Quality for a Fresh Start

DEMO: Code Analysis

Page 14: Code Quality for a Fresh Start

How to practice? - Code kata- Pair programming- Design/Code reviews- Peer reviews

Page 15: Code Quality for a Fresh Start
Page 16: Code Quality for a Fresh Start

Other things that go with it? - KISS- Boy scout rule- Root cause analysis- Following standard conventions- Class design principles

Page 17: Code Quality for a Fresh Start

What can you do TODAY? - Naming conventions- Methods- Design principles- Dependency injection- Encapsulate conditionals- Polymorphism to If/Else or

Switch/Case- Exception over return codes

Page 18: Code Quality for a Fresh Start

DEMO: Standard naming conventions

Page 19: Code Quality for a Fresh Start

DEMO: Methods

Page 20: Code Quality for a Fresh Start

DEMO: Query from command

Page 21: Code Quality for a Fresh Start

DEMO: DRY up yourself

Page 22: Code Quality for a Fresh Start

DEMO: Dependency injection by hand

Page 23: Code Quality for a Fresh Start

DEMO: Encapsulate various things

Page 24: Code Quality for a Fresh Start

DEMO: Polymorphics

Page 25: Code Quality for a Fresh Start

DEMO: Replacing errors and exceptions

Page 26: Code Quality for a Fresh Start

Do you swear to write software, the whole software and nothing but well-crafted

softwareso help you God!

- The Software Craftsmanship Oath

Page 27: Code Quality for a Fresh Start

Happy Coding @kosalanuwan

http://kosalanuwan.tumblr.com/

Page 28: Code Quality for a Fresh Start

Code Kata: - Reverse my array- Fizz Buzz

Page 29: Code Quality for a Fresh Start

New requirements: - Optimize, don’t use any other

arrays


Recommended