Skip to content

How to write good code

Abstraction and Software Design

  • Abstraction is the process of hiding the implementation details and showing only the functionality to the user.
  • Abstraction is supposed to be hidden complexity.
  • Keep things simple and easy to understand.
  • Keep abstractions simple and easy to understand.

Cognitive Load

  • Cognitive load is how much a developer needs to think in order to complete a task.

Layered Abstraction

  • Layered abstractions do not exceed 3 layers.

Simple habits of the best engineers

  • Code for human(your team, future you, users), not the computer.
  • Communicate often. Great engineers went through design reviews, solicited feedback, and continued iterating on their initial designs for their code. Every one has gaps in their knowledge that can be filled by others. Fresh perspectives can often help code become clearer or provide a new approach that may not have been thought of previously. The best engineers were both communicative and collaborative - not afraid to take the time to work together for the change at a better result.
  • Go slow to go fast. By taking the time to use standards, test properly, use principles, and communicate often, they save more time in the long run.

References

  1. Cognitive load is what matters
  2. 7 simple habits of best engineers

Last updated at: