The art and beauty of programming laziness

Source: Internet
Author: User
More and more people think that programming is not a technology. Its more internal temperament is an art and an art of creation. At this time, you are God. You can construct a class called the universe, then construct the stars. These classes have polymorphism, And the generated objects are stars, planets, and satellites. You are like a great architect, think about the cohesion and coupling of this time, orthogonal and chained, you use a simple pen to outline the complex lines, so that the phenomenon is very complex and diverse, the gods standing in the frame, you and your partners, can see that the entire internal structure looks beautiful and clear at a glance. At this time, every god inherits your masterpiece and constantly enriches the content of the whole world. Finally, the land appears, the ocean appears, plants appear, animals appear, and humans appear, you have left countless independent interfaces for other gods to enjoy your art. Because the interfaces are orthogonal, so the total number of interfaces of N gods will be G1 * G2 *...... GN, so there were infinite unexpected things in the world. On this day, humans found room for laziness, so they were quietly engaged in Art. Therefore, the design model was also called lazy and art, "lazy art" for short ". Some may be confused. The following examples will be serialized to show the art of programming.
Let the values of two variables be exchanged, or let you and me exchange the body. From a mathematical point of view, you can find a dead person and then attach my soul to the dead first, when you attach the opportunity to my body, my soul can be transferred from the dead to your body.
The model is as follows:
Temp = me;
Me = you;
You = me;
Although mathematics is beautiful, it is sometimes lacking in beauty. When you are developing a restricted system, such as a single-chip microcomputer, you have very few resources available, it can be said that it is too slow, which gives you a place to put the dead, see the beautiful art of logic (C ++ description)
You ^ = me;
Me ^ = you;
You ^ = me;
Do you believe this? You and I are moved to the opposite world through the reciprocal or. Why? A simple explanation, such as the plus (+) and minus (-) Operators in mathematics, constitutes a inverse operation, the difference or itself (equivalent to an operator) has the inverse operation function. I will not explain how the binary bit is implemented. I have n experts here, and I dare not ......
The above is a simple example.
......

To be continued

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.