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

Switching off legacy code using one Symfony com...

Switching off legacy code using one Symfony command at a time

Loulier Guillaume

November 07, 2023
Tweet

More Decks by Loulier Guillaume

Other Decks in Programming

Transcript

  1. Hellcome Guillaume Loulier / @Guikingone Lead developer @SensioLabs Works mainly

    with PHP and Rust Sometimes, I break things, especially legacy ones (and I like that)
  2. Summary 01 - Legacy code is fun 02 - Migrating,

    a far far away dream 04 - Symfony to the rescue 05 - Wrapping up 01
  3. Diving into the joke Refu*toring - The process of taking

    a well-designed piece of code and, through a series of small, reversible changes, making it completely unmaintainable by anyone except yourself. Jason Gorman
  4. Let the fun begin A legacy code is just an

    abandoned one that generate revenues Maintaining legacy code should be easy At least, until it breaks Never needed to migrate PHP 5 code?
  5. Dealing with technical debt Technical debt is ambiguous Yesterday code

    is already outdated, sorry Need to migrate it? Bon chance
  6. Time for a wishlist Tracking, being aware of changes, updating

    and deleting A new interface? For which use case? What about this method arguments type? Code spread across repositories?
  7. Sadly What about using a dedicated channel? Or using trigger_error?

    Or tools like Sentry, OpenTelemetry and many more? What if we’re in a special architecture?
  8. The full experience Symfony brings a lot of components Could

    we bring them together to help us? Look at Rector, PHPStan and more! What if we could “track & switch off” files?
  9. Time to “Switchoff” Built on top of Symfony components and

    nikic/PHP-Parser (chief kiss) Attributes for the win! Analyze, check, switch off, repeat Could be used via the CLI / CI
  10. To sum it up Handling migration is hard, not to

    say boring Symfony could ease the process but lack of tools Relying on a framework is a recipe for failure Each project has its own rules / flaws
  11. What about switchoff? Not fully stable (for now) A Symfony

    bundle? (Already planned) An HTML dashboard What about a PHPStan / Rector bridge?