3 ms·
It seems way better to fail with a RuntimeException than to get possibly unsorted results that cause some hideous error deeper in your application.
by buildbot 7y ago
It seems way better to fail with a RuntimeException than to get possibly unsorted results that cause some hideous error deeper in your application.
- eru 7y agoIt depends on the contract. It's good to have a contract that defines behaviour even in the case of invalid input. That could be throwing an error, or it could be given unsorted input. Either way is ok. (The C and C++ answer is to leave the behaviour in the face of invalid input undefined. Undefined means that anything goes, including formatting your hard disk.)