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

How to rewrite, a bit at a time

How to rewrite, a bit at a time

Domain-Driven Design Europe 2019

Sabrina Leandro

February 01, 2019
Tweet

More Decks by Sabrina Leandro

Other Decks in Technology

Transcript

  1. How to rewrite,
    a bit at a time
    Sabrina Leandro
    @saleandro
    Domain-Driven Design Europe 2019

    View full-size slide

  2. Rewrites at Songkick

    View full-size slide

  3. Rewrites at Songkick
    1. Songkick.com

    View full-size slide

  4. Rewrites at Songkick
    1. Songkick.com
    2. Tickets store

    View full-size slide

  5. Rewrites at Songkick
    1. Songkick.com
    2. Tickets store
    3. Internal tools

    View full-size slide

  6. BIG REWRITE STRIKES AGAIN

    View full-size slide

  7. BIG REWRITE STRIKES AGAIN

    View full-size slide

  8. • The problem
    • How to start a rewrite project
    • How to run it
    • How to finish it
    • How to not need it again!
    This talk

    View full-size slide

  9. Stop me if you think you’ve heard this one before
    The problem

    View full-size slide

  10. 10101
    11001
    10101110011010
    11100110011100
    11100111001100
    11100111001110
    00101011100111
    00111001

    View full-size slide

  11. Software Entropy
    10101
    11001
    10101110011010
    11100110011100
    11100111001100
    11100111001110
    00101011100111
    00111001

    View full-size slide

  12. Complex abstractions
    Lots of features
    Too many slow tests
    Little to no tests
    No clear abstractions
    Lots of features

    View full-size slide

  13. Complex abstractions
    Lots of features
    Too many slow tests
    Little to no tests
    No clear abstractions
    Lots of features
    Tickets store &
    Internal tools

    View full-size slide

  14. Complex abstractions
    Lots of features
    Too many slow tests
    Little to no tests
    No clear abstractions
    Lots of features
    Songkick.com
    Tickets store &
    Internal tools

    View full-size slide

  15. How to start it

    View full-size slide

  16. •Is it the right time?
    •Is it the right reason?

    View full-size slide

  17. Is it the right time?
    Discovery vs Delivery

    View full-size slide

  18. Is it the right time?
    Yes, if the product has a
    clear business value today.

    View full-size slide

  19. Is it the right reason?
    What difference does
    it make?

    View full-size slide

  20. Is it the right reason?
    Yes, if there’s one clear
    business case.

    View full-size slide

  21. PLEASE
    PLEASE
    PLEASE
    Let me get what I want

    View full-size slide

  22. How to sell it
    Have one clear
    business case

    View full-size slide

  23. How to sell it
    Show what a great
    new world it will be!

    View full-size slide

  24. How to sell it
    Find allies outside of
    your team

    View full-size slide

  25. Make
    the
    pain
    visible
    How to sell it

    View full-size slide

  26. How to sell it
    Do Repeat Yourself

    View full-size slide

  27. How to sell it
    Do Repeat Yourself
    Do Repeat Yourself

    View full-size slide

  28. How to run it

    View full-size slide

  29. Technical vision and strategy
    Now The future!
    ???

    View full-size slide

  30. Technical vision and strategy
    Now The future!

    View full-size slide

  31. Technical vision and strategy
    Now The future!
    Steps to get there
    ???

    View full-size slide

  32. Now Bright future!
    Team 2: Building new application
    Rewrite from scratch
    Legacy
    application
    Team 1: Maintaining legacy application

    View full-size slide

  33. Now Bright future!
    Team 2: Building new application
    Rewrite from scratch
    Legacy
    application
    Team 1: Maintaining legacy application

    View full-size slide

  34. Now Bright future!
    Team 2: Building new application
    Rewrite from scratch
    Legacy
    application
    Team 1: Maintaining legacy application
    Legacy
    application

    View full-size slide

  35. Now Bright future!
    Team 2: Building new application
    Rewrite from scratch
    Legacy
    application
    Team 1: Maintaining legacy application
    New
    Legacy
    application

    View full-size slide

  36. Now Bright future!
    Team 2: Building new application
    Rewrite from scratch
    Legacy
    application
    Team 1: Maintaining legacy application
    New
    Legacy
    application
    Legacy
    application

    View full-size slide

  37. Now Bright future!
    Team 2: Building new application
    Rewrite from scratch
    Legacy
    application
    Team 1: Maintaining legacy application
    New
    Legacy
    application
    Legacy
    application
    New
    application

    View full-size slide

  38. Now Bright future!
    Team 2: Building new application
    Rewrite from scratch
    Legacy
    application
    Team 1: Maintaining legacy application
    New
    New
    application
    Legacy
    application
    Legacy
    application
    New
    application

    View full-size slide

  39. Now Bright future!
    Team 2: Building new application
    Rewrite from scratch
    Legacy
    application
    Team 1: Maintaining legacy application
    New
    New
    application
    Legacy
    application
    Legacy
    application
    RIP
    Legacy
    application
    New
    application

    View full-size slide

  40. Now Bright future!
    Team 2: Building new application
    Rewrite from scratch
    Legacy
    application
    Team 1: Maintaining legacy application
    New
    New
    application
    VALUE
    Legacy
    application
    Legacy
    application
    RIP
    Legacy
    application
    New
    application

    View full-size slide

  41. Now Bright future!
    Team 2: Building new application
    Rewrite from scratch
    Legacy
    application
    Team 1: Maintaining legacy application
    New
    Legacy
    application
    Legacy
    application
    New
    application

    View full-size slide

  42. Now Bright future!
    Team 2: Building new application
    Rewrite from scratch
    Legacy
    application
    Team 1: Maintaining legacy application
    New
    Legacy
    application
    Legacy
    application
    New
    application
    Legacy
    application

    View full-size slide

  43. “Rewrite from scratch:
    Waterfall process of
    rewrites

    View full-size slide

  44. The strangler
    application

    View full-size slide

  45. Team 1: Maintaining legacy and building new application
    Now Bright future!
    Rewrite using strangler

    View full-size slide

  46. Team 1: Maintaining legacy and building new application
    Now Bright future!
    Rewrite using strangler

    View full-size slide

  47. Team 1: Maintaining legacy and building new application
    Now Bright future!
    Rewrite using strangler

    View full-size slide

  48. Team 1: Maintaining legacy and building new application
    Now Bright future!
    Rewrite using strangler

    View full-size slide

  49. Team 1: Maintaining legacy and building new application
    Now Bright future!
    Rewrite using strangler

    View full-size slide

  50. Team 1: Maintaining legacy and building new application
    Now Bright future!
    Rewrite using strangler

    View full-size slide

  51. Team 1: Maintaining legacy and building new application
    New
    applicati
    Now Bright future!
    Rewrite using strangler

    View full-size slide

  52. Team 1: Maintaining legacy and building new application
    New
    applicati
    Now Bright future!
    Rewrite using strangler

    View full-size slide

  53. Team 1: Maintaining legacy and building new application
    New
    applicati
    Now Bright future!
    Rewrite using strangler

    View full-size slide

  54. Team 1: Maintaining legacy and building new application
    New
    applicati
    Now Bright future!
    Rewrite using strangler

    View full-size slide

  55. Team 1: Maintaining legacy and building new application
    New
    applicati
    VALUE!
    Now Bright future!
    Rewrite using strangler

    View full-size slide

  56. /orders
    /customers

    View full-size slide

  57. /orders
    /customers
    new/customers

    View full-size slide

  58. /orders /customers

    View full-size slide

  59. /orders /customers
    Build
    Validate
    Replace
    Delete
    Repeat

    View full-size slide

  60. “ Deleting is faster
    than rewriting

    View full-size slide

  61. Cut features
    to move
    faster
    Must haves
    Should haves
    Won’t haves

    View full-size slide

  62. Must haves: main proposition
    Should haves: if there’s time
    Won’t haves: remove completely
    Cut features
    to move
    faster

    View full-size slide

  63. “ If we were starting over,
    what would we build today,
    knowing what we know now?

    View full-size slide

  64. During the project

    View full-size slide

  65. How to run it
    Do one thing at a time

    View full-size slide

  66. 1. Find the biggest blocker
    2. Remove it completely
    3. Repeat
    How to run it
    Warning: Step 2 might involve more than coding

    View full-size slide

  67. How to run it
    Celebrate your
    successes!

    View full-size slide

  68. That joke isn’t funny anymore…
    How to run it
    Do Repeat Yourself,
    again

    View full-size slide

  69. How to finish it

    View full-size slide

  70. How to finish it
    I started something I couldn’t finish

    View full-size slide

  71. How to finish it
    These things 

    take time

    View full-size slide

  72. How to not need it again

    View full-size slide

  73. 10101
    11001
    10101110011010
    11100110011100
    11100111001100
    11100111001110
    001010111
    Time…
    Software Entropy

    View full-size slide

  74. How to not need it again
    Make the cost visible

    View full-size slide

  75. DELETE
    CODE
    FEATURES

    View full-size slide

  76. DELETE
    CODE
    FEATURES
    PRODUCTS

    View full-size slide

  77. “ If we were starting over,
    what would we build today,
    knowing what we know now?

    View full-size slide

  78. Make it part of your
    day-to-day
    How to not need it again

    View full-size slide

  79. “ A refactor a day keeps
    the rewrite away!

    View full-size slide

  80. How to not need it again
    A little bit and often

    View full-size slide

  81. How to not need it again
    Get used to
    inconsistencies

    View full-size slide

  82. Technical migrations
    Continuously deliver
    value
    Delete what’s not
    valuable
    One business
    goal

    View full-size slide

  83. Sustainable Software
    Make maintenance
    cost visible
    Learn and collaborate
    Refactor a little bit
    and often

    View full-size slide

  84. Thanks!
    Sabrina, take a bow…
    [email protected]
    @saleandro

    View full-size slide

  85. Bigmouth Strikes Again
    This Charming Man
    Stop Me If You Think You’ve Heard This One Before
    What Difference Does It Make?
    Please, Please, Please, Let Me Get What I Want
    That Joke Isn’t Funny Anymore
    I Started Something I Couldn’t Finish
    These Things Take Time
    Sheila Take A Bow
    Thanks!
    Sabrina, take a bow…
    [email protected]
    @saleandro

    View full-size slide

  86. Songkick.com rewrite
    • https://devblog.songkick.com/the-path-to-soa-d986a18d4a8b
    • https://devblog.songkick.com/our-object-based-rails-frontend-3e2ddc048d12
    • https://www.youtube.com/watch?v=-VEf8j6aGMk
    • https://www.martinfowler.com/bliki/StranglerApplication.html
    Celebrate your successes
    • https://medium.com/@Songkick/gamify-your-product-team-to-power-
    level-9000-261e9fceaa22
    Hoarders metaphor / Liveable code
    • https://twitter.com/sarahmei/status/783115752794492928
    • https://brightonruby.com/2017/livable-code-sarah-mei/
    • https://twitter.com/kentbeck/status/856537528886673408
    Product discovery and product delivery
    • http://jpattonassociates.com/dual-track-development/
    • https://martinfowler.com/bliki/DesignStaminaHypothesis.html
    • https://www.facebook.com/notes/kent-beck/teams-in-3x/1244519748914220/
    References

    View full-size slide

  87. References
    Make the cost visible
    • http://codemanship.co.uk/parlezuml/blog/?postid=1433
    • http://blogs.msdn.com/b/elee/archive/2009/03/11/source-code-is-a-liability-not-an-
    asset.aspx
    Make it part of your day-to-day
    • https://martinfowler.com/bliki/OpportunisticRefactoring.html
    • http://ronjeffries.com/xprog/articles/refactoring-not-on-the-backlog/
    • http://firstround.com/review/forget-technical-debt-heres-how-to-build-technical-
    wealth/
    • https://www.infoq.com/presentations/microservices-replaceability-consistency
    • https://www.sandimetz.com/blog/2017/6/1/the-half-life-of-code
    • https://www.infoq.com/presentations/remove-unneeded-code
    Playlist :)
    • https://open.spotify.com/user/saleandro/playlist/6i3RVHtys4djlYlLLGZc26

    View full-size slide