3 ms·
To go further: define an API, write tests against that API, and then do a pass of dead-code analysis on the resulting library-plus-test-suite. Any private funct
by derefr 11y ago
To go further: define an API, write tests against that API, and then do a pass of dead-code analysis on the resulting library-plus-test-suite. Any private functions left uncalled by your public API can just be removed!
- Drakim 11y agoLet's just hope that function doesn't end up being the one that's invoked to adjust for leap years.
- lsaferite 11y agoFunny, but good point. To counter that I'd say you should have a test case to cover the leap year handling is working as expected. If you aren't testing that since it wasn't in the spec, than why would you have the code at all?