Aspiration and Advisory

View Original

Writing A Code For The Beginner

There is an interesting practice in writing good code — do it in such a way so any beginner developer can support the code. It is a common scenario in many companies, making sense to think ahead and prepare for it from the very beginning. Let us see what traits (positive and negative) such an approach has, and how to utilize it in real life.

Pros and Cons

The main point of writing such a code is to be ready for beginner (or low-level) developers to support and develop the project. This beginner-oriented approach has pros and cons.

Let's start with the pros. The project has to have clear and relatively simple architecture and structure. The code should be easily readable, split into small classes or packages, and have enough extension points. There should be a lot of tests to guarantee that introduced changes will not break the application. The project has to have good documentation, so every developer can understand how the project is working and how to modify it. Finally, if everything is done correctly, then the project manager can save costs by hiring cheaper developers.

There are just a few cons here, but they are essential. The biggest concern is the additional time required to make code easy to support. The second factor is the developers' high qualifications needed to build such a project and related costs.

The Paradox

We are observing quite an interesting paradox here. From one point of view, the project can be developed by low qualification developers, but from another one, it requires high qualification developers. The explanation is straightforward — high qualification developers have to build the foundation (core); low qualification developers have to use the foundation to customize it.

The beginner-oriented approach can be commonly found in framework development. A team of experienced and qualified developers builds a framework with good architecture, tests, and documentation. Then community members with variable qualification use the framework and provide feedback for framework developers to improve it further.

When to Use

The beginner-oriented approach has the best application in companies with relatively big projects and stable processes. This way, it is easy to organize beginners and experienced developers, split tasks between them based on the complexity, and make sure they are doing the necessary work and writing good code.

Refactoring is another process that can benefit from this approach. Properly written code is easy to understand and covered with tests. An experienced developer may plan the refactoring, and a team of beginners can do actual coding.

This approach is beneficial to work on components that changed often and a lot. Again, the fact that code is simple, readable, covered with tests, and has documentation simplifies the task, and in many cases, even low-level developers can do it. The crucial requirement here is to maintain the approach — i.e., all changes have to follow the same principles.

However, this approach does not make sense in companies where quantity is more important than quality. These can be some startup factories, science-related prototypes, or just training exercises.

Summarizing, we have seen that the beginner-oriented approach is useful both from technical and financial points of view. Developers with different qualification and experience can use it on many types of projects. The crucial point is to understand how and why it works. This way, you can be sure that it will benefit you both in a short and long-term perspective.