Software developers to write code some small knowledge-sharing

  Software developers write code to make us the most important step in the process of writing the code that we will encounter many difficulties and problems, to share with you today is little knowledge about writing code, I hope everyone has some software programming help.

  When the demand for finalization and finalize the database, we can actually perform substantial coding. In my opinion, the best is individually programmed and can be lazy at all times. But now more and more large software project, the construction period is getting tight, in fact, a working group of people inside, usually 3-5 procedures ape, so people should pay attention to team collaboration. Then you write the code to let others understand it. In the process of writing the actual code, we must have a detailed coding standards. Many books have mentioned coding standards. But at least, you must comply with some of the following criteria:

  Source file structure: each file should be the title, content and annotated three parts.

  (1) Title: in front of the file comments include: program name, author, copyright information, a brief description and so on. If necessary, a more detailed explanation (in this section, a separate annotation separated by blank lines).

  Han defined number (2) registration and other content controls should be placed in the final part of the contents, according to the class of private, protected, pubilic, __pubished order, as far as possible and to maintain only one part per each part of the statistical data by function , properties, the sequence of events.

  (3) Accessories Description: file at the end of supplement, reference materials and other content when less can be placed at the end of the section title.

  Interface design consistency of style :

  Due to the use of visual programming, all interfaces are similar to Win32, most appropriate controls are standard controls under Windows operating systems, refer to other relevant internal management application software on the market.

  Based on a simple principle of use, close to the user's consideration, a user interface using standard windows-style interface, the operation mode is also the same as the window style. Thus, during implementation, the customer can reduce the training, and the user can easily start.

  Edit Style:

  (1) Indent: Indent Tabs in the unit, a space with four tabs. Written global data, function prototypes, title, additional description, function description, tags, and so on.

  (2) Space: functions and data types therebetween and modifications should have the appropriate box (e.g. __fastcall etc.). ) Name, and the proper alignment. Key words principle is a space above the sentence, regardless of whether there are brackets. Added sentence after sentence-line comments should be separated and aligned as far as possible.

  (3) Align: In principle, should be aligned closely related lines, including the type, decorative, name, and other parameters. Should not exceed the length of each line of the screen too, when necessary, appropriate packaging.

  (4) a blank line: There are two lines are empty between each part of the program file structure, if not necessary, only one line. Typically, there are two lines between each function implemented is empty.

  (5) Note: Note there are three requirements: A, must be more meaningful; B, necessary to properly describe the program flow; C, must be the latest news.

  Title, annotated; Han count showed that: the number of basically every culvert are required to have a modest show, it used to establish the number of Han added, without pre-established number culvert under the condition part is added to the number of Han prototype, its contents the key role of the number of Han, head to optimize the algorithm showed that the main parameters shows that the value returned indicate so on, but also when necessary as there are some very.

  Naming convention: stick with Hungary variable naming rules, all identifiers are in English or English abbreviation, spelling is not used, the identifier of the first letter of each word is capitalized, abbreviations of words are generally capitalized, plus, if necessary, "_" separator.

Guess you like

Origin www.cnblogs.com/xixixilu/p/10948369.html