In-depth understanding of computer systems - study notes (1)

Benefits of understanding how build systems work

Optimize program performance

If you understand the working principle of the compilation system, you can understand the following issues more clearly,
such as:

  1. Is a switch statement always more efficient than a series of if-else statements?
  2. How expensive is a function call?
  3. Are while loops more efficient than for loops?
  4. Are pointer references more efficient than array indexing?
  5. Why does putting the result of the loop sum in a local variable run so much faster than putting it in a parameter passed by reference?
  6. Why can we make functions run faster by simply rearranging the parentheses in arithmetic expressions?

Errors when understanding links (link-time errors)

Some of the most troubling programming errors are linked to linker operations, especially when you're trying to build large software systems.
for example:

  1. The linker reports that it cannot resolve a reference, what does it mean?
  2. What is the difference between static variables and global variables?
  3. What happens if you define two global variables with the same name in different files?
  4. What is the difference between static library and dynamic library?
  5. Does the order in which we arrange libraries on the command line matter?
  6. Why do some linking errors not appear until runtime?

avoid security breaches

The primary cause of security breaches on most network and Internet servers is buffer overflow bugs .

These errors exist because few programmers understand the need to limit the amount and format of data received from untrusted sources.
The first step in learning secure programming is understanding the consequences of the way data and control information is stored on the program stack.

おすすめ

転載: blog.csdn.net/qq_56130624/article/details/126506127