3 ms·
Sometimes the code is perfectly easy to understand, but the reasons for the code may still be a complete mystery. e.g. This is the kind of thing I find myself
by ilitirit 8y ago
Sometimes the code is perfectly easy to understand, but the reasons for the code may still be a complete mystery.
e.g. This is the kind of thing I find myself wondering very often while browsing our company's codebase:
"Why are we only appending the jurisdiction on this partner and not the others? Is this intentional or an oversight? Maybe the unit tests will tell me more..."
- acutesoftware 8y agoI think unit testing is underrated in this area - no documentation can be better than some additional unit tests that show exactly how to use the code in the real world. Even if it blends over a little into integration testing, the additional test work (and time to run tests) really pays off in terms of understanding and reusing an old project.
- ec109685 8y agoI think it would be better in this case to add a flag to the vendor that indicates it needs the jurisdiction added and the flag should be named for the reason. Besides being cleaner, when you add the next vendor, you won’t be searching all over the codebase for if(vendor)’s to add new special cases.