mskeel
Well-known member
When writing code, what are your priorities? What about when you refactor? What kind of optimizations do you do and how far do you take it? What trade-offs are acceptable and where do you draw the line?
Post your opinions and specific examples of what you consider to be your "best practices" when writing a program. Any level of detail is acceptable. A low level concept might be pointer arithmetic or loop unrolling while a high level idea might be algorithmic (binary sort versus quick sort) or data-structure driven.
Ill kick it off. My priorities when writing code, generally speaking, are:
1. Testability/Reliability -- How easy is it to automatically test my application? Does it work correctly every time?
2. Maintainability -- How easy it to read/understand my code?
3. Performance -- How fast does it run?
4. Memory Usage -- this is hardly a concern these days, but can be occasionally
5. Disk Space -- At less than $1/gig these days this is almost silly to worry about.
Generally, If I can improve something lower on the list without sacrificing something higher, I will. So If I can improve performance without sacrificing maintainability, I will choose the faster implementation.
Post your opinions and specific examples of what you consider to be your "best practices" when writing a program. Any level of detail is acceptable. A low level concept might be pointer arithmetic or loop unrolling while a high level idea might be algorithmic (binary sort versus quick sort) or data-structure driven.
Ill kick it off. My priorities when writing code, generally speaking, are:
1. Testability/Reliability -- How easy is it to automatically test my application? Does it work correctly every time?
2. Maintainability -- How easy it to read/understand my code?
3. Performance -- How fast does it run?
4. Memory Usage -- this is hardly a concern these days, but can be occasionally
5. Disk Space -- At less than $1/gig these days this is almost silly to worry about.
Generally, If I can improve something lower on the list without sacrificing something higher, I will. So If I can improve performance without sacrificing maintainability, I will choose the faster implementation.