Code as a Communication Tool

103
Code as a Communication Tool Vinicius Gomes Mozair May, 23 rd 2011 © ThoughtWorks 2008 AKA Usando as Linguagens ao Seu Favor

description

Presentation done at UFLA University on May 23th 2011.

Transcript of Code as a Communication Tool

Page 1: Code as a Communication Tool

Code as a Communication Tool

Vinicius Gomes

Mozair

May, 23rd 2011

© ThoughtWorks 2008

AKA Usando as Linguagens ao Seu Favor

Page 2: Code as a Communication Tool

• About us

• Introduction

• What?

• Why?

• How?

• Conclusion

Agenda

© ThoughtWorks 2008

Page 3: Code as a Communication Tool

• About us

• Introduction

• What?

• Why?

• How?

• Conclusion

Agenda

© ThoughtWorks 2008

Page 4: Code as a Communication Tool

About us

Vinicius Gomes

• about.me/vvgomes

Mozair

@MACSkeptic

github.com/macskeptic

© ThoughtWorks 2008

Page 5: Code as a Communication Tool

• About us

• Introduction

• What?

• Why?

• How?

• Conclusion

Agenda

© ThoughtWorks 2008

Page 6: Code as a Communication Tool

© ThoughtWorks 2008

Introduction

Page 7: Code as a Communication Tool

Reading existing code is

expensive

Page 8: Code as a Communication Tool

Understanding existing

code is expensive

Page 9: Code as a Communication Tool

Finding out where to

change is expensive

Page 10: Code as a Communication Tool

Maintenance is expensive

Page 11: Code as a Communication Tool

So, what to do?

Page 12: Code as a Communication Tool

• About us

• Introduction

• What?

• Why?

• How?

• Conclusion

Agenda

© ThoughtWorks 2008

Page 13: Code as a Communication Tool

© ThoughtWorks 2008

What?

Page 14: Code as a Communication Tool
Page 15: Code as a Communication Tool
Page 16: Code as a Communication Tool
Page 17: Code as a Communication Tool
Page 18: Code as a Communication Tool

Communicate through

code effectively

Page 19: Code as a Communication Tool

Make it fast to read

Page 20: Code as a Communication Tool

Make it easy to understand

Page 21: Code as a Communication Tool

Express domain knowledge

through software

Page 22: Code as a Communication Tool

Keep maintenance costs

low

Page 23: Code as a Communication Tool
Page 24: Code as a Communication Tool
Page 25: Code as a Communication Tool

• About us

• Introduction

• What?

• Why?

• How?

• Conclusion

Agenda

© ThoughtWorks 2008

Page 26: Code as a Communication Tool

© ThoughtWorks 2008

Why?

Page 27: Code as a Communication Tool

Maintenance

Page 28: Code as a Communication Tool

Tech Debt

© ThoughtWorks 2008

Page 29: Code as a Communication Tool

Time to market vs. Technical debt

© ThoughtWorks 2008

Page 30: Code as a Communication Tool

• XP

–Communication

–Simplicity

–Feedback

–Courage

–Respect

What we do

© ThoughtWorks 2008

Page 31: Code as a Communication Tool

Feedback

© ThoughtWorks 2008

Page 32: Code as a Communication Tool

Feedback

© ThoughtWorks 2008

Project1

Unitary

Project1

Functional

Project2

Unitary

Project2

Functional

Project1

Regression

Project2

Regression

Page 33: Code as a Communication Tool

Help your team

Page 34: Code as a Communication Tool

Help your team

• Make people more productive

Page 35: Code as a Communication Tool

Help your team

• Make people more productive

• Avoid ambiguous interpretation

Page 36: Code as a Communication Tool

Help your team

• Make people more productive

• Avoid ambiguous interpretation

• Drop stress levels

Page 37: Code as a Communication Tool

Help your team

• Make people more productive

• Avoid ambiguous interpretation

• Drop stress levels

• Help people to focus on the right things

Page 38: Code as a Communication Tool

• About us

• Introduction

• What?

• Why?

• How?

• Conclusion

Agenda

© ThoughtWorks 2008

Page 39: Code as a Communication Tool

© ThoughtWorks 2008

How?

Page 40: Code as a Communication Tool

• Language constructs

Page 41: Code as a Communication Tool

• Language constructs

• Implementation Patterns

Page 42: Code as a Communication Tool

• Language constructs

• Implementation Patterns

• Domain Driven Design

Page 43: Code as a Communication Tool

• Language constructs

• Implementation Patterns

• Domain Driven Design

• Test Driven Development / Design

Page 44: Code as a Communication Tool

• Language constructs

• Implementation Patterns

• Domain Driven Design

• Test Driven Development / Design

• Refactoring

Page 45: Code as a Communication Tool

• Language constructs

• Implementation Patterns

• Domain Driven Design

• Test Driven Development / Design

• Refactoring

• Domain Specific Languages

Page 46: Code as a Communication Tool

Language constructs

Page 47: Code as a Communication Tool
Page 48: Code as a Communication Tool
Page 49: Code as a Communication Tool

© ThoughtWorks 2008

Page 50: Code as a Communication Tool

© ThoughtWorks 2008

Page 51: Code as a Communication Tool

© ThoughtWorks 2008

Page 52: Code as a Communication Tool

© ThoughtWorks 2008

Page 53: Code as a Communication Tool

Avoid the Comic Sans Effect

Page 54: Code as a Communication Tool
Page 55: Code as a Communication Tool
Page 56: Code as a Communication Tool
Page 57: Code as a Communication Tool
Page 58: Code as a Communication Tool

Tell “what”, not “how”

Page 59: Code as a Communication Tool

© ThoughtWorks 2008

Page 60: Code as a Communication Tool

© ThoughtWorks 2008

Page 61: Code as a Communication Tool

© ThoughtWorks 2008

Page 62: Code as a Communication Tool

Implementation

Patterns

Page 63: Code as a Communication Tool

Name by role

Page 64: Code as a Communication Tool
Page 65: Code as a Communication Tool
Page 66: Code as a Communication Tool

Abiding by the law of Demeter

Page 67: Code as a Communication Tool
Page 68: Code as a Communication Tool
Page 69: Code as a Communication Tool
Page 70: Code as a Communication Tool
Page 71: Code as a Communication Tool

Abstraction symmetry

Page 72: Code as a Communication Tool
Page 73: Code as a Communication Tool
Page 74: Code as a Communication Tool

One-line ifs

Page 75: Code as a Communication Tool
Page 76: Code as a Communication Tool
Page 77: Code as a Communication Tool

Test Driven

Design/Development

© ThoughtWorks 2008

Page 78: Code as a Communication Tool

© ThoughtWorks 2008

Page 79: Code as a Communication Tool

© ThoughtWorks 2008

Page 80: Code as a Communication Tool

© ThoughtWorks 2008

Page 81: Code as a Communication Tool

© ThoughtWorks 2008

Page 82: Code as a Communication Tool

© ThoughtWorks 2008

Page 83: Code as a Communication Tool

Refactoring

© ThoughtWorks 2008

Page 84: Code as a Communication Tool

© ThoughtWorks 2008

Page 85: Code as a Communication Tool

© ThoughtWorks 2008

Page 86: Code as a Communication Tool

© ThoughtWorks 2008

Page 87: Code as a Communication Tool

© ThoughtWorks 2008

Page 88: Code as a Communication Tool

© ThoughtWorks 2008

Page 89: Code as a Communication Tool

© ThoughtWorks 2008

Page 90: Code as a Communication Tool

Domain Specific

Languages

Page 91: Code as a Communication Tool

© ThoughtWorks 2008

Page 92: Code as a Communication Tool

© ThoughtWorks 2008

Page 93: Code as a Communication Tool

• About us

• Introduction

• What?

• Why?

• How?

• Conclusion

Agenda

© ThoughtWorks 2008

Page 94: Code as a Communication Tool

Conclusion

Page 95: Code as a Communication Tool

Start to think about the

code as a communication

tool

Page 96: Code as a Communication Tool

Harness the power of the

tools at hand

Page 97: Code as a Communication Tool

Make the code talk the

domain knowledge

Page 98: Code as a Communication Tool

Write code for human

beings

Page 99: Code as a Communication Tool

More Information

XP Explained by Kent Beck

TDD by Example by Kent Beck

Implementation Patterns by Kent Beck

Refactoring by Martin Fowler

Clean Code by Bob Martin

Domain Driven Desing by Eric Evans

Literate Programming by David Knuth

Page 100: Code as a Communication Tool

about.me/vvgomes @MACSkeptic

Page 101: Code as a Communication Tool

Thanks :)

Page 102: Code as a Communication Tool

Did you like this subject?

Would you like to work with things

like that on a daily basis?

05/20/11 © ThoughtWorks 2008

Page 103: Code as a Communication Tool

Come get to know us, we are looking

for smart people interested in doing

awesome stuff

www.thoughtworks.com/career-opportunities

[email protected]

05/20/11 © ThoughtWorks 2008