Earlier quoted context omitted.
+1 It’s on my list of books that every developer should read.
What's the rest of that list?
Ask HN: Good resources about legacy code?
31–40 of 41 posts
Re: Ask HN: Good resources about legacy code?
#32Re: Ask HN: Good resources about legacy code?
#33IMHO it's to be expected that you won't get where you want to be, you'll fill some of the gaps but not all of them.
The key issue is to identify what is the major pain point that prevents you from doing this. For example, in a particular similar situation for me the key points were (a) ability to reliably build a deployment package that's sure to work; (b) brief documentation about the functionality of the main components of the software and their interaction/interfaces; (c) creating a basic suite of tests to ensure that key functionality keeps working as intended if we change/rewrite certain parts fo the codebase.
The pain points will be different for you, but that's the direction that needs to be identified and taken to proceed properly.
Re: Ask HN: Good resources about legacy code?
#34Earlier quoted context omitted.
Agreed. Adding type annotations is already a huge refactor in itself though and pretty risky with PHP. Once you have that done life will be much easier.
For those unfamiliar with php, or its type annotations, why is adding type annotations a risky step? Do they become enforcing? function foo(string $bar) { ... } foo(1234) // kaboom?
To get the true benefits of typing you should also run a static type analyzer.
Re: Ask HN: Good resources about legacy code?
#35Re: Ask HN: Good resources about legacy code?
#36I sencond Working With Legacy Code. A lot of advice comes down to writing tests so you don’t break existing functionality. You should write a lot of tests, particularly high level stuff that tests the entire system because with tightly coupled systems you’ll modify part A but part Q will break. Integration level tests help find this stuff out. You have two problems on your hand. One is understanding what the code is…
Re: Ask HN: Good resources about legacy code?
#37Earlier quoted context omitted.
For those unfamiliar with php, or its type annotations, why is adding type annotations a risky step? Do they become enforcing? function foo(string $bar) { ... } foo(1234) // kaboom?
Wait? You mean you get runtime errors? That's well...good in a way but as you say dangerous on old code. To get the true benefits of typing you should also run a static type analyzer.
Re: Ask HN: Good resources about legacy code?
#38Re: Ask HN: Good resources about legacy code?
#39How did you get this job with no experience? How did you estimate the price and time to completion? Congrats and good luck
Re: Ask HN: Good resources about legacy code?
#40I sencond Working With Legacy Code. A lot of advice comes down to writing tests so you don’t break existing functionality. You should write a lot of tests, particularly high level stuff that tests the entire system because with tightly coupled systems you’ll modify part A but part Q will break. Integration level tests help find this stuff out. You have two problems on your hand. One is understanding what the code is…
Can you share a python example of replacing boilerplate code with advanced features?