Abstraction, programming path

Source: Internet
Author: User


Only by daring to challenge difficult books and challenging the most essential problems can we stimulate a leap in our lives. If you are only satisfied with learning those practical development technologies, although you can spend less effort, it also limits your own height.


I. abstraction-essence of Programming

Abstraction is the process and result of extracting the closely related attributes of real things based on the characteristics of the problem.ProgramIs filled with large and small abstractions. The paging control is the abstraction of the paging function. In extjs, store is the abstraction of the Data Manager of the component, and the Java concurrent library is the abstraction of the underlying multi-core processor, interceptor, callback function, socket, pipelines, messages, and objects are all abstractions of certain entities in the real world. You can write programs without abstraction. But when the system grows bigger,
It will repeat the similarCodeTo make the system bloated and unbearable. by abstracting entities and events into concise concepts and finding consistent processing methods, it is possible to develop more concise and elegant solutions.


The essence of programming is abstraction and expression. Abstract The problems in the real world into computing objects that are easy to process, and then use computing languages to implement them.

Programming can be a process of meditation and expression, a pure mental activity, or even programming without a computer. It is not just a line of characters on the screen, but a stream in the heart, always come and go to the place, which is the beauty of programming.


If we are good at abstracting everything reasonably and mastering the processing methods of these abstractions, expression and programming will be a very smooth and natural thing, it's just like what we do in the "Sic" project. Otherwise, we have to write code that is still able to work with limited thinking, experience, and instant intuition, and it's hard to fight against the real dilemma. This is also the difference caused by the strength of abstract thinking.

Therefore, programming is not only about writing and practicing, but also about thinking and meditation. Programming is similar to playing the piano and requires a lot of exercises. Programming is different from playing the piano: playing the piano requires more skillful techniques, and programming is more inclined to be a kind of careful mental activity. When I think about it, programming is just a thousand words.


2. Think about problems at an appropriate Abstraction Level

Programmers usually think about problems at a certain level of abstraction. Int I = 4, from the bottom layer, is to fill in a memory address 0 XXXXXXXXX with a value 0x04, you can certainly think about this for small programs; however, when faced with a software system, it is very difficult to think about the problem at this level. At this point, its proper syntax is: "Assign variable I to 4, variable I represents an address, but we do not need to pay attention to which address ."
This is a reflection on the higher abstraction layer. A higher level may be to understand programs at the semantic level of functions, classes, and components.

Abstraction means learning to understand the program at the appropriate semantic level, rather than starting from the most primitive and bottom layer. The API documentation or language specification defines the reference semantics of a standard object. Therefore, if you write a Java Web application to a certain extent, you will read the servlet specification and Java language specification, rather than repeating what you have already done.


3.Abstract In the computing world

Abstract In the computer world is everywhere.

Technology is the mechanism abstraction of the solution and means of the problem. Each type of technology establishes a set of abstraction and proposes a consistent mechanism for the problems it faces, then follow the machine mechanism to solve this type of problem;

The development framework abstracts the immutable process and leaves the variable part to the application developer for definition and implementation based on the specific problem domain;

Programming LanguageIs the semantic abstraction of hardware execution;

The standard library SDK is a process abstraction or data abstraction for common subtasks;

The operating system is the process abstraction for executing process instances;

A database is an abstraction of massive data storage, query, and summary statistics;

A network is an abstraction of computing interconnection and remote data transmission;

All these abstractions are powerful tools. Abstract: The principle of separation of concerns is realized. A complex and complete application system is divided into multiple subsystems, which are responsible for easy construction and maintenance; being good at using abstraction systematically and thinking about problems at the appropriate abstraction level may truly grasp the programming path.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.