"High-quality programming guide" study notes

Title: High-quality programming guide C ++ / C language (3rd edition)


Basic information BASICS

  1. Author: Lin Rui, Han Yongquan
  2. Publisher: Electronic Industry Press
  3. Published: 2007


Reading experience LEARNINGS

  1. Programming needs to follow certain norms, in order to reflect the programmer's professionalism;
  2. Before reading this book, little is known about C ++ programming, but also hold the mentality of "programming but using MATLAB or Python implementation ideas" to read this book, read it all the way down, but was stiff C / C ++ programming specification Moving. If we achieve internal strength as a function of external work, seen as quality programming practice of cross-training, about the same as military science, programming but also internally and externally in order to become a generation of martial everyone now.
  3. After reading the author of "College Years" very touching, and author of "trouble" college years compared to seven years of my college life is particularly dull and depressed. I try to set academic goals in those which struggled graduated, and then looked back, that in addition to diploma and half-baked knowledge, there would be nothing left. The reason probably is not found at the university level are willing to strive for their own goals, things will start much less power and passion, only blindly confusion and hesitation. Fortunately, after graduation, seems to be slowly finding little direction in life, I hope to read notes and habits can stick to it, trying to absorb nutrients, and finally grow into their towering trees.


HIGHLIGHTS NOTES

  1. The initiative to create an environment, otherwise you can not design life
  2. Life and work passionately, otherwise you can not appreciate to the fullest of joy and pain.
  3. The more afraid pointer, the more you want to use the pointer does not use pointers properly, it is not really qualified programmers;
  4. Must develop "Using the debugger step through the program," the habit, the only way to discover the source of the problem.


Chapter One: high-quality software development of the Road

Software quality attributes: accuracy, robustness (fault tolerance and self-recovery capability), reliability (the probability of no failure), performance (efficiency program space and time), ease of use, clarity (easy to understand), security, scalability, compatibility (the ability to interact with other software), portability

CMM model: evaluation of software process capability.

SPP model: software development streamline parallel processes.


Chapter Two: A brief history of the development of programming languages

In 1972, Bell Labs invented the C language

80's. C ++ invention

In 1995, the invention JAVA

Applications can solve the problem of programming language is a good language, according to the characteristics of the product development, choice and industry recommended its own recommendation programming language to develop software.


Chapter 3: Basic Concepts program

Language: to achieve the compiler, linker or interpreter

Primary programming: structured programming, modular programming, programming process

Advanced programming mode: object-based, object-oriented, component-oriented, generic programming, event-driven programming

Library: C runtime library, STL, MFC, VCL and so on.

Integrated Development Environment (IDE): an integrated editor, compiler, linker and debugger.

Program works: stored program control principle

clipboard


Chapter Four: C ++ / C programming Getting Started

main () function, the default function of the main program, returns 0 represents a normal end.

After the parameters transmitted by the initiator intercepted and packaged into a string array to a main () is a parameter argv: command line parameters.

Global variables in the static data area of ​​the program, in the main (created before), the destruction of the main (after), then the compiler will automatically initialized to 0.

Local variables are created at run time on the stack, dynamic memory allocated on the heap so programmers need to initialize.

C runtime library: Start function, I / O functions, memory management, dynamic link libraries.

Note compile and run difference: container cross-border access, dynamic virtual function resolution, dynamic memory allocation, exception handling all can play a role at runtime.

Bool type is not standard C language, but some implementations provide mapping through its library.

typedef int BOOL;

#define TRUE 1

#define FALSE 0

big endian: high byte, high word first, or large end of the address byte

Natural alignment: the basic data types of variables address should be divisible by their size, eg.int types of variables should be (32-bit system) divisible by 4

Cast is explicit, implicit conversion is completed automatically by the compiler, you need extra attention.

Operators and associativity:

clipboard

In order to prevent ambiguity and improve readability, it is recommended to determine the sequence of expressions with parentheses

clipboard

clipboard

For different language C ++, FALSE Boolean value is determined to be 0, but may be a value of TRUE or -1.

The correct way floating point variables were compared

clipboard

Right pointer variable with zero values:

IF (p == NULL) // explicit comparison with P NULL, the pointer variable p is stressed

In order to prevent ambiguity and improve readability, it is recommended to determine the sequence of expressions with parentheses

The program may experience a combination of if / else / return, you should use the return condition? x: y;


Guess you like

Origin www.cnblogs.com/Superorange/p/12383303.html