News for hackers. Stuff that matters.
Re:Ask HN: How do you deal with legacy code? by croo on Monday July 16, 2018 @04:16AM (#17539583)
Then this book may be written exaclty for you.

One of the most memorable part is that the author defines legacy code as "code without tests".

And you can handle it by the following:

0. poke around in the code till you find a part you think you can test something in isolation. If you need some _trivial_ changes to reach that, thats okay. 1. create some kind of test that will catch you if you break something 2. refactor and understand

The book is about offering several tactics for dealing with points 0. and 1. and is very digestible, good read.

There are no comments on this comment yet.