Introduction to programming (1) programming Overview

Source: Internet
Author: User

Programming can be seen as a branch of practical magic. Programmers use time and energy to make sacrifices and contract with the genie living in the computer in exchange for the ability to control code.
--- Fmddlmyy

To improve programming, you only need to read more and write more. This article seems like an experience, but the essence is to fill the water. This irrigation project draws up the following themes:

  • Programming Overview
  • Methodology in software development
  • Programming practices
  • Features of embedded programming
Programming Overview

This article will discuss "What is programming" or "What is the essential issue of programming" from different perspectives ". These discussions are not just definitions. We are actually expressing various programming ideas to deepen our understanding of programming.

1 programming is not an art

Our world is vague, continuous, and inaccurate, but software is precise, discrete, and formal. This makes it doomed that software cannot fully describe the real world. Therefore, we need to know what to describe and what to ignore. This is the essential issue of software.
--- Tom Demarco

Programming is not art. Programming is not perfect, and its purpose is to solve the problem.

In contrast to the artistic "can only mean, can not be talked about", programming can not even tolerate the ambiguity of natural language, it requires the problem to be expressed as compiled, runable code, text and charts are just tools to assist communication.

Each programmer has two masks: Professional and professional. After wearing a professional mask, programmers will use the best tools they can find to solve the problem in the simplest way possible at a reasonable cost.

Programmers who wear professional masks will learn a variety of programming knowledge (many of which are not required by the profession), accumulate experience, and absorb reusable models and ideas. They will spend a lot of time understanding what happened between the appearance of the program and the assembly code of the CPU. They have a strong desire to explore unknown fields and upgrade their skills.

They are constantly approaching the perfection of their skills, and this skill itself solves the problem in a way that is not perfect but effective. They have made a lot of effort, and these efforts are driven by curiosity and enterprising spirit. Like the magician described in "Magic apprenticeship", what a magician pursues can only be understood by the Like-minded magician, regardless of which camp they are from. The fulfillment of understanding the truth of things can be rewarded by all efforts,

2. control complexity

Everyone who is building a large system is facing the central issue of how to remove unnecessary, man-made, and self-seeking complex parts and control the rest, the complexity is unavoidable.
--- Betrand Meyer

Programming can be seen as a management task. The management object is code, and the control object is the complexity of code.

Traditional Chinese thinking prefers to talk about the essence and pursue something called "Tao. In programming, representation and essence are equally important. In the end, all programs are just a combination of some Assembly statements, but understanding this essence cannot help solve practical problems in most cases.

Code is written to solve the actual problem. When the number of codes increases to a certain extent, control over the Code itself will become an important issue. The quantity has changed its nature.

The key to management is to weaken and isolate the objects to be managed. "Make the people ignorant", "make the people", "Let the dogs hear each other", but "Let the dead" and "let the exchanges ". Every managed object should have as little knowledge as possible about other objects while completing its own work. Complexity is controlled by minimizing the coupling between objects.

Only by effectively controlling complexity can we use more and more information blocks to control more and more code, and use these 0 and 1 operations to achieve the work that our predecessors did not or even could not do.

3. Reuse

The core of programming skills is code reuse. Reusing existing knowledge is a prerequisite for accumulation and improvement. Otherwise, we will push the stone up the hill every day like who or who. In God's view, repetition is a punishment.

The programming profession is updated quickly and there are many things to learn. Some people feel tired, but some feel happy and feel lucky to be engaged in this profession.

The essence of programming is building. Based on application requirements, we constantly build larger information blocks. All programs we write can be seen as extensions of languages. In fact, we are constantly developing new languages. Every function and class we write is adding new functions to the existing languages. We combine various information blocks according to the pattern suitable for specific applications to complete practical applications. Some of these information blocks are made by ourselves, and some are used.

The key to the combination of information blocks is simple and clear interfaces. Therefore, we should program the interface instead of the application. Applications mean changes and are not reusable. Divide applications into modules, define Inter-module interfaces, and then build modules based on interfaces. The principle of module decomposition is:

  • The Coupling Degree of the module is as low as possible (Some people call this the principle of least knowledge );
  • Interface is as simple as possible (someone calls this interface isolation principle );
  • If the changing factors are encapsulated in the module, each module should encapsulate only one factor (someone calls this a single responsibility principle );
  • Minimize application-specific code.

There are two advantages for interface programming:

  • Information blocks can be reused;
  • Complexity can be better controlled.

People reuse knowledge in a variety of ways. In fact, the C language itself is not the reuse of knowledge? Other reuse methods include: library functions, new languages and compilers, new scripts, class libraries, program frameworks, design patterns, object-oriented, component-oriented, service-oriented, aspect-oriented, domain-oriented, various open-source code, various wizard and sugar-coated tools and various code generation tools provided by the development environment. It is a basic skill for programmers to fully understand the programming environment and be good at reusing various resources.

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.