5 ms·
Do you test the result, or just hope if it runs, it actually worked?
by fwenzel 14y ago
Do you test the result, or just hope if it runs, it actually worked?
- jstanley 14y agoI found one that returned the wrong result, so it seems to just assume it works as long as it runs.
- gkoberger 14y agoIt doesn't test for two reasons: 1) I thought it would defeat the purpose 2) "Sort" is very arbitrary. Do you want to sort by key or value? Is "1000" bigger or smaller than "2"? etc
- fwenzel 14y agoFair; also, it's called an 'ineffective' sort, and if you tested it, it'd become effective (not efficient, of course). So, good point!
- simcop2387 14y agoYou could probably test it by taking multiple sorts from SO and then comparing results. the moment you get two that agree, you have a winner!