When writing c# programs in VS2008, the code is often confused accidentally, or when copying other people’s code, the format of the code is not standardized. In reading the SDK written by some companies, the style of the code is basically the same, and the folding and annotation give people a very fresh feeling. In actual projects, a project is often large and needs many people to write, so good reading of the code is extremely important, and you need to master the shortcut keys to sort out the code.
Microsoft Visual Studio 2008 Professional Edition official Chinese Edition
- Type:Programming development
- Language:Simplified Chinese
1. Formatting messy codeShortcut key ctrl+k+f, select the disordered text and press the shortcut key.
2. Code folding, folding up some code that doesn’t need to be analyzed and changed, allows programmers to focus most of their energy on the parts that need debugging and analysis.In VS2008, \region and \endregion are used, put the code that needs to be folded into it, and press the shortcut keyctrl+M+M, you can fold and open
3. Good code must be commented, vs annotates the method by entering / / / / on the method, and a series of things will appear automatically, /// <summary>, just add notes.
4. Multiple lines of comments will affect reading if they are not folded. You can fold them up. Here, use another annotation method, enter / / above the annotation code, and multiple lines will start another line / /, and then the samectrl+M+M,Fold it up.