4 ms·
My only problem is the seven lines of test cases at the bottom. I'm not against testing, but I find many people using testing that excessively, start using it
by qixxiq 16y ago
My only problem is the seven lines of test cases at the bottom.
I'm not against testing, but I find many people using testing that excessively, start using it as an excuse not to bother thinking about if their solutions are correct or not.
- philwelch 16y agoIf you're writing seven lines of test cases and just running your solution through the interpreter/compiler without thinking, sure. If you're writing seven lines of test cases and glancing back over to them as you write the solution it's a tool to help you think about whether your solutions are correct or not. In an interview/whiteboard environment you're going to be closer to the latter, if only because you're not going to have an interpreter at hand.