4 ms·
I don't know who to give credit for this concept, but I'm a fan of "tombstoning" functions that are being removed. You basically replace (or prepend) the body o
by slap_shot 9y ago
I don't know who to give credit for this concept, but I'm a fan of "tombstoning" functions that are being removed. You basically replace (or prepend) the body of the function with a call to a method that logs the timestamp, calling function, etc.
Here's an example in PHP from a quick google:
https://github.com/scheb/tombstone https://github.com/scheb/tombstone
I once had to lead a large refactor of a project written in an foreign dynamically typed language and tombstoning was a necessity for how large and poorly designed the projet was.
- dpcx 9y agoI've used tombstoning as well. The biggest problem is that you have to let it run long enough to determine if anyone is actually using that method - and with sections of an application that are not oft-used, you could be waiting a very long time to find out.
- dhimes 9y agoWouldn't a test suite help with that?
- falcolas 9y agoWell, that depends. If you have 100% coverage, you don't have dead code. But just because code is tested doesn't mean that it's actually in use outside of the test suite. There's lots of ways that code could become dead, even if it's still accessible via a test suite.
- dhimes 9y agoRight. But it seems it might help with the tombstoning if the tests hit the calls (rather than waiting until it happens by serendipity).
- Can_Not 9y agoIf the original developers wrote one, it might help.
- ro_sharp 9y agoAnother bloody good argument against using such languages for large projects.