becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can...

20
becoming a Clean Coder

Transcript of becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can...

Page 1: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

becoming a Clean Coder

Page 2: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

What is Code

Quality?

Page 3: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

What is Code Quality?

• Code that does what the Story described• delivers value to the business

• Code that meets the acceptance criteria defined on the Story• is defect free

• Code that is maintainable and extensible• is Clean

Page 4: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

What is CleanCode?

Page 5: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

What is Clean Code?• … reads like well-written prose

• … can be read, and enhanced by a developer other than its original author

• … does what you expected

• … logic [that is] straightforward [making]it hard for bugs to hide

• … [minimal & explicit] dependencies to ease maintenance

• … has unit tests Readable

MaintainableTestable

Consistent

Page 6: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

Why don’t we write

clean code?

Page 7: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

What I thought my code looked like…

Page 8: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

What my team thought …

Page 9: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

That’s not how the force works

Page 10: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

This may smell bad, kid,

but it'll WORK until I get TIME TO WRITE SOMETHING BETTER

Page 11: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

The only way to make the deadline - the only way to go fast - is to keep the code as clean as possible at all times.

We are constantly reading old code as part of the effort to write new code. So if you want to go fast, if you want to

get done quickly, if you want your code to be easy to write, make it

easy to read.

Page 12: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

The code you write today will be something you & your team-mates read tomorrow…

It’s harder to read code than

to write it.

Page 13: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

Want to Play a Game

Tell me what this does...

Page 14: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

What does this do?

Page 15: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

How hard was it to read that code?

Page 16: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

Isn’t this better?

Page 17: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

What does this do?

Page 18: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

How hard was it to read that code?

Page 19: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does

Isn’t this better?

Page 20: becoming a Clean Coder€¦ · What is Clean Code? •… reads like well-written prose •… can be read, and enhanced by a developer other than its original author •… does