Code as a Communication Tool
    AKA Usando as Linguagens ao Seu Favor


                                         Vinicius Gomes
                                                  Mozair


                 May, 23rd 2011

                   © ThoughtWorks 2008
Agenda

•   About us
•   Introduction
•   What?
•   Why?
•   How?
•   Conclusion

                   © ThoughtWorks 2008
Agenda

•   About us
•   Introduction
•   What?
•   Why?
•   How?
•   Conclusion

                   © ThoughtWorks 2008
About us



Vinicius Gomes                   Mozair
• about.me/vvgomes                @MACSkeptic
                                  github.com/macskeptic




                     © ThoughtWorks 2008
Agenda

•   About us
•   Introduction
•   What?
•   Why?
•   How?
•   Conclusion

                   © ThoughtWorks 2008
Introduction


    © ThoughtWorks 2008
Reading existing code is
      expensive
Understanding existing
  code is expensive
Finding out where to
change is expensive
Maintenance is expensive
So, what to do?
Agenda

•   About us
•   Introduction
•   What?
•   Why?
•   How?
•   Conclusion

                   © ThoughtWorks 2008
What?


 © ThoughtWorks 2008
Communicate through
  code effectively
Make it fast to read
Make it easy to understand
Express domain knowledge
     through software
Keep maintenance costs
         low
Agenda

•   About us
•   Introduction
•   What?
•   Why?
•   How?
•   Conclusion

                   © ThoughtWorks 2008
Why?


 © ThoughtWorks 2008
Maintenance
Tech Debt




 © ThoughtWorks 2008
Time to market vs. Technical debt




            © ThoughtWorks 2008
What we do


• XP
 –Communication
 –Simplicity
 –Feedback
 –Courage
 –Respect

             © ThoughtWorks 2008
Feedback




© ThoughtWorks 2008
Feedback


Project1                    Project2
 Unitary                     Unitary
 Project1               Project2
Functional             Functional
 Project1               Project2
Regression             Regression

           © ThoughtWorks 2008
Help your team
Help your team




• Make people more productive
Help your team




• Make people more productive
• Avoid ambiguous interpretation
Help your team




• Make people more productive
• Avoid ambiguous interpretation
• Drop stress levels
Help your team




•   Make people more productive
•   Avoid ambiguous interpretation
•   Drop stress levels
•   Help people to focus on the right things
Agenda

•   About us
•   Introduction
•   What?
•   Why?
•   How?
•   Conclusion

                   © ThoughtWorks 2008
How?


 © ThoughtWorks 2008
• Language constructs
• Language constructs
• Implementation Patterns
• Language constructs
• Implementation Patterns
• Domain Driven Design
•   Language constructs
•   Implementation Patterns
•   Domain Driven Design
•   Test Driven Development / Design
•   Language constructs
•   Implementation Patterns
•   Domain Driven Design
•   Test Driven Development / Design
•   Refactoring
•   Language constructs
•   Implementation Patterns
•   Domain Driven Design
•   Test Driven Development / Design
•   Refactoring
•   Domain Specific Languages
Language constructs
© ThoughtWorks 2008
© ThoughtWorks 2008
© ThoughtWorks 2008
© ThoughtWorks 2008
Avoid the Comic Sans Effect
Tell “what”, not “how”
© ThoughtWorks 2008
© ThoughtWorks 2008
© ThoughtWorks 2008
Implementation
   Patterns
Name by role
Abiding by the law of Demeter
Abstraction symmetry
One-line ifs
Test Driven
Design/Development


       © ThoughtWorks 2008
© ThoughtWorks 2008
© ThoughtWorks 2008
© ThoughtWorks 2008
© ThoughtWorks 2008
© ThoughtWorks 2008
Refactoring

    © ThoughtWorks 2008
© ThoughtWorks 2008
© ThoughtWorks 2008
© ThoughtWorks 2008
© ThoughtWorks 2008
© ThoughtWorks 2008
© ThoughtWorks 2008
Domain Specific
  Languages
© ThoughtWorks 2008
© ThoughtWorks 2008
Agenda

•   About us
•   Introduction
•   What?
•   Why?
•   How?
•   Conclusion

                   © ThoughtWorks 2008
Conclusion
Start to think about the
code as a communication
            tool
Harness the power of the
     tools at hand
Make the code talk the
 domain knowledge
Write code for human
       beings
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
about.me/vvgomes   @MACSkeptic
Thanks :)
Did you like this subject?

Would you like to work with things
    like that on a daily basis?


05/20/11             © ThoughtWorks 2008
Come get to know us, we are looking
 for smart people interested in doing
          awesome stuff 

www.thoughtworks.com/career-opportunities


           work@thoughtworks.com


05/20/11           © ThoughtWorks 2008

Code as a Communication Tool