Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Defensive Programming - Fear Driven Development

0ee0f29e8f94b94a9ed3a114f028855b?s=47 Lior Sion
February 26, 2013

Defensive Programming - Fear Driven Development

What does it mean to develop in fear, why it happens and what you should do to avoid it in your team - a presentation for Reversim Summit 2013

0ee0f29e8f94b94a9ed3a114f028855b?s=128

Lior Sion

February 26, 2013
Tweet

More Decks by Lior Sion

Other Decks in Programming

Transcript

  1. Defensive Programming The Best Defense is a good Offense Tuesday,

    February 26, 13
  2. little about me Product, technology and development consultant RoR, Python/Django,

    Performance is my passion Development methodologies, agile and effective patterns @liorsion, about.me/liorsion Tuesday, February 26, 13
  3. defensive dev It’s mostly about psychology Ruby code as example

    For every rule there’s an exception Tuesday, February 26, 13
  4. defensive dev It’s mostly about psychology Ruby code as example

    For every rule there’s an exception Tuesday, February 26, 13
  5. defensive dev It’s mostly about psychology Ruby code as example

    For every rule there’s an exception Tuesday, February 26, 13
  6. defensive dev It’s mostly about psychology Ruby code as example

    For every rule there’s an exception Tuesday, February 26, 13
  7. Best practices Always validate your input - everywhere! Tuesday, February

    26, 13
  8. Validate input Tuesday, February 26, 13

  9. dangerous exceptions Always safeguard from exceptions Tuesday, February 26, 13

  10. naming Naming is not that important Tuesday, February 26, 13

  11. Multi threading When in doubt - lock it! Tuesday, February

    26, 13
  12. Multi threading When in doubt - lock it! Tuesday, February

    26, 13
  13. More refactoring Don’t refactor if you don’t know the code

    Tuesday, February 26, 13
  14. More refactoring W r o n g ! Don’t refactor

    if you don’t know the code Tuesday, February 26, 13
  15. More refactoring W r o n g ! Tuesday, February

    26, 13
  16. Best practices Always validate your input - everywhere! Tuesday, February

    26, 13
  17. Validate input Tuesday, February 26, 13

  18. dangerous exceptions Always safeguard from exceptions Tuesday, February 26, 13

  19. naming Naming is not that important Tuesday, February 26, 13

  20. naming Naming is not that important Tuesday, February 26, 13

  21. Multi threading When in doubt - lock it! Tuesday, February

    26, 13
  22. Multi threading When in doubt - lock it! Tuesday, February

    26, 13
  23. Multi threading When in doubt - lock it! Tuesday, February

    26, 13
  24. More refactoring Don’t refactor if you don’t know the code

    Tuesday, February 26, 13
  25. More refactoring Tuesday, February 26, 13

  26. why do that? Don’t know better Can’t be bothered Tuesday,

    February 26, 13
  27. why do that? Don’t know better Can’t be bothered Afraid

    of production meltdown Tuesday, February 26, 13
  28. why do that? Don’t know better Can’t be bothered Afraid

    of production meltdown Need to teach Tuesday, February 26, 13
  29. why do that? Don’t know better Can’t be bothered Afraid

    of production meltdown Need to fire Need to teach Tuesday, February 26, 13
  30. why do that? Don’t know better Can’t be bothered Afraid

    of production meltdown Need to fire Why? Need to teach Tuesday, February 26, 13
  31. Most popular reasons We’re in a hurry The code is

    too complicated I don’t know what is going on there There’s code smell in this area There are no tests Tuesday, February 26, 13
  32. But really.. Fear is a bitch, and is near sighted

    Tuesday, February 26, 13
  33. space time theories There’s never enough time But spending the

    time saves time, always Tuesday, February 26, 13
  34. space time theories There’s never enough time But spending the

    time saves time, always On Quality Tuesday, February 26, 13
  35. Fear Fear is an emotion induced by a perceived threat

    which causes entities to quickly pull away from it and usually hide People develop specific fears as a result of learning. Fear is paralyzing Paralyze is spiral, technical debt is collecting => startup death Tuesday, February 26, 13
  36. Knowing your code Tuesday, February 26, 13

  37. refactor huge code http://thejoysofcode.com/post/35328929865/when-it-is-announced-i-must- refactor-5000-lines-of-code When I see huge methods..

    Tuesday, February 26, 13
  38. Refactor Small Fast Ongoing Tuesday, February 26, 13

  39. defense Be aware, always Tuesday, February 26, 13

  40. Patterns, really? Tuesday, February 26, 13

  41. psychology Don’t punish mistakes Don’t punish a task that spirals

    FOR GOOD REASONS In short - don’t punish Tuesday, February 26, 13
  42. Why should we care? Tuesday, February 26, 13

  43. My work here is done Find me: @liorsion Find funny

    images: http://thejoysofcode.com Tuesday, February 26, 13
  44. Thank you our sponsors Tuesday, February 26, 13