PDE - Efficiency Considerations (Lesson)
Efficiency Considerations
Code Efficiency - Is it Only about the Code?
Not really. The area really spans multiple different areas of understanding. Let's use 3 parts to effective computer science: programming efficiency, pure code efficiency, and storage efficiency. All of this is about methodology, reliability, and processing speed.
Programming Efficiency
What method or methods are you using to use programmer time and code time effectively?
- understanding what is needed
- creating a design of what is to be coded
- executing the plan
- revising as needed
- reliable end product
- overall runtime efficiency as well as memory use when complete
Code Efficiency- actual code lines
- algorithmic efficiency - runs quickly and effectively
- reduce redundancy of code, thus using reusable parts (methods)
- consider debug process for error handling
- variables with a purpose with appropriate data types and clear names
- consistent, quality naming conventions
- use accepted coding practices for the environment the code is to be operated in
- methods with one purpose
- readability -- (less lines is not necessarily better)
- documentation - comments
Storage Efficiency
- data stored for quick access
- effective updating of data
- data not destroyed - writing over data that should be preserved
Companies have their standards and methods of doing things. Part is in being in compliance with the methodologies that the business will use. The environment you are working in has a big effect.
Another part is knowing that for coding redundancy is not a feature and reusability is, in addition to clear code and comment documentation.