This article has participated in the third “topic writing” track of the Denver Creators Training Camp. For details, check out: Digg Project | Creators Training Camp third is ongoing, “write” to make a personal impact.
code
The so-called code is artificially defined from the computer to identify the set of new language, through a method to achieve each point of demand, this form of expression is called code, we often say there are code blocks, and statements
Actually write code. It is a process of self-cultivation, from the point of view of introspection, to the outside world for thinking, logic, judgment, sorting. Risk aversion. As well as the final output, actually each of us as code. Or r&d engineer. This behavior or name is more apt. We are all code makers. They’re kind of their creators, the builders of a lot of integrated feature products. For example, jingdong’s home page is jointly maintained by more than 500 R&D engineers. Everybody and everybody. The code style is different. It is as if each person’s personality is also different. It is because of the hierarchical code style. It also created a lot of characteristics of the code industry.
We usually do. The people who write the code. Call it a programmer. Because of the code. It’s the program. Obviously this is not equal.
We’re actually talking about comparisons. Distress. For high quality code, we need to consider the points. Much more special. Readability is the most important thing. The second is maintainability. Scalability. And other features
How to write readable code:
To explore this question. We need to get back to the basics. First, look to judge. Standards that are common to all. Legibility means that the practitioner can see at a glance the logic tree, the logic points in the standard parameters of the method, exception handling, parameter verification, and logic handling, among which legibility is required. The logic must be clear. We have to show others;
Let’s start with the simplest interface.
Interfaces are a common standard for implementing functionality. By customizing requirements, parameters are determined. It’s going through a logical transformation. And parameter verification. Handle the input arguments logically. This returns the result the user wants to render. We backend engineers present the data to the front end. The front end engineer is responsible for presenting a better page for the user to see.
Because we deal with code every day. Who said code? You can. Better save time to get the logic you want. You’re essentially writing code to write logic. The process of resolving a transaction, often called logic. We are divided into part ONE, part two, and so on. Take the data and turn it into the results we need
Characteristics of readable code:
First step. There are necessary comments.
Many people overlook the importance of comments. Because we are not saints. Logical processing at this point. For the other guy in the back. It takes a lot of effort to accept your current functionality. To revisit the need. If you have notes. It must be more efficient with less effort and a lot less effort and people will understand your logic better.
Step 2: Logical tree:
Writing code. The essence is to solve things. Address requirements. When you need to get something done. The cause and effect of this event are for you to consider. To make sure you can. Profit maximization. This sort of thing. You have to think of multiple scenarios. Go to exception handling. Active data is filtered. Make sure you get the data. It’s infallible. Necessary sketches. It will make your logic clearer. Facilitate payment after completion.
Step 3: Segmentation:
I’m not talking about segmentation here. Cut the pump code, complete the functional points of the atmosphere. For example, the common add operation is the write operation. It is generally divided into obtaining front-end information.
-
Verify processing information.
-
Process logical information.
-
Write library operation.
These are three of them. At every step. Add comments. Refine the function points. Logical processing of points. Proceed to the point. Exception handling mechanism. That’s pretty good.
Step 4: Recheck
I think the difference between the average coder and the senior engineer is that the last step is code. The overall structure of the disk logic complex it. analyse
We generally adhere to the principle. Is first perfect after perfect, first to complete the whole. Requirements approach. Then you optimize the code. Architecture and logic optimization.
Don’t underestimate this step. Most of the problems are in Review. Code in the process. Can find out in time to avoid risks