3 ms·
Is the efficiency gained enough to outweigh having that "stain" in the code? Obviously, the answer to this question will depend on a whole bunch of different f
by doesnt_know 13y ago
Is the efficiency gained enough to outweigh having that "stain" in the code?
Obviously, the answer to this question will depend on a whole bunch of different factors. If given the choice, I would personally choose code readability and simplicity over efficiency.
- adwn 13y agoWould you also choose readability and simplicity over correctness? Sometimes efficiency is a requirement.
- doesnt_know 13y ago>Would you also choose readability and simplicity over correctness? Depends what you mean by "correctness" and how you determine it. In a perfect world the correct way to do something is the same thing as doing it in the most readable and simple way possible. If you are asking if I think you should give up readability and simplicity if the appropriate standard requires it, then yes. You should probably implement and follow the standard even if the standard is shit (looking at you DOM). > Sometimes efficiency is a requirement. Absolutely, which is why I prefaced my opinion with: >"Obviously, the answer to this question will depend on a whole bunch of different factors." If you are writing performance critical code, then simplicity and readability will sometimes (probably) have to take a back seat.
- danieltillett 13y agoWell the 'stain' is pretty small in the great scheme of things - in my projects the commented out simple code is less than 1%. It really depends on the project, but sometimes efficiency is important and when it is having a guide to what the code is trying to achieve in a clear and simple form is really helpful.