Starting soon!
Join us on https://www.crowdcast.io/e/the-legacy-of-socrates--/register
Password: GoLegacyOfSoCraTes
#legacyCode #remote #conference
Join us on https://www.crowdcast.io/e/the-legacy-of-socrates--/register
Password: GoLegacyOfSoCraTes
#legacyCode #remote #conference
@pbourgau is starting the game with a live refactoring of Legacy Code with "Golden Master" and the @mikadomethod

"Golden Master" takeaways:
- enforces to distinct refactoring and new features
- don't push them in your CI
- they're here to help you refactor
- enforces to distinct refactoring and new features
- don't push them in your CI
- they're here to help you refactor
The @mikadomethod helps you not getting lost when you're working with Legacy Code.
It's a recipe you can follow to get your way out.
Now @pbourgau is about to show a live demo of it
It's a recipe you can follow to get your way out.
Now @pbourgau is about to show a live demo of it

"The Parking technique"
A place to put things you think you could improve w/ the code, but that are not related to your current goal
Helps you stay focus and get things out of your head
A place to put things you think you could improve w/ the code, but that are not related to your current goal
Helps you stay focus and get things out of your head
Things are starting to get crossed off the list.
We're getting out of the tunnel!
Also: commit frequently
We're getting out of the tunnel!
Also: commit frequently

Key takeaways from the Mikado Method:
- you can cut refactoring in parts small enough so you don't need to ask permission
- you can share the graph with others
- you can cut refactoring in parts small enough so you don't need to ask permission
- you can share the graph with others
Next up is @afilina 
She'll share her amazing expertise in working with very old Legacy codebases!
#legacyCode

She'll share her amazing expertise in working with very old Legacy codebases!
#legacyCode
"Let's rewrite this old Legacy system!"
Pick 10 new technologies to try out on the new system
Fail because of too many moving parts
Don't try too many things at once
Pick 10 new technologies to try out on the new system
Fail because of too many moving parts


2 useful tools to work with Legacy PHP codebases:
- PHP CodeSniffer https://github.com/squizlabs/PHP_CodeSniffer
- Rector https://github.com/rectorphp/rector
- PHP CodeSniffer https://github.com/squizlabs/PHP_CodeSniffer
- Rector https://github.com/rectorphp/rector
A more sustainable approach to migrate a codebase: a *progressive* rewrite
Don't freeze developments
Do this by module
The URL is an interface which can be implemented by different applications (modules)
Don't freeze developments
Do this by module
The URL is an interface which can be implemented by different applications (modules)
Refactor code when you need to change it
@martinfowler "Refactoring" book is a gold mine: https://martinfowler.com/books/refactoring.html
@martinfowler "Refactoring" book is a gold mine: https://martinfowler.com/books/refactoring.html
Unused endpoints are dead code. It slows you down.
Spot abandoned code and get rid of it.
Spot abandoned code and get rid of it.
Remote conferences have their own set of challenges.
Currently dealing with technical issues so we can get @ToF_ started
Thanks @adibolb is on it!
#legacyOfSocrates
Currently dealing with technical issues so we can get @ToF_ started

Thanks @adibolb is on it!
#legacyOfSocrates
And we're back!
@ToF_ is now speaking: "Stop managing technical debt and start solving problems again"
Let's focus on the end-users a bit
#legacyOfSocrates
@ToF_ is now speaking: "Stop managing technical debt and start solving problems again"
Let's focus on the end-users a bit

#legacyOfSocrates
It's an worthy exercise to deconstruct the heuristics, context and objectives behind a conflict
#legacyOfSocrates
#legacyOfSocrates
"Why did they put the POC in production?"
Well, that's a typical conflict of objectives
#legacyOfSocrates
Well, that's a typical conflict of objectives
#legacyOfSocrates
Align your state of the art
Bring all people together, give 'em post-its and discover the hidden conflicts
#legacyOfSocrates
Bring all people together, give 'em post-its and discover the hidden conflicts
#legacyOfSocrates
Our next great speaker is @alexboly
He'll present a way to refactor Legacy Code using pure functions
#legacyOfSocrates
He'll present a way to refactor Legacy Code using pure functions

#legacyOfSocrates
Slides are available here: https://www.slideshare.net/alexboly/refactor-legacy-code-through-pure-functions
#legacyOfSocrates
#legacyOfSocrates
Alex is mentioning the Strangler Pattern
As a reminder, @w3ltraumpirat did a great talk on this in the last edition:
As a reminder, @w3ltraumpirat did a great talk on this in the last edition:
Alex's approach follows 3 steps:
1. Refactor code to pure functions
2. Write data-driven or property-based tests on the pure functions
3. Refactor pure functions to classes (or something else)
#legacyOfSocrates
1. Refactor code to pure functions
2. Write data-driven or property-based tests on the pure functions
3. Refactor pure functions to classes (or something else)
#legacyOfSocrates
It's nice when functions are boring
When you go back home, you don't expect side-effects when you turn the lights on
#legacyOfSocrates
When you go back home, you don't expect side-effects when you turn the lights on

#legacyOfSocrates
"Any program can be used as a combination of pure functions & I/O functions"
Yes!
Domain vs. Infra => keep them separated
#legacyOfSocrates
Yes!
Domain vs. Infra => keep them separated
#legacyOfSocrates
Finally, @WoodyZuill is talking about #MobProgramming and how that can help you work with Legacy Code
Which is, to be honest, most of the code we need to work with
#legacyOfSocrates
Which is, to be honest, most of the code we need to work with

#legacyOfSocrates
"The driver is a smart input device" to the computer
Like, a smart keyboard
The rest of the team thinks, navigates
#legacyOfSocrates
Like, a smart keyboard
The rest of the team thinks, navigates
#legacyOfSocrates
Navigators share the cognitive load
You can relax: front-end experts will catch the front-end issues, SQL experts will remember the database exports, etc.
You don't have to keep everything in YOUR mind
#legacyOfSocrates
You can relax: front-end experts will catch the front-end issues, SQL experts will remember the database exports, etc.
You don't have to keep everything in YOUR mind
#legacyOfSocrates
It started with a team of 6 and:
- pair-programming
- refactoring
- introducing tests
Learning to do "solo" work as a team
#legacyOfSocrates
- pair-programming
- refactoring
- introducing tests
Learning to do "solo" work as a team
#legacyOfSocrates
And we're off!
That was great. We'll take some rest, publish the videos and plan a 3rd edition some time later
Thank you @adibolb for dealing with the tech side and @pbourgau @afilina @ToF_ @alexboly @WoodyZuill for the amazing talks

#legacyOfSocrates
That was great. We'll take some rest, publish the videos and plan a 3rd edition some time later

Thank you @adibolb for dealing with the tech side and @pbourgau @afilina @ToF_ @alexboly @WoodyZuill for the amazing talks


#legacyOfSocrates