The main content of this chapter is software implementation
Programming languages
The programming language has been evolving and evolving, and its development has undergone a process from machine language to advanced language. Programming language is an important tool for people to communicate with machines, and its characteristics will inevitably affect people's thinking and the way of solving problems, as well as the quality and efficiency of communication between human and computer. Therefore, choosing a suitable programming language is an important work in the software development process. Can be considered in the following aspects: application areas, user requirements, system compatibility, portability and development environment.
Software Coding Specifications
file naming and organization
The composition of the Java source program is as follows: 1. File header notes for the description of copyright and copyright information; 2. Package and import statements; 3. Class and interface description statements.
Layout of the Code
1. appropriate blank line; 2. Line of code and space within the line; 3. Branches, alignment and indentation; 4. naming conventions; 5. statement; 6. Comments.
Software Coding Case Study
Program Comment issues
1. Note is not a programmer's guide, there is no need to make too many explanations for some statements that are already obvious; 2. Note is not a function reference manual for the standard library, its main task is to answer questions rather than increase the number of lines of code; 3. The purpose of the note is to facilitate the reading comprehension of the program, not too much or too little; 4. Note Language must be accurate, understandable, concise, and avoid abbreviations.
variable naming issues
1. Named with a specific prefix, can quickly find evidence when their own code is stolen by others; 2. Rename the base type to maximize the portability of your code; 3. Using a macro definition to represent some basic function operations can significantly reduce the number of lines of source code; 4. Using a highly concise abbreviation can enhance the confidentiality of your code.
Memory Exception issues
1. Memory leak problem; 2. pointer parameter problem; 3. "Wild Pointer" question; 4. Programming recommendations.
Exception Handling issues
Exception handling mechanisms are useful, but are also prone to misuse and cause code clutter. In the process of using exception handling, it must be very clear that there is no exception thrown and after the exception of the program execution process, grasp the exception handling of the jump and nesting mechanism, and pay attention to the exception handling of memory problems.
Performance Issues
1. Avoid creating duplicate objects; 2. Optimized statements improve performance.
Software code Review
The purpose of software implementation is to write the correct source program, then there is no compile error source program is correct? Obviously not. First of all, there is no syntactic error in the program module, the semantics is not necessarily correct, and second, even if there is no compilation error, there may be some functional or performance deficiencies. 1. Code check: class; 2. Code check: property; 3. Code check: constructor; 4. Code check: Method header; 5. Code check: Method body.
The summary of software Engineering--Nineth Chapter