4 ms·
How do I ensure that a maintenance coder ten years from now doesn't replace the entire function with printf("butt\n"); ? Yes, sometimes developers make m
by theseoafs 12y ago
How do I ensure that a maintenance coder ten years from now doesn't replace the entire function with
printf("butt\n");
? Yes, sometimes developers make mistakes, but -- again -- this is what the tests are for. And I have seen no evidence that immutable data structures are more prone to errors in "maintenance coding" than mutable data structures.
- taeric 12y agoIs there solid empirical evidence that it is less prone?
- theseoafs 12y agoNo, but no one ever said there was.
- tjradcliffe 12y agoThis is a completely disingenuous argument. My point is that a sincerely interested maintenance coder could easily accidentally use the wrong variable. This was the GP's point as well. This is not something that is not at all difficult to understand... for anyone who has ever actually worked on shipping code.
- theseoafs 12y agoAt no point did I ever indicate that it is impossible for a maintenance coder to accidentally use the wrong variable. In fact, it'll probably happen at some point. I did indicate that you should have tests in place to catch regressions like this. This is true when you're working with mutable data structures as well as immutable ones. I also indicated this type of error, once detected, is typically very easy to spot and correct. I don't know how anything I've said has even been slightly controversial.