Should CC ++ programmers "master" [a certain Assembly Language ]?

Source: Internet
Author: User

After three years of work, I found that my energy will decrease with many things. Things that I felt very passionate and interesting may gradually become "irrelevant. I don't know whether this is a kind of free and easy, or a kind of slack. In short, I will try my best to overcome the present situation and make full use of my spare time. In addition, I recently got a "quasi-expert badge". To be worthy of this badge and to get rid of the previous slack, I have to keep writing it.

Previously, on the Internet, a group of guys were there to discuss whether CC ++ programmers should have a certain degree of knowledge about assembly languages, of course, I also participated in the discussion as a CC ++ programmer. I have my own opinions on this issue, which can be said to be my personal experiences and experiences. So I will share this Mid-Autumn Festival holiday with you. Of course, first of all, I declare that this article only represents my personal point of view. If you are willing to accept it, I am glad. If you are not willing to accept it, I will sing a movie here. In terms of technology, everyone has their own set of methods. If there is no right or wrong, I still share my consistent point of view: I only want to read novels that are useful to me and useless.

First, why is the title of this article "An assembly language" emphasized ". I think everyone knows that the Assembly Language is just a collective name of all platform assembly languages. In this way, different platforms will have different assembly languages, that is, different assembly instructions and different mechanisms. The so-called language is an assembly language on a platform that you often work on.

Second, there are roughly the following points about whether to master this issue:

1. For general software developers, focus on upper-layer implementation, focus on functions and products, and not on compilation.

2. Many CC ++ programmers do not understand assembly and have become the main program and core R & D of a project team of a company. Therefore, compilation can be skipped.

3. The vast majority of CC ++ programmers are still engaged in upper-layer development. The vast majority of projects are also in upper-layer development. They can make a lot of money without understanding the bottom layer and make more money.

4. At the underlying layer, such as reverse engineering, cracking, and virus writing, many programmers who are dedicated to this layer feel that they have not made much money by doing countless repetitive work all day long and feel meaningless.

5. For programmers in the C #, Java, Web and other fields, most of them will not focus on the underlying implementation. They still have a good experience, and so on, assembly can also be mastered.

6. The Assembly Language is almost non-cross-platform, so even if you have mastered the compilation of a platform, you still have limitations on the assembly language, such as syntax and mechanism.

I will list several opposing points for the moment. You may have other opinions. Please reply. My personal opinion is my opinion on the support side. So the following are my views on the above several opposing points and my personal experience.

From the points of view above, there are several key points: interests, income, and interest. I don't plan to elaborate on these three key points separately, because they are closely related. For the benefit and income, it is true that programmers with high positions and good incomes in many companies do not understand compilation and the underlying layer. This does not mean they are incapable of doing so, and often they are very competent people. This seems to conflict with my personal support opinion, but I think this conflict can be resolved in the pursuit of two words. Why can we solve it with our pursuit? Because the pursuit can be any field, any direction, any purpose, and any standard, so what I mentioned above comes down to the root, and there is no right or wrong to master it. Let me talk about how I feel as a programmer.

We entered this industry and engaged in programming (most programmers started programming ). I believe that the original intention of many programmers is to be very interested in programming and development. interest drives us to stay up late, drive us to research, and drive us to progress. For CC ++ programmers, I believe that interest accounts for a large proportion. Here are several examples:

You should have read the book "deep into the C ++ object model". This is a very meticulous and wonderful book. I think you should feel this way. So on this basis, have you ever thought more? This book describes examples and theories. Examples are described in C ++. So do you want to know such questions in the specific compiler and platform:

1. How is this pointer passed into the member function? What are the differences and connections between member functions and common functions and static member functions?

2. What is the relationship between member functions and classes in memory through syntax? What is the relationship between objects and member functions?

3. How is the call principle between functions implemented?

4. What are the differences between the functions _ cdecl, _ stdcall, _ thiscall, and _ fastcall? How is it implemented?

5. virtual functions, polymorphism, and inheritance are essentially embodied, and how are these mechanisms implemented at the underlying layer?

In addition, when you are learning and using CC ++, I think you will still care about some details, such:

1. Will recursive functions cause inefficiency? Will the compiler optimize recursive functions? How do you know the optimization details?

2. For this code: int B = a> 0? 100: 200; // int a; what are the details of the compiler optimization? Will this code be compared and redirected?

3. For such code:

         #include <stdio.h>         int a = 10;         int main( void )         {             printf( "%d", a );             return 0;         }                      

Enable global optimization in VC. Does global variable a still exist? How do you prove it through an essential argument?

4. For: float a = 100; int B = A/30; in VC, do you doubt that there will be function calls behind these two codes? If so, what function is called? Why?

5. For _ declspec (thread) int g_nnum = 0; do you know the specific implementation mechanism behind g_nnum ++?

6. For debugging, How do you track Errors Based on the stack scene and other information recorded during program crash?

7. How do you know how plug-ins modify game programs and where they are modified for game development?

8. How do you get familiar with the optimization details of the compiler, how do you write the code suitable for it, and how do you write code better than it?

There are many examples of such upper-layer development, which will not be listed here. From the questions listed above, I want to be a CC ++ programmer and a programmer who loves programming and development. You all want to know the original principles. As an upper-layer developer, you should focus on upper-layer functional development and product aspects. However, I personally think that in the spirit of technology, with this passion, and with the development of our own technology, we can learn more about the bottom layer, which will help the upper-layer development with the permeability and global control. In my personal experience, when I grasp the key details and global design, I can quickly respond to and trace and handle problems in any place. The current compiler technology is very powerful, and many details can be safely handed over to the compiler for optimization and processing. But I think the compiler is not omnipotent, and the talents are the smartest. Understanding is not inevitable, but it is better to grasp it.

For beginners and even programmers who have been working for a certain period of time, many of them are at the CC ++ syntax level, and they are very handy in terms of syntax and ask their essence, it may be lacking. In my personal experience, after mastering the syntax, I will focus more on the specific implementation behind the syntax. You will have a deep understanding of the memory, data, and various underlying operating mechanisms of the program. That's why I went to the beach and dive to see the underwater world. If you miss the bottom of the ocean, you will lose a lot of wonderful things. I think these wonderful things are also one of the best pursuits of programmers.

For Java, C #, and web programmers, I think compilation may be relatively far away. There will be less attention in this regard, but in combination with the previous point of view, as a programmer, this role is to let their programs run on the machine, so I think many underlying questions can be studied as a programmer's interest. The goal is to make yourself more transparent and more familiar with your platform. I don't know how to express the word "Transparent". My personal feeling is that it can be achieved from phenomena to essence, in addition, we can outline a very clear and vivid image in our minds from its essence, so that everything can be seen at a glance. A little overhead, look inside and outside the Great Wall, but the broad feeling of Yu shile.

For programmers who are developing at the underlying level, it is necessary to master the compilation. However, to clarify one point, the point of view in this article is more from the perspective of interest and permeability. for developers at the bottom layer, it may be boring, especially full-day cracking and reverse engineering, there are a lot of physical skills. From my years of experience in cracking and reverse engineering, this is indeed true. However, I think that cracking and reverse engineering are only one of the fields. The reason why I crack and reverse engineering is often in interest and I want to give a more essential and reasonable explanation to the upper layer. Therefore, the combination of the upper layer and the bottom layer is my fundamental purpose and is also a kind of idea that this article will hold highly.

To sum up, my opinion is that CC ++ programmers and even programmers are necessary to master or understand the compilation, whether they are interested or working, but not mandatory, the demand and pursuit are also different. Therefore, do not ask whether or not others should pay attention to the underlying layer and master a certain assembly language. The answer is obvious.

No.: If you want to learn more about the advantages of assembly, you can read the article in C/C ++ inline assembly language in this blog.

---- If you need to reprint it, please indicate the source [http://blog.csdn.net/masefee.pdf, thank you! ----

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.