- Brief Summary Brief Summary
- About the quality of the source code About the quality of the source code
- Programming is code reading Programming is code reading
- What happens if the source code was low quality What happens if the source code was low quality
- Tips 1: Scope Tips 1: Scope
- Tips 2: Naming Tips 2: Naming
This article introduces the quality of source code for development productivity.
Brief Summary
- Make an effort to continue writing code that scales with development efficiency.
About the quality of the source code
Keeping the quality of your source code at the right level will help keep your team productive.
The key to this is to maintain quality by doing code reviews among engineers.
By maintaining the quality of your code, you'll be able to deliver valuable features to your users in a limited amount of time.
Programming is code reading
It's said that programming is 80% code reading. For new engineers, the ease of understanding of code is very important.
Always try to design and implement it, thinking that it will be easy for a new engineer to understand.
What happens if the source code was low quality
- When you fix the code, you don't know the extent of the impact, and you create a bug.
- If you don't understand the code, it will take too long to understand the specification from the code
Tips 1: Scope
The scope of variable and function, etc are one of the most important for programming.
It is necessary not to expand the scope unnecessarily in order to reduce the scope of influence.
In addition to the published scope of variables and functions, modifier operators such as export and directory structure are also important elements that represent the scope.
Always try to keep your implementation as minimal in scope as possible.
Tips 2: Naming
- Think of the module name, class name, and variable name as short comments to other engineers, and choose a name.
- Choose words in your name that clearly convey the meaning so that you can accurately communicate your intentions to other engineers.
- Name the entity so that its purpose and value are clear.
- The name of a variable should have a unit of value, a limit, or information that calls for a hazard or caution.
- Be aware of the scope of your variables, and give long names to large variables in your scope.
- Use linter to ensure that you maintain a format that adheres to the conventions of your project and language.