our philosophy
play

Our Philosophy Write readable code Care about the detail Make it - PowerPoint PPT Presentation

Programming in the Small Ivan Moore & Mike Hill Our Philosophy Write readable code Care about the detail Make it routine Its important Explanation by Example Mini-series of programming episodes Interactive demo in


  1. Programming in the Small Ivan Moore & Mike Hill

  2. Our Philosophy • Write readable code • Care about the detail • Make it routine • It’s important

  3. Explanation by Example • Mini-series of programming episodes • Interactive demo in Java

  4. 1. “Where to Start?”

  5. Examples can be downloaded from http://www.exdriven.co.uk/pits/ • Pair up • Look at the 1st example, Checker.java • Read through the code, and think about what you’d like to do to it...

  6. Thoughts?

  7. PITS Lessons (1) • Start with small improvements: • Convert comments into code • Fix the formatting • Remove unnecessary code (use the IDE to warn you about this)

  8. 2. “When to Stop!”

  9. Examples can be downloaded from http://www.exdriven.co.uk/pits/ • Pair up • Look at the 2nd example, Args.java • If you owned this code, what would you do to it?

  10. Thoughts?

  11. PITS Lessons (2) • Attempt to remove all duplication - even if small • Multiple exits can improve readability (breaking structured programming rules) • Make declarations as local as possible

  12. 3. “Don’t stop now!”

  13. Examples can be downloaded from http://www.exdriven.co.uk/pits/ • Pair up • Look at the 3rd example, BusinessDay.java • Does this look ok to you?

  14. Thoughts?

  15. PITS Lessons (3) • Simplify your conditionals • Removing duplication sometimes requires the creation of tiny function/policy objects

  16. Extra PITS • Be discreet - keep your privates private • Avoid statics and NoJos in favour of objects with behaviour • Hide your primitives inside domain objects

  17. Recap...

  18. Recap... ★ Don’t write pointless comments

  19. Recap... ★ Don’t write pointless comments ★ Fix your formatting - show that you care

  20. Recap... ★ Don’t write pointless comments ★ Fix your formatting - show that you care ★ Turn up your warnings and delete more code

  21. Recap... ★ Don’t write pointless comments ★ Fix your formatting - show that you care ★ Turn up your warnings and delete more code ★ Remove the little bits of duplication

  22. Recap... ★ Don’t write pointless comments ★ Fix your formatting - show that you care ★ Turn up your warnings and delete more code ★ Remove the little bits of duplication ★ Break stupid structured programming rules

  23. Recap... ★ Don’t write pointless comments ★ Fix your formatting - show that you care ★ Turn up your warnings and delete more code ★ Remove the little bits of duplication ★ Break stupid structured programming rules ★ Keep your scoping local and private

  24. Recap... ★ Don’t write pointless comments ★ Fix your formatting - show that you care ★ Turn up your warnings and delete more code ★ Remove the little bits of duplication ★ Break stupid structured programming rules ★ Keep your scoping local and private ★ Write domain objects with behaviour

  25. It’s the PITS! Ivan’s blog :: http://puttingtheteaintoteam.blogspot.com/ PITS articles :: http://ivan.truemesh.com/archives/cat_programming_in_the_small.htm Contact us :: mike@exdriven.co.uk and ivan@teamoptimization.com

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend