SlideShare a Scribd company logo
1 of 37
The Big Rewrite
Iulian Dogariu
#CodeCampIasi 25 April 2015
Big rewrite or not?
This is the question
A. I can't work with it
• Missing source code
• Missing protocol documentation, passwords
• Missing tooling (e.g. no licence for Visual C++
5.0)
• Legal or regulatory reasons
B. It won't work properly
• Breaks often in production
• Performs poorly
• Hard to deploy
• No monitoring or logging
C. I won't work with it
• Brittle code
• Big ball of mud
• Hidden knowledge
• I don't know the language
• Unused code
Start from scratch?
"Programmers are, in their hearts,
architects, and the first thing they want to do
when they get to a site is to bulldoze the
place flat and build something grand.
We're not excited by incremental renovation:
tinkering, improving, planting flower beds."
-- Joel Spolsky - "Things You Should Never Do"
http://www.joelonsoftware.com/articles/fog0000000069.html
"Programmers are, in their hearts,
architects, and the first thing they want to do
when they get to a site is to bulldoze the
place flat and build something grand.
We're not excited by incremental renovation:
tinkering, improving, planting flower beds."
-- Joel Spolsky - "Things You Should Never Do"
http://www.joelonsoftware.com/articles/fog0000000069.html
It's never just the code
Sysops
Third parties
Designers
Other teams
Marketing
Technology
salesmen
Politics
I'll write a 5000 line function today
The fearsome Estimator
with no skin in the game
So now we're aware of
• Our inherent biases as developers
• The technical ecosystem
• The office politics
• The uncertainties re time and scope
The absolute essentials
The absolute essentials
• Infrastructure automation
• Automation test suite through the UI
• Business vocabulary
At least Try
(to work with the legacy code)
The T word
Steps to introduce tests
in legacy code
• Find where to make the changes
• Find what to test
• Break dependencies (without refactoring)
• Write tests
• Make changes and refactor
That didn't work
You still want to rewrite :-)
Swallow small bits
Swallow small bits
• Carve an integration point (service, DB)
• Rewrite only the parts that touch it
• Don't try to rewrite the whole monolith at once
Rewrite by feature,
not by module
• Play to the strengths of your target language and
framework
• Don't replicate past implementation
Take your time
• Insist on quality
• Train the team. Build good habits
• Absorb the culture of your new
language/framework
• Be aware of cultural dissonances
If you're a startup
Q & A
Thank you!
Get in touch:
hello <at> iuliandogariu <dot> com
@yu_li_yan
Please help our nice hosts #Codecampiasi,
give them feedback

More Related Content

What's hot

Trust Me, I'm An Architect
Trust Me, I'm An ArchitectTrust Me, I'm An Architect
Trust Me, I'm An ArchitectKeir Bowden
 
2012 Chicago Fellowship Presentation to Code for Japan
2012 Chicago Fellowship Presentation to Code for Japan2012 Chicago Fellowship Presentation to Code for Japan
2012 Chicago Fellowship Presentation to Code for JapanMr0grog
 
How to Build Software If You Can't Write Code
How to Build Software If You Can't Write CodeHow to Build Software If You Can't Write Code
How to Build Software If You Can't Write CodeRussell Wallace
 
What schools should be teaching IT students
What schools should be teaching IT studentsWhat schools should be teaching IT students
What schools should be teaching IT studentsAndy Lester
 
Hiring a developer: step by step debugging
Hiring a developer: step by step debuggingHiring a developer: step by step debugging
Hiring a developer: step by step debuggingLaurent Cerveau
 
How to hire and keep engineers happy public
How to hire and keep engineers happy publicHow to hire and keep engineers happy public
How to hire and keep engineers happy publicPiaw Na
 
Dancing for a product release
Dancing for a product releaseDancing for a product release
Dancing for a product releaseLaurent Cerveau
 
NYU ITP Lean LaunchPad Development Planning
NYU ITP Lean LaunchPad Development Planning NYU ITP Lean LaunchPad Development Planning
NYU ITP Lean LaunchPad Development Planning Jen van der Meer
 
Things we learned building a native IOS app
Things we learned building a native IOS appThings we learned building a native IOS app
Things we learned building a native IOS appPlantola
 
S taylor ILI 2012 Presentation
S taylor ILI 2012 PresentationS taylor ILI 2012 Presentation
S taylor ILI 2012 PresentationStephanie Taylor
 
Event tech 101 -- Online Webinars with Adobe Connect
Event tech 101 -- Online Webinars with Adobe ConnectEvent tech 101 -- Online Webinars with Adobe Connect
Event tech 101 -- Online Webinars with Adobe ConnectAdam Schrecengost
 
The software evolution hasn't happened yet
The software evolution hasn't happened yetThe software evolution hasn't happened yet
The software evolution hasn't happened yetEmilien Pecoul
 
Frontend Engineer Hiring Explained at Wix Engineering
Frontend Engineer Hiring Explained at Wix EngineeringFrontend Engineer Hiring Explained at Wix Engineering
Frontend Engineer Hiring Explained at Wix EngineeringTomas Miliauskas
 
Be More Salmon - Agile Manchester 2016
Be More Salmon - Agile Manchester 2016Be More Salmon - Agile Manchester 2016
Be More Salmon - Agile Manchester 2016Duncan Nisbet
 

What's hot (20)

Trust Me, I'm An Architect
Trust Me, I'm An ArchitectTrust Me, I'm An Architect
Trust Me, I'm An Architect
 
How to do b tech be projects or any academic projects
How to do b tech be projects or any academic projectsHow to do b tech be projects or any academic projects
How to do b tech be projects or any academic projects
 
2012 Chicago Fellowship Presentation to Code for Japan
2012 Chicago Fellowship Presentation to Code for Japan2012 Chicago Fellowship Presentation to Code for Japan
2012 Chicago Fellowship Presentation to Code for Japan
 
How to Build Software If You Can't Write Code
How to Build Software If You Can't Write CodeHow to Build Software If You Can't Write Code
How to Build Software If You Can't Write Code
 
What schools should be teaching IT students
What schools should be teaching IT studentsWhat schools should be teaching IT students
What schools should be teaching IT students
 
Hiring a developer: step by step debugging
Hiring a developer: step by step debuggingHiring a developer: step by step debugging
Hiring a developer: step by step debugging
 
How to hire and keep engineers happy public
How to hire and keep engineers happy publicHow to hire and keep engineers happy public
How to hire and keep engineers happy public
 
Dancing for a product release
Dancing for a product releaseDancing for a product release
Dancing for a product release
 
NYU ITP Lean LaunchPad Development Planning
NYU ITP Lean LaunchPad Development Planning NYU ITP Lean LaunchPad Development Planning
NYU ITP Lean LaunchPad Development Planning
 
Things we learned building a native IOS app
Things we learned building a native IOS appThings we learned building a native IOS app
Things we learned building a native IOS app
 
S taylor ILI 2012 Presentation
S taylor ILI 2012 PresentationS taylor ILI 2012 Presentation
S taylor ILI 2012 Presentation
 
Event tech 101 -- Online Webinars with Adobe Connect
Event tech 101 -- Online Webinars with Adobe ConnectEvent tech 101 -- Online Webinars with Adobe Connect
Event tech 101 -- Online Webinars with Adobe Connect
 
Introduction to TDD
Introduction to TDDIntroduction to TDD
Introduction to TDD
 
Binary crosswords
Binary crosswordsBinary crosswords
Binary crosswords
 
Project management difference between industry and college
Project management difference between industry and collegeProject management difference between industry and college
Project management difference between industry and college
 
The software evolution hasn't happened yet
The software evolution hasn't happened yetThe software evolution hasn't happened yet
The software evolution hasn't happened yet
 
Frontend Engineer Hiring Explained at Wix Engineering
Frontend Engineer Hiring Explained at Wix EngineeringFrontend Engineer Hiring Explained at Wix Engineering
Frontend Engineer Hiring Explained at Wix Engineering
 
Current resume 2016
Current resume 2016Current resume 2016
Current resume 2016
 
Peer review
Peer reviewPeer review
Peer review
 
Be More Salmon - Agile Manchester 2016
Be More Salmon - Agile Manchester 2016Be More Salmon - Agile Manchester 2016
Be More Salmon - Agile Manchester 2016
 

Similar to The bigrewrite

How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....Mike Harris
 
What IS SharePoint Development?
What IS SharePoint Development?What IS SharePoint Development?
What IS SharePoint Development?Mark Rackley
 
How pair programming can strengthen teams
How pair programming can strengthen teamsHow pair programming can strengthen teams
How pair programming can strengthen teamsHugo Messer
 
CTO Crunch avec Julien Simon, Viadeo
CTO Crunch avec Julien Simon, ViadeoCTO Crunch avec Julien Simon, Viadeo
CTO Crunch avec Julien Simon, ViadeoFrance Digitale
 
Life in the tech trenches (2015)
Life in the tech trenches (2015)Life in the tech trenches (2015)
Life in the tech trenches (2015)Julien SIMON
 
It's XP Stupid (2019)
It's XP Stupid (2019)It's XP Stupid (2019)
It's XP Stupid (2019)Mike Harris
 
Agile - A failure story
Agile - A failure storyAgile - A failure story
Agile - A failure storyMiki Lior
 
The Lost Tales of Platform Design (February 2017)
The Lost Tales of Platform Design (February 2017)The Lost Tales of Platform Design (February 2017)
The Lost Tales of Platform Design (February 2017)Julien SIMON
 
05 DIGI CREATIVE people&process
05 DIGI CREATIVE people&process05 DIGI CREATIVE people&process
05 DIGI CREATIVE people&processSheSaysCREATIVE
 
Android Developer Skills, Techniques, and Patterns
Android Developer Skills, Techniques, and PatternsAndroid Developer Skills, Techniques, and Patterns
Android Developer Skills, Techniques, and Patternsgdgut
 
NUS Hackers Project Intern 2016
NUS Hackers Project Intern 2016NUS Hackers Project Intern 2016
NUS Hackers Project Intern 2016Vishnu Prem
 
AgileDC15 I'm Using Chef So I'm DevOps Right?
AgileDC15 I'm Using Chef So I'm DevOps Right?AgileDC15 I'm Using Chef So I'm DevOps Right?
AgileDC15 I'm Using Chef So I'm DevOps Right?Rob Brown
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersSPC Adriatics
 
Making Your Product Manager Productive by Clinton Wolfe
Making Your Product Manager Productive by Clinton WolfeMaking Your Product Manager Productive by Clinton Wolfe
Making Your Product Manager Productive by Clinton WolfeDevOpsDays Baltimore
 
Making Your Product Manager Productive by Clinton Wolfe
Making Your Product Manager Productive by Clinton Wolfe Making Your Product Manager Productive by Clinton Wolfe
Making Your Product Manager Productive by Clinton Wolfe DevOpsDays Baltimore
 
The Importance of Culture: Building and Sustaining Effective Engineering Org...
The Importance of Culture:  Building and Sustaining Effective Engineering Org...The Importance of Culture:  Building and Sustaining Effective Engineering Org...
The Importance of Culture: Building and Sustaining Effective Engineering Org...Randy Shoup
 
Senti is looking for interns!
Senti is looking for interns!Senti is looking for interns!
Senti is looking for interns!Senti
 
Lean-Agile SharePoint Development
Lean-Agile SharePoint DevelopmentLean-Agile SharePoint Development
Lean-Agile SharePoint DevelopmentBill Ayers
 
You cant be agile if your code sucks
You cant be agile if your code sucksYou cant be agile if your code sucks
You cant be agile if your code sucksPeter Gfader
 
10 Big Ideas from Industry
10 Big Ideas from Industry10 Big Ideas from Industry
10 Big Ideas from IndustryGarth Gilmour
 

Similar to The bigrewrite (20)

How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....
 
What IS SharePoint Development?
What IS SharePoint Development?What IS SharePoint Development?
What IS SharePoint Development?
 
How pair programming can strengthen teams
How pair programming can strengthen teamsHow pair programming can strengthen teams
How pair programming can strengthen teams
 
CTO Crunch avec Julien Simon, Viadeo
CTO Crunch avec Julien Simon, ViadeoCTO Crunch avec Julien Simon, Viadeo
CTO Crunch avec Julien Simon, Viadeo
 
Life in the tech trenches (2015)
Life in the tech trenches (2015)Life in the tech trenches (2015)
Life in the tech trenches (2015)
 
It's XP Stupid (2019)
It's XP Stupid (2019)It's XP Stupid (2019)
It's XP Stupid (2019)
 
Agile - A failure story
Agile - A failure storyAgile - A failure story
Agile - A failure story
 
The Lost Tales of Platform Design (February 2017)
The Lost Tales of Platform Design (February 2017)The Lost Tales of Platform Design (February 2017)
The Lost Tales of Platform Design (February 2017)
 
05 DIGI CREATIVE people&process
05 DIGI CREATIVE people&process05 DIGI CREATIVE people&process
05 DIGI CREATIVE people&process
 
Android Developer Skills, Techniques, and Patterns
Android Developer Skills, Techniques, and PatternsAndroid Developer Skills, Techniques, and Patterns
Android Developer Skills, Techniques, and Patterns
 
NUS Hackers Project Intern 2016
NUS Hackers Project Intern 2016NUS Hackers Project Intern 2016
NUS Hackers Project Intern 2016
 
AgileDC15 I'm Using Chef So I'm DevOps Right?
AgileDC15 I'm Using Chef So I'm DevOps Right?AgileDC15 I'm Using Chef So I'm DevOps Right?
AgileDC15 I'm Using Chef So I'm DevOps Right?
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill Ayers
 
Making Your Product Manager Productive by Clinton Wolfe
Making Your Product Manager Productive by Clinton WolfeMaking Your Product Manager Productive by Clinton Wolfe
Making Your Product Manager Productive by Clinton Wolfe
 
Making Your Product Manager Productive by Clinton Wolfe
Making Your Product Manager Productive by Clinton Wolfe Making Your Product Manager Productive by Clinton Wolfe
Making Your Product Manager Productive by Clinton Wolfe
 
The Importance of Culture: Building and Sustaining Effective Engineering Org...
The Importance of Culture:  Building and Sustaining Effective Engineering Org...The Importance of Culture:  Building and Sustaining Effective Engineering Org...
The Importance of Culture: Building and Sustaining Effective Engineering Org...
 
Senti is looking for interns!
Senti is looking for interns!Senti is looking for interns!
Senti is looking for interns!
 
Lean-Agile SharePoint Development
Lean-Agile SharePoint DevelopmentLean-Agile SharePoint Development
Lean-Agile SharePoint Development
 
You cant be agile if your code sucks
You cant be agile if your code sucksYou cant be agile if your code sucks
You cant be agile if your code sucks
 
10 Big Ideas from Industry
10 Big Ideas from Industry10 Big Ideas from Industry
10 Big Ideas from Industry
 

More from Codecamp Romania

Cezar chitac the edge of experience
Cezar chitac   the edge of experienceCezar chitac   the edge of experience
Cezar chitac the edge of experienceCodecamp Romania
 
Business analysis techniques exercise your 6-pack
Business analysis techniques   exercise your 6-packBusiness analysis techniques   exercise your 6-pack
Business analysis techniques exercise your 6-packCodecamp Romania
 
Bpm company code camp - configuration or coding with pega
Bpm company   code camp - configuration or coding with pegaBpm company   code camp - configuration or coding with pega
Bpm company code camp - configuration or coding with pegaCodecamp Romania
 
Andrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseAndrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseCodecamp Romania
 
2015 dan ardelean develop for windows 10
2015 dan ardelean   develop for windows 10 2015 dan ardelean   develop for windows 10
2015 dan ardelean develop for windows 10 Codecamp Romania
 
The case for continuous delivery
The case for continuous deliveryThe case for continuous delivery
The case for continuous deliveryCodecamp Romania
 
Stefan stolniceanu spritekit, 2 d or not 2d
Stefan stolniceanu   spritekit, 2 d or not 2dStefan stolniceanu   spritekit, 2 d or not 2d
Stefan stolniceanu spritekit, 2 d or not 2dCodecamp Romania
 
Sizing epics tales from an agile kingdom
Sizing epics   tales from an agile kingdomSizing epics   tales from an agile kingdom
Sizing epics tales from an agile kingdomCodecamp Romania
 
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...Codecamp Romania
 
Parallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowParallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowCodecamp Romania
 
Material design screen transitions in android
Material design screen transitions in androidMaterial design screen transitions in android
Material design screen transitions in androidCodecamp Romania
 
Kickstart your own freelancing career
Kickstart your own freelancing careerKickstart your own freelancing career
Kickstart your own freelancing careerCodecamp Romania
 
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu   the soft stuff is the hard stuff. the agile soft skills toolkitIonut grecu   the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkitCodecamp Romania
 
Diana antohi me against myself or how to fail and move forward
Diana antohi   me against myself  or how to fail  and move forwardDiana antohi   me against myself  or how to fail  and move forward
Diana antohi me against myself or how to fail and move forwardCodecamp Romania
 
Codecamp2015 pimp yourpipeline-saade-jens-1.1
Codecamp2015 pimp yourpipeline-saade-jens-1.1Codecamp2015 pimp yourpipeline-saade-jens-1.1
Codecamp2015 pimp yourpipeline-saade-jens-1.1Codecamp Romania
 

More from Codecamp Romania (20)

Cezar chitac the edge of experience
Cezar chitac   the edge of experienceCezar chitac   the edge of experience
Cezar chitac the edge of experience
 
Cloud powered search
Cloud powered searchCloud powered search
Cloud powered search
 
Ccp
CcpCcp
Ccp
 
Business analysis techniques exercise your 6-pack
Business analysis techniques   exercise your 6-packBusiness analysis techniques   exercise your 6-pack
Business analysis techniques exercise your 6-pack
 
Bpm company code camp - configuration or coding with pega
Bpm company   code camp - configuration or coding with pegaBpm company   code camp - configuration or coding with pega
Bpm company code camp - configuration or coding with pega
 
Andrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseAndrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabase
 
Agility and life
Agility and lifeAgility and life
Agility and life
 
2015 dan ardelean develop for windows 10
2015 dan ardelean   develop for windows 10 2015 dan ardelean   develop for windows 10
2015 dan ardelean develop for windows 10
 
The case for continuous delivery
The case for continuous deliveryThe case for continuous delivery
The case for continuous delivery
 
Stefan stolniceanu spritekit, 2 d or not 2d
Stefan stolniceanu   spritekit, 2 d or not 2dStefan stolniceanu   spritekit, 2 d or not 2d
Stefan stolniceanu spritekit, 2 d or not 2d
 
Sizing epics tales from an agile kingdom
Sizing epics   tales from an agile kingdomSizing epics   tales from an agile kingdom
Sizing epics tales from an agile kingdom
 
Scale net apps in aws
Scale net apps in awsScale net apps in aws
Scale net apps in aws
 
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
 
Parallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowParallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflow
 
Material design screen transitions in android
Material design screen transitions in androidMaterial design screen transitions in android
Material design screen transitions in android
 
Kickstart your own freelancing career
Kickstart your own freelancing careerKickstart your own freelancing career
Kickstart your own freelancing career
 
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu   the soft stuff is the hard stuff. the agile soft skills toolkitIonut grecu   the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
 
Ecma6 in the wild
Ecma6 in the wildEcma6 in the wild
Ecma6 in the wild
 
Diana antohi me against myself or how to fail and move forward
Diana antohi   me against myself  or how to fail  and move forwardDiana antohi   me against myself  or how to fail  and move forward
Diana antohi me against myself or how to fail and move forward
 
Codecamp2015 pimp yourpipeline-saade-jens-1.1
Codecamp2015 pimp yourpipeline-saade-jens-1.1Codecamp2015 pimp yourpipeline-saade-jens-1.1
Codecamp2015 pimp yourpipeline-saade-jens-1.1
 

The bigrewrite

  • 1. The Big Rewrite Iulian Dogariu #CodeCampIasi 25 April 2015
  • 2.
  • 3. Big rewrite or not? This is the question
  • 4. A. I can't work with it • Missing source code • Missing protocol documentation, passwords • Missing tooling (e.g. no licence for Visual C++ 5.0) • Legal or regulatory reasons
  • 5. B. It won't work properly • Breaks often in production • Performs poorly • Hard to deploy • No monitoring or logging
  • 6. C. I won't work with it • Brittle code • Big ball of mud • Hidden knowledge • I don't know the language • Unused code
  • 8. "Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by incremental renovation: tinkering, improving, planting flower beds." -- Joel Spolsky - "Things You Should Never Do" http://www.joelonsoftware.com/articles/fog0000000069.html
  • 9.
  • 10.
  • 11. "Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by incremental renovation: tinkering, improving, planting flower beds." -- Joel Spolsky - "Things You Should Never Do" http://www.joelonsoftware.com/articles/fog0000000069.html
  • 12. It's never just the code Sysops Third parties Designers Other teams Marketing Technology salesmen
  • 14.
  • 15. I'll write a 5000 line function today
  • 16.
  • 17.
  • 18.
  • 19. The fearsome Estimator with no skin in the game
  • 20. So now we're aware of • Our inherent biases as developers • The technical ecosystem • The office politics • The uncertainties re time and scope
  • 21.
  • 23. The absolute essentials • Infrastructure automation • Automation test suite through the UI • Business vocabulary
  • 24. At least Try (to work with the legacy code)
  • 26. Steps to introduce tests in legacy code • Find where to make the changes • Find what to test • Break dependencies (without refactoring) • Write tests • Make changes and refactor
  • 27. That didn't work You still want to rewrite :-)
  • 29. Swallow small bits • Carve an integration point (service, DB) • Rewrite only the parts that touch it • Don't try to rewrite the whole monolith at once
  • 30. Rewrite by feature, not by module • Play to the strengths of your target language and framework • Don't replicate past implementation
  • 31.
  • 32.
  • 33.
  • 34. Take your time • Insist on quality • Train the team. Build good habits • Absorb the culture of your new language/framework • Be aware of cultural dissonances
  • 35. If you're a startup
  • 36. Q & A
  • 37. Thank you! Get in touch: hello <at> iuliandogariu <dot> com @yu_li_yan Please help our nice hosts #Codecampiasi, give them feedback

Editor's Notes

  1. Thank you for choosing this talk You must either be an engineer, or a manager Please sit next to each other. If you're neither , ... wow! I am flattered. You've been thinking about rewriting a big software system, for good reasons. Or if you're a manager, your team has proposed a rewrite. Or you've asked for one :)  Should you do it? And if yes, how?
  2. I must admit the title was clickbait. I will not tell you how to rewrite PHP in Scala or Angular. Instead I'll spend the first 1/3 playing the role of Satan, questioning your faith. in the process maybe also offend you a little. But hey, you come to conferences not to hear only ideas that you already agree with. The second 1/3 giving you some hints And the final 1/3 answering questions and sharing anecdotes. I am Iulian, been doing software for 15 years. Including about three rewrite projects In the last one I was an architect on the consultant side. I'm an engineer so beware of my bias :) What are the most often-quoted reasons? I'm dividing them into three categories.
  3. as in I wish I could but I can't Valid reasons, but it's safe to say you're not in one of these cases.
  4. This is not a reason to rewrite.   You must fix it. Optimizing for performance is a 20-80 effort   You change from PHP to Scala, you gain concurrency   but you now hit the database with 10 simultaneous queries instead of one. Whaddaya think this will do to your perf? Performance at the database Might be due to the Data model
  5. (it's really unpleasant): - Brittleness. Frustratingly slow to make changes - "Big ball of mud" (no architecture, high coupling) - Hidden knowledge (tacit, non-explicit). I don't understand the code. - It's in a language I don't know (PHP), or It's hard to hire developers - Unused code, or code for handling legacy data (e.g. nulls) - No source control history (incl things like branches) It MAY be a reason to rewrite, But by the end of this talk I hope I'll have convinced you to think VERY HARD whether to throw your code away and start fresh.
  6. Code is an asset, it's what makes a business tick, make money, pay our invoices, etc. BUT code is not where the value is. Only code that is running is of value to anyone. It is a unique kind of asset It takes time to grow, it needs care and feeding just like a kid I'm not a parent but was a kid some time ago. I was sticking my fingers everywhere What if my parents said "aa, fuck it, let's throw him away and start from scratch"
  7. http://i.dailymail.co.uk/i/pix/2012/12/03/article-2241365-164BBAB5000005DC-480_964x643.jpg
  8. http://upload.wikimedia.org/wikipedia/commons/6/60/Dubai_skyline_2010.jpg
  9. sysops will have to learn to deploy, monitor and diagnose an entirely new app. Do you think they will love you?? You store data, the DB may still be legacy. Designers Other developers Misbehaving browsers integrations with third parties Marketing people and technical writers will have to adjust their works - a button that was there suddenly isn't . And salesmen pushing their technologies. There is always sales. You are not immune to it. Hadoop, no Cassandra, no MongoDB. Microservices, No, ESB. Scala, no, NodeJs, no, Erlang. YOu think NodeJs doesn't have a company pushing it? That's OK, but you need to be aware of who is influencing your decision. Think of the other players in your ecosystem https://newcodepoet.files.wordpress.com/2013/01/sourcecode.jpg
  10. Are you sure everyone wants a rewrite? Are you sure all wnat to learn the new technologies? http://www.blogging4jobs.com/wp-content/uploads/2012/10/office-politics.jpg
  11. whose job is at risk if the project succeeds (!)
  12. There's a thing worth repeating, about legacy code: Nobody wakes up in the morning thinking “I’ma gonna write myself some legacy code today" Nimeni nu vine la serv cu gandul "azi o sa scriu o functie de 5000 de randuri" Code got this way because of a lot of pressure, and because we didn't know any better. http://img3.wikia.nocookie.net/__cb20130620100935/starwars/images/d/d8/Emperor_Sidious.png
  13. How did the code get to a legacy state? Step by step! Nobody did it intentionally to give you a hard time They responded to pressure, limited staffing Have a little empathy for in 5 years when AngularJs becomes tomorrow's PHP, some dev who is a kid today will say bad things about your app that you're building right now "You're just going to make most of the old mistakes again, and introduce some new problems that weren't in the original version." -- Joel http://imgur.com/gallery/4Sas579
  14. Careful about estimation. It is very tricky to estimate based on lines of code. Remember you're not rewriting code, you're reproducing behaviour. https://d3bg2441si4wp3.cloudfront.net/prod/wp-content/uploads/blogs.dir/3/files/2014/05/Erich-Marx.jpg
  15. The reductionist (deconstructionist) approach: decomposing the legacy system into parts and estimating each. To show you how ridiculous such an approach is, here's a challenge Can you estimate when we will have artificial humans? i.e. androids We have plastic surgery, artificial limbs, artificial intelligence, computer vision http://hivewallpaper.com/wallpaper/2014/11/androids-7-cool-wallpaper.jpg
  16. OH: “That’s easy! I can do that in a couple of hours.” dangerous especially if it's not him who's gonna do it. Beware the "Estimator" with no skin in the game. - Any time we work with a new code base our speed will be slower - need to account for that when planning/estimating.
  17. http://blog.fcfinancial.com.au/Portals/221457/images/start_your_journey.jpg
  18. This is basic hygiene in development. No excuses. You'll need these anyway, whether you rewrite or not. https://www.relfe.com/wp/wp-content/uploads/2014/04/germs-wash-hands-with-soap.jpg
  19. Infrastructure automation: Get good at it Or else you'll be forever stuck in development limbo (or development hell) Automation test suite through the UI: What if you introduce regressions? Business vocabulary: A group of related users was either a Group, or an Account
  20. It's a four letter word Of course, Test. To change code, we need tests. To introduce tests, we must change code.
  21. http://www.officiallyamazing.tv/getattachment/6774dca0-c961-427b-9bc0-16bf9f3390fb/Most-Tennis-Balls-held-in-Mouth-(Dog).aspx
  22. - Carve an integration point. Absolutely never start rewriting the entire monolith
  23. Of course your BA / Product Owners should support you
  24. 1. Shorter! But not only that 2. Better coupling
  25. When Should you rewrite? As a startup. When you want to change your product significantly. I want to augment a statement that I made earlier. I said Code is not the main asset. A running system making money is the main asset. If you're a startup, learning is your main asset. You use the previous rewrite as an investment in _learning_.
  26. Using a language with static types. So much easier to do automatic refactorings. Code review Regular meetings with domain expert Rewriting a small piece of functionality Rewriting from the outside in Not rewriting everything! Negotiating limitations with product owners. Domain knowledge hasn't changed that much. It needed better formalism, that's it. We still had a domain expert Toggles. Old feature. new feature. Things that didn't: Wrong boundaries Wrong reasons to rewrite Long time to victory. Getting a full CI pipeline straight to production took months. PHP dynamic language, hard to do automated refactorings