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

Wicked Bad Ruby

Wicked Bad Ruby

Bad code doesn't exist, but code quality is a real and hard issue to address.
Presentation given at Wicked Good Ruby Boston 2012

Matt Aimonetti

October 12, 2013
Tweet

More Decks by Matt Aimonetti

Other Decks in Programming

Transcript

  1. Matt Aimonetti
    Boston 2013
    W I C K E D
    BAD RUBY

    View Slide

  2. @mattetti
    http://matt.aimonetti.net
    Matt
    Aimonetti

    View Slide

  3. @mattetti
    http://matt.aimonetti.net
    Matt
    Aimonetti
    Steve
    Martocci

    View Slide

  4. @mattetti
    http://matt.aimonetti.net
    Matt
    Aimonetti
    Steve
    Martocci

    View Slide

  5. of Ruby
    programming
    “17,520 hours”

    View Slide

  6. View Slide

  7. View Slide

  8. Avdi Grimm
    “the messiest, nastiest
    big-ball-of-mud code
    I have seen in my entire
    career
    has been in Rails projects.”

    View Slide

  9. Matt Van Horn
    “I once saw a Rails controller
    over 3KLOC long with 500
    line create and update
    methods that were 85% cut &
    pasted from each other.”

    View Slide

  10. there isn’t such
    thing as bad code

    View Slide

  11. println "Hello World"

    View Slide

  12. name
    “Code is neither good or evil,
    but only a place for good and
    evil”
    Caesar Marcus “coder” Aurelius

    View Slide

  13. good / bien (fr) / bueno (es)
    “having desirable quality”

    View Slide

  14. bad / mauvais (fr) / malo (es)
    “undesirable”

    View Slide

  15. Not scientific terms
    • Religion
    • Ethics
    • Philosophy

    View Slide

  16. Spice Girls
    “So tell me what you want,
    what you really, really want”

    View Slide

  17. 1. define expected outcome

    View Slide

  18. 2. evaluate solutions

    View Slide

  19. 3. implement

    View Slide

  20. 4. re-evaluate

    View Slide

  21. Me
    “you aren’t paid to write
    ‘good’ code, you’re paid to
    deliver great products”

    View Slide

  22. don’t
    write code

    View Slide

  23. materialize
    ideas

    View Slide

  24. understand
    what you are
    building
    business objectives
    timeline
    proposition value
    players
    risk factors
    ...

    View Slide

  25. emo code

    View Slide

  26. delivered the expected
    outcome

    View Slide

  27. but then...

    View Slide

  28. hard to understand

    View Slide

  29. hard to maintain

    View Slide

  30. hard to scale

    View Slide

  31. slow

    View Slide

  32. Every other
    Hacker News
    comment
    “You’re doing it wrong”

    View Slide

  33. View Slide

  34. Sandi Metz
    “Classes can be no longer
    than one hundred lines of
    code”

    View Slide

  35. Sandi Metz
    “Methods can be no longer
    than five lines of code”

    View Slide

  36. Some
    StackOverflow
    Rubyist
    “You can’t write good code
    unless you use TDD”

    View Slide

  37. View Slide

  38. • fast iterations
    • level of confidence
    • robustness
    • syntax beauty
    • abstraction level
    • simplicity
    • known patterns
    • performance
    • limited dependencies
    • test first
    • learning curve

    View Slide

  39. Amy Hoy
    “If you try to dictate to other
    people what their values
    should be, you’re an asshole”

    View Slide

  40. communicate!

    View Slide

  41. focus on the outcome while
    learning & improving

    View Slide

  42. @mattetti

    View Slide

  43. @mattetti
    @sandimetz
    @kytrinyx

    View Slide