Skip to main content
6 events
when toggle format what by license comment
Mar 20, 2019 at 23:02 vote accept DreamVision2017
Mar 19, 2019 at 21:46 comment added morbusg -1 from that?! Gosh this place is hostile. +1 from me for that very same statement; the whole "computation time over developer time" was a thing of the 80s to my understanding, but these days we don't reuse variables for different things, nor use GOTO's, etc.
Mar 19, 2019 at 14:07 history edited RoToRa CC BY-SA 4.0
added 70 characters in body
Mar 19, 2019 at 14:05 comment added RoToRa I didn't phrase that well. Code doesn't need to be most efficient. One should prefer readable code over perfectly optimized code. I'm speaking of cases where inefficient, but readable code takes 1.1 seconds instead of 1 second to run. If it were not for the bugs, the original idea of sorting the complete array would be IMHO an acceptable solution. It may not the most efficient solution, but in 99% of all use cases a more efficient solution would be overkill. However the OP did imply that this would be a more efficient solution than to "just" look for the top 2 lowest values, which it isn't.
Mar 19, 2019 at 11:26 comment added Blindman67 I disagree with your opening statement. Good code MUST FIRST be efficient. Ask the end users, the many who pay for the code to be written, which is better, code that takes 10seconds or code that takes 1second to run. -1
Mar 19, 2019 at 8:59 history answered RoToRa CC BY-SA 4.0