Simple and Repeatable

@ Aaron May 26, 2024

In the process of developing CloseOnion recently, there have been a series of technical route choices, and I realized it's time to talk about the engineering and technical culture of OpenOnion.

·-- 26

How to ensure code quality? How to ensure long-term reliable delivery?

The values of OpenOnion are simplicity and repeatability.

Code should be simple, simplicity means readability and maintainability. Writing code should never be a struggle, we don't fuck up our brain.

Code functionality should be reusable and modular.

Reusability ensures consistency in the whole system. It also minimizes surprises for developers and users. To achieve reusability, naturally, you would choose to make your implementation details depend on abstractions, rather than abstractions depend on details.

Of course, there are many external factors that are important, such as interface isolation, automated testing, continuous integration, and timely refactoring. These all guarantee code simplicity and repeatability. If you want to achieve simplicity and repeatability, you will naturally pay attention to these in the future. Their purpose is to make the code simple and repeatable.

I hope that in future development, we can always consider whether this part of the code is simple enough, whether others can understand it at a glance without relying on explanations or documentation. Avoid excessive use of tricks and syntactic sugar; write in a way that even idiots can understand. Consider whether a function is too long and whether it would be clearer and more explicit if it were broken down into smaller functions. Is the current file or functionality overly coupled? Is it an abstraction that depends on details? Can this part be reused in the future?

Every developer should ask themselves the following questions when writing code:

  • Is the code simple enough? Can others understand it at a glance?
  • Is the code easy to maintain? Will modifying one part affect other parts?
  • Does the code have reusability? Can it be modularized and used elsewhere?
  • 4. Is the code overly coupled? Does it follow the principle of details depending on abstractions?

By continuously asking ourselves these questions, we can ensure that the code remains simple, clear, and maintainable, thus achieving our core values: simplicity and repeatability.

Only by adhering to these principles can we maintain competitiveness and deliver high-quality software products in an ever-changing technological environment.

>