Compilation is useless, no need to learn

Preface

This is a grave digging article, because some netizens asked this classic question again: "Is the compilation useless? No need to learn it?" Maybe many people have not read it, so I will post it again!

The assembly language course is a gray memory of my university.

For a long time, I couldn't understand why there are various addressing methods in assembly language, and why it is called an immediate number. It is clearly a number with such a weird name.

The simple homework assigned by the teacher is to use the horn of the assembly control motherboard to sound, and output blue characters on a white background, or white characters on a green background... 

I have done very hard work, and if I remember correctly, I often copy the homework of my classmate Zhang.

So I have always kept a little jealous and awe of people who can program in assembly language, especially when I heard people say: Qiu Bojun actually wrote WPS with assembly! Ken Thompson and Dennis Ritchie actually wrote the operating system Unix by export!

It can only be a sigh, the gap between people is really big!

After graduating, I was obsessed with operating systems. I went to look at the source code of MINIX. I was shocked at the beginning. In the bootstrap stage, it was assembly language throughout. I regretted why I didn’t study well in university. The compilation book "80X86 Assembly Language Programming Tutorial" (At that time, Wang Shuang's "Assembly Language" hadn't come out yet), ready to pick up the assembly.

After a period of painstaking review, I understand that assembly is actually closely related to the CPU, what real mode, protected mode, GDT, LDT, data segment, code segment...If you don’t understand these Intel CPU concepts, I can't learn to compile at all.

At that time, there was very little information on the Internet. Unlike the current explosion of information, I struggled alone in the Minix world for a period of time and then gave up. Maybe I am not the material involved in system programming, and I have moved on to application layer programming.

Those early programmers in the U.S. were very happy. They kept advancing with the development of computers and experienced a complete process from low-level programming to high-level programming.

In the beginning, it was to program the hardware directly. For example, Bill Gates and Paul Allen wrote the Basic interpreter directly on the Altair computer using assembly. Those programmers had a very thorough understanding of the hardware and the underlying layer.

Although I belong to the type from entry to abandonment, I can deeply appreciate the benefits of learning assembly: assembly interacts with the lowest level hardware (note that it is hardware), so studying assembly can have a thorough understanding of the operating mechanism of the computer. At least this knowledge is required:

What is a register

How to toss the program in memory and CPU

How does the CPU access memory

Segmentation of the program

How to implement function calls at the machine level (understand the basis of buffer overflow attacks)

Interrupt and its handling

......

With this knowledge, I must have a deep understanding of von Neumann computers.

And this knowledge constitutes the foundation of the operating system. With these foundations, it is very easy to understand the concept of process/thread and their realization, as well as virtual memory, file system, I/O, and so on. It's not that you have to learn assembly to understand the operating system, but that the depth of the problem is different. 

With the escort of compilation, you can build a computer with more details and more realization in your mind. Those concepts are not vague, but clear and vivid.

The operating principle of the operating system is definitely the knowledge that programmers benefit from for a lifetime. 

For example, back-end programming, I don’t understand OS processes, threads, and page caches.

File system, I/O just talk about how to implement a high-concurrency, large-data-volume website is a joke.

Another example is the learning of JVM. If you know how to assemble, you will be very kind when you see the bytecode of the JVM and the stack frame. You only need to convert the register-based calculation method to the stack-based calculation method.

Our computer knowledge is like a pyramid. The bottom layer is mathematics, the top is digital circuits, then assembly, and then the operating system, network, database, high-level programming language, framework, etc...

It is impossible for each of us to be proficient in every layer of this gold tower, but we must master and understand the core concepts that constitute this pyramid.

In application-level programming, we don't necessarily need to master assembly, but mastering assembly allows us to see the virtual world we live on more thoroughly. Yes, if you want to become the Neo of the Matrix, assembly must be learned.

I sometimes wonder: if there is no Java, Python, C++, Javascript, PHP in this programming world, there is only one language like Rod Johnson (the father of Spring), DHH (the father of Ruby on Rail), Eric Gamma (JUnit, Eclipse), Gavin King (father of Hibernate) These big cows who are programming at the application layer, what would it look like to write programs with assembly? 

What will they create?

I think one thing is certain: even if they use assembly, their programming skills will still crush us mercilessly. The reason is simple. A person who has mastered a huge system must have extremely powerful logical thinking skills. The compilation just changed his tool. 

What's more terrifying is that because the software is extremely difficult to write, only a bunch of great talents can program and become programmers. Those with mediocre qualifications can only move bricks.

So thanks to this era, there are so many languages ​​for me to choose, without being crushed by a big cow, so that I can live by programming.

Comic: Brother, have to stay up all night again tonight!

I have an annual salary of one million, and there is no code farmer turning

From three thousand monthly salary to three thousand monthly salary

How to reduce the happiness index of programmers?

Comic: Why is quantum computing so awesome?

Architect dismissal guide

Every time Java is killed, there is always a great god to save

The fate of programmers

70 years of chip wars, the real king is about to appear !

Kill the biggest monster of software development: the werewolf !

Who is the number one IDE in the universe?

HTTP Server: A poor counterattack

How to reduce programmer's salary?

Programmer, you have to choose the right time to run!

In two years, I learned all programming languages!

Javascript: a counterattack from a dick

I am a thread

TCP/IP Daming Postman

Https after a story

CPU Forrest

Guess you like

Origin blog.csdn.net/coderising/article/details/109685262