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 full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  5. of Ruby
    programming
    “17,520 hours”

    View full-size slide

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

    View full-size slide

  7. 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 full-size slide

  8. there isn’t such
    thing as bad code

    View full-size slide

  9. println "Hello World"

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  13. Not scientific terms
    • Religion
    • Ethics
    • Philosophy

    View full-size slide

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

    View full-size slide

  15. 1. define expected outcome

    View full-size slide

  16. 2. evaluate solutions

    View full-size slide

  17. 3. implement

    View full-size slide

  18. 4. re-evaluate

    View full-size slide

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

    View full-size slide

  20. don’t
    write code

    View full-size slide

  21. materialize
    ideas

    View full-size slide

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

    View full-size slide

  23. delivered the expected
    outcome

    View full-size slide

  24. hard to understand

    View full-size slide

  25. hard to maintain

    View full-size slide

  26. hard to scale

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  33. communicate!

    View full-size slide

  34. focus on the outcome while
    learning & improving

    View full-size slide

  35. @mattetti
    @sandimetz
    @kytrinyx

    View full-size slide