The ability to abstract determines the ability to program

The programmer's ability to abstract is the ability to abstract the solution of a problem into a computer program with the help of one or more programming languages ​​on the basis of understanding the working principle of the computer. In the previous article " Thinking About Programming Ability ", it was mentioned that programming ability includes theoretical basis and system design ability. Abstract thinking ability is precisely the key to determining programming ability.

 

The essence of a program is the extension of the human will to the recognizable instructions of the computer. Computer thinking is simple and can only recognize 0 1 codes, and cannot solve any problems by itself. Only people can write programs to control computers to solve problems. Therefore, the essence of programming is that people "teach" computers to solve problems.

 

Writing programs is always inseparable from various data structures and algorithms, which contain profound mathematical ideas. To understand a data structure or algorithm is to understand an abstraction of the solution.

 

As the business becomes more and more complex and there are more and more requirements, the program is always torn between expansion and reconstruction. In this process, programmers are required to deeply understand the business and gradually optimize the system design. It is in this process of gradual abstraction that development frameworks, middleware and business frameworks are born. Programmers with good abstraction ability can abstract the most reasonable design of software according to the characteristics of the business, so that the program has good readability, performance, scalability, scalability, usability and reliability, while programmers with poor abstraction ability face Complex business logic is likely to be helpless, resulting in bloated code that is difficult to maintain.

 

How to improve the abstract thinking ability of programming, or what are the specific aspects of abstract ability? The author believes that there are three aspects for reference: making good use of the programming idea of ​​top-down decomposition, skilled use of design patterns and necessary refactoring of the code. These three aspects can reflect the abstract thinking ability of excellent programmers.

 

1. Make good use of the programming idea of ​​top-down and layer-by-layer decomposition:

No matter what program you read or write, always stick to a top-down, layer-by-layer decomposition. No matter how many monitors are configured or how many editors are opened, it is impossible to display all the codes at one time. When reading or programming, always keep your mind under a screen range, and the invisible codes are regarded as black boxes. Abstract thinking to understand code. Small systems are always easy to understand, but large systems are difficult to put solutions into the brain at once, and larger systems require more abstraction when designing and understanding.

 

2. Proficient in using design patterns:

Design patterns are a variety of patterns that arise naturally after a program is abstracted to a certain level. Based on these patterns, the architecture and design of programs can be better understood and communicated, which is a mature routine for software development. Design patterns are the basis for object-oriented software to be reused, and good use of design patterns can cultivate the abstract thinking ability of programmers.

 

3. Refactor the code as necessary:

Refactoring can improve the design of existing code and remove bad smells from the code. Any piece of code should go through three stages. The initial design stage seeks to solve problems quickly, efficiently, and economically. Later design optimization is used to expand new requirements of the program and solve bugs. The final refactoring focuses on system design. optimization. Refactoring is a good way to develop abstraction capabilities. How to describe solutions with better abstraction models to achieve better scalability, scalability, availability, and reliability deserves everyone's deep thinking.

 

3 study notes or technical summaries per week, aimed at Java programmers with a certain foundation, covering Java advanced, virtual machine, MySQL, NoSQL, distributed computing, open source framework and other fields. Follow the author or WeChat public account backend-develop to get the latest content as soon as possible.

 

Abstraction ability determines programming ability | back-end development

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326645176&siteId=291194637