Misunderstood C ++-ant

Source: Internet
Author: User
Ant financial

Which animal is the most powerful? Maybe everyone has different answers. My answer is ant. That's right, little ant.

An ant is small and fragile. However, a group of ants are very powerful. They can kill and swallow any creature they encounter, including humans. This is not just because of their large numbers. More importantly, their organization. Among all animals, ant financial's organization is the strictest and most efficient. This makes ant financial a leader in any field. Ant financial is the best hunter, the best collector, the best herdsmen, the best grower, the best architect, the Best Traveler, and the best warrior.

Bees, bees, and other animals are also group-based and collectively known as Social Insects together with ant Financial. However, their capabilities and work efficiency are far inferior to those of ant Financial. The reason is not complicated. The key lies in the division of labor and collaboration. The complexity of division of labor and collaboration in the ant colony system is confusing. Second only to human society. However, due to the strong concept of individuals, humans cannot achieve the strict and efficient performance of ant Financial.

As a general knowledge, we know that ant financial is divided into ant financial, and ant Financial. Most of the ant colony systems are industrial and military ants. The process is responsible for production and labor, and the soldiers are responsible for security defense. Sometimes, with strong physical strength, they will do some heavy work. On this basis, there is a finer division of labor among the workers. Some workers may have never left their nests for a lifetime and will always work underground. Some are responsible for baby care, some are responsible for planting, some are responsible for cleaning, some are responsible for building, some are responsible for transporting food, and some even become a full-time "granary" (honey ant ).

 

As a highly organized production activity, software development can greatly benefit from division of labor and collaboration. This is beyond doubt. The Application of C ++ in software development can gain more inspiration from ANT financial's division of labor and collaboration.

For ant Financial, a lot of work is difficult. For example, producing fungi (that is, planting mushrooms ). The ants need to cut leaves from the tree, move them to the storage room, spread the species, control the environment, and harvest fungi. This complex work is not a simple task for highly intelligent humans. Requires excellent organization and coordination. (An ant species mushrooms, instead of planting one or two mushrooms, it is equivalent to producing cars on a large scale ).

Similarly, developing large software or a series of software with C ++ is also very complicated. It is more powerful than other languages, such as Java, C #, and C ++, but it is very difficult to use. The main reason is that C ++ has high requirements on personnel training and sometimes exceeds the capacity of the enterprise. Therefore, many enterprises abandon C ++ and directly use Java and C # to develop applications. However, Java and C # are suitable for high-level application development, that is, business translation. However, for basic development involving a large number of public service components, these languages depend on the development efficiency, or from the running performance, can not achieve the optimal. (Please note that we are not talking about making software. We require that the software be prepared in the most efficient way. Among many basic service components, language abstraction is far more important than ease of use ).

For a software enterprise that has long-term development and has a broad but closely linked nature, basic service platforms and components will produce twice the result with half the effort. However, many of these enterprises do not develop enterprise-level platforms or libraries due to their immediate interests or technical limitations. All software starts from scratch. This "positive" repetitive labor behavior is an unprecedented disaster for the profits of enterprises.

C ++ is the best choice for such enterprises. (I should not say "best". c ++ is not a perfect language after all, but there is no real replacement yet. Language D is a good candidate, but it is still developing and cannot see obvious advantages at present. Moreover, C ++ itself is constantly evolving ). C ++ has unparalleled advantages in basic development. Of course, we must first take advantage of these advantages. This is troublesome. Because there are not many good C ++ programmers on the market. It is not easy for an ordinary enterprise to find dozens of hundreds of C ++ experts or experts.

At this time, we have to learn about ant Financial.

If you carefully analyze the characteristics of software in an enterprise, you will find that the entire software system can be described in an inverted triangle. The bottom is the service component, and the top is the application software. Service components provide basic service functions, while upper-layer application software assembles these service components.

This is good news. Because service components usually need to deal with a type of problem and have high requirements on abstraction. However, a single component is used for a lot of software. Therefore, the development workload of service components will be relatively small, but there are high requirements for developers' analysis, design, and coding capabilities. This kind of person is rare in programmers, even though it is not uncommon. Fortunately, the basic components are versatile and can be centrally developed by a few C ++ experts. Enterprises do not need to dig out a large batch of fat meat from their profits to support a large group of experts.

On the other end of the inverted triangle, the main task is to translate the business into a program. In this regard, the requirements for programming capabilities are relatively low, while the requirements for business knowledge and experience are very high. (These people are sometimes referred to as "implementers" or "consultants "). Therefore, this group of people is complementary to the Basic developers. This forms a division of labor and collaboration.

Further, developers at the underlying and senior levels can further segment: Good At algorithm high data processing, good at abstraction, architectural design, financial learning, accounting system, and understanding of logistics, responsible for the warehousing system; a dedicated team of fire fighters ;....

Managing such a complex software development organization structure is a challenge. Let's get some inspiration from ANT Financial.

Obviously, ant financial is a very simple animal. Compared with humans, there is no intelligence at all. They do a complex task together, not relying on their own ingenuity. Ant financial does everything by instinct. (It can also be said that God's Program for them ). Every ant's "program" is very simple. However, these simple actions can be combined to complete the work that can be done by High-intelligent creatures. (Imagine what it would be like if advanced creatures, even people, are as closely organized as ant financial ).

In this way, theoretically, the individual in software development can be well organized simply by executing the established program. Such a program is called a process ". (Users who know CMM are not familiar with this word. Those who have done CMM have deep feelings about this word ).

However, this is only theoretically true. After all, programmers are not ant Financial. Programmers have a passion, and it is difficult to achieve the strict organization of ant Financial. However, the strict and meticulous management process is still very useful, although sometimes it cannot be thoroughly implemented. There is always better than none.

Now let's take a look at how to use C ++. The advanced application of C ++ is indeed refreshing. Sometimes a few dozen or even 20 lines of code can replace hundreds or thousands of lines in other languages. Once a component or algorithm is developed, it can be used for all types. However, people who can play C ++ to this level need 4 or 5 years of rigorous training, and must also be authentic C ++ training. What's more, there is also the training of abstract analysis and design capabilities. This is not a one-day task.

Because there are few such people, they should be put in key fields to develop high-value components. Components developed by these people can be used by others.

However, there is still some trouble. C ++ is not an easy-to-learn language. Even the most basic use, such as using a ready-made container and Algorithm for sorting, is longer (a little longer) than other languages ). After all, they need to be familiar with more basic concepts and skills. It also prevents them from getting too early into the dangerous mechanisms of c ++.

Since programmers who have previously described high-level programming as proficient in business and crude programming, it is cool to let them learn C ++ again. Therefore, C ++ is the most unsuitable language at this layer. Here, we need a very simple and straightforward "glue language" that does not require a complex mechanism ". Although Java and C # have been widely used in software development at this level, the requirements for senior developers are still too complex. Java and C # are languages between the "glue language" and the basic language. You can develop an entire application software separately.

However, as we mentioned earlier, we need to learn about ant financial and engage in division of labor and collaboration. The underlying service components are more appropriate to be implemented by C ++, and it seems a waste to use Java and C # for high-level development. It is not only a waste of language, but also a waste of developers' energy.

What we need is a simpler language. This allows us to focus on some scripting languages, such as Ruby, Python, PHP, various browser scripts, and even XSLT. These languages are very simple and easy to learn (easier to learn than Java ). Even if you do not know programming, you can master it with a little training. This is very suitable for business experts who are "programming semi-illiterate. These languages are usually straightforward. Users can naturally translate the processes and elements of the business into code without complex logic analysis. Python has been successfully applied in Google.

From the perspective of benefits, it is no longer appropriate to develop a language at all levels. C ++ has the ability to get through, but it is not cost-effective. Different layers have different application features, and different languages are suitable for different development. Only by positioning them in their respective appropriate fields, and enabling them to collaborate with each other and complement each other can we maximize the benefits.

In addition to the scripting language, the emerging DSL (domain specific language) is also a possible development direction. DSL is designed for specific fields. Its syntax and usage are very similar to the natural concepts and operations in this field, and it is very suitable for business developers. In addition, DSL can be constructed in a "host" language. In the last two chapters of C ++ template metaprogramming, it describes how to use the mechanism of C ++, construct a DSL. (Of course, C ++ is not designed for DSL. It is totally "unexpected" to make DSL ". Therefore, the DSL is very restrictive and the syntax is awkward and ugly ).

If a DSL can be constructed in a host language, an enterprise can develop a DSL for its own business field. Compared with the scripting language, DSL is more compact and direct. At present, DSL is still in its infancy, and it is still unclear how it will develop in the future, but it is a good choice. Here, we have some simple discussions on this. More, you have to Google.

However, from another perspective, using C ++ alone also has some advantages. When two languages are used, we cannot require high-end languages to fully utilize the mechanisms provided by C ++. For example, C ++ can use templates to develop generic algorithms and generic components. However, other languages cannot be used directly. C ++ must be required to convert it to a specific type, such as a class or function. This is not conducive to the improvement of development efficiency.

There may be a way to solve this problem, that is, to build a language family. Just like an automatic rifle family, a basic rifle model is developed with a class machine gun, sniper rifle, a cabin gun, and an assault rifle by replacing a small number of parts. A language family can design different languages based on a common syntax and programming model. It includes high-level languages for underlying development and for different applications. The underlying language has powerful functions and is difficult to learn and use. The high-level language features are simple and easy to learn and use. The two have the same foundation and are easy to interact with each other. The strengths of each exhibition complement each other. For example, a high-level language cannot be created and can only be used as a template. The template is provided by the underlying language. The underlying language is equivalent to the database developer, while the high-level language is the database user. It is much easier to use high-level languages because they cannot play with those useful but complex or even dangerous language features.

 

After billions of years of development (with billions of years of design), there are many things worth learning and learning from. Therefore, we have the subject of bionic. In the past, people paid more attention to the bionic nature of the creature. But now, we focus more on the non-material things. The strict and efficient social organization of ant financial provides us with good samples. The rest is how to understand and use the information.

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.