Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

What is the actual life expectancy of your code?

As developers, our toolset for maintaining and improving our code spans from automated testing to build servers, refactoring tools, automated deployments etc. All these support systems are meant to improve the life expectancy of your code. At the same time, new programming languages and frameworks are being launched every month and choosing the wrong one might have fatal consequences for your codebase. So let's ask ourselves: Is the life expectancy of our code actually improving? Or is this just something we like to tell ourselves to sleep better at night? And when is it appropriate to call time of death on our code?

  • Be the first to comment

What is the actual life expectancy of your code?

  1. 1. Karoline Klever @karolikl
  2. 2. 𝐿 𝐼𝑄 𝐷𝑒𝑣 − 𝐼𝑄 𝑃𝑀 % 𝐴𝑣𝑔 𝐶 + 𝑌𝐸 𝐿 𝐴 where L = Number of lines of code 𝐴𝑣𝑔 𝐶 = Average number of coffee cups per day 𝑌𝐸 = Years of programming experience 𝐿 𝐴 = Number of layers of abstraction
  3. 3. Lines of code: 5,000,000 IQ of developer: 115 IQ of project manager: 110 Average number of coffee cups per day: 3 Years of programming experience: 16 Number of layers of abstraction: 3 Life expectancy: 6,33 years
  4. 4. (And it’s our fault)
  5. 5.  9 questions  291 respondents
  6. 6. True 62.1 % False 6.2 % I don't know 11.4 % I didn't write code 10 years ago 20.3 %
  7. 7. True 62.7 % False 35.9 % I'm not currently writing any code 1.4 %
  8. 8. 68.90% 53.20% 28.9 % 46.8 % 2.2 % 0.0 % 0% 10% 20% 30% 40% 50% 60% 70% 80% Devs with 10 years old code in production Devs without 10 year old code in production True False I'm not currently writing any code
  9. 9. 0 10 20 30 40 50 60 70 80 90 1751 1757 1763 1769 1775 1781 1787 1793 1799 1805 1811 1817 1823 1829 1835 1841 1847 1853 1859 1865 1871 1877 1883 1889 1895 1901 1907 1913 1919 1925 1931 1937 1943 1949 1955 1961 1967 1973 1979 1985 1991 1997 2003 2009
  10. 10.  Version Control  Testing  Build servers  Refactoring  Deployment  Documentation generators  Performance  Monitoring  And the list goes on and on...
  11. 11. True 85.5 % False 14.5 %
  12. 12. We are...
  13. 13. True 69.7 % False 30.3 %
  14. 14. True 64.5 % False 35.5 %
  15. 15. True 60.7 % False 39.3 %
  16. 16. ...is what separates a great developer from an average one
  17. 17. - @bergdaniel
  18. 18. True 35.5 % False 64.5 %
  19. 19. Unreadable code The code is not clear enough to be read or interpreted «Unreadable» code The reader does not possess the required knowlegde to read the code.
  20. 20. Unreachable? When code is... Dead? Deprecated? Legacy?
  21. 21. Unreachable? Call it! When code is... Dead? Deprecated? Legacy?
  22. 22. Unreachable? Call it! When code is... Dead? Call it! Deprecated? Legacy?
  23. 23. Unreachable? Call it! When code is... Dead? Call it! Deprecated? Call it when appropriate. Legacy?
  24. 24. Unreachable? Call it! When code is... Dead? Call it! Deprecated? Call it when appropriate. Legacy? Depends on your definition.
  25. 25. - Michael C. Feathers
  26. 26. 13 57 102 115 180 77 63 0 20 40 60 80 100 120 140 160 180 200 It's legacy if someone other than I wrote it It's legacy as soon as it's in production It's legacy if everyone who wrote it are no longer on the project It's legacy if it lacks unit tests It's legacy if it's written in an old language, or uses old libraries and frameworks All code is legacy after X number of years Other
  27. 27. - Anonymous respondent
  28. 28. - Anonymous respondent
  29. 29. - Anonymous respondent
  30. 30. - Anonymous respondent
  31. 31. How I would define it
  32. 32. Unreachable? Call it! When code is... Dead? Call it! Deprecated? Call it when appropriate. Legacy? Depends on your definition.
  33. 33. It’s legacy if it lacks unit tests Advised that a piece of code should be rewritten simply because rewriting it would be easier than having to figure out how the original code worked. 62%
  34. 34. It’s legacy if it lacks unit tests It’s legacy as soon as it's in production Advised that a piece of code should be rewritten simply because rewriting it would be easier than having to figure out how the original code worked. 62% 73%
  35. 35. It’s legacy if it lacks unit tests It’s legacy as soon as it's in production It’s legacy if someone other than I wrote it Advised that a piece of code should be rewritten simply because rewriting it would be easier than having to figure out how the original code worked. 62% 73% 92%
  36. 36.  Support systems and technology increase life expectancy  Most of us are quick to rewrite rather than fix code, which decreases life expectancy  We view code as our playground, introducing risk, which decreases life expectancy
  37. 37. So how do we change this?
  38. 38. Clean Modular Maintainable
  39. 39. Karoline Klever @karolikl karolikl@gmail.com

×