What should be the rules to write excellent code?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
30 replies · 4K views
Document, document, document.
Read through the requirement
Identify testable statements
Use a design methodology relevant to the task/project
Use a recognised standard for documentation and design toolset
Identify methods/objects at the design stage
Use a programming language relevant to the task.
Wherever possible reuse known working classes if OOD/OOP
or working modules if procedural design.
Ensure the smallest components are easily testable, build up a library of components that could be reused later
Test each class/procedure from the bottom up, increasing complexity as you go, ensuring that the system requirements continue to be met
Test
Test
Test
The aim of the exercise is to obtain a software system that is fit for purpose and does what is required.
 
  • Like
Likes   Reactions: Svein