Книга: Embedded Linux development using Eclipse
Code Style
Code Style
The CDT text editor incorporates “smart typing” features, that include things like autoindentation and formatting, that are controlled by the Code Style preference shown in Figure 3.20. You can select from among four built-in code styles that include:
• KR
• BSD/Allman
• GNU
• Whitesmiths
Figure 3.20: Code Style preference.
The primary difference among the four seems to be the location and indentation of opening and closing braces. The default is KR, where the opening brace is on the same line as the expression or key word that introduces the block. This seems to be the preferred style among Linux programmers.
For what it’s worth, my personal preference is BSD/Allman, where the opening brace is on the next line and indented to line up with the introductory expression. There are options to edit the built-in styles, import a style, and to create a completely new one.
Among the features you can edit in the built-in styles are Tab policy and Tab size. Tab policy specifies whether tabs are represented in the file by tab characters, 0x9, or spaces.
- Styled Text
- Styled Formats
- NT Style Driver Construction
- 9.3.2 Customizing Code Indentation Style
- Системные переменные ROWS_AFFECTED, GDSCODE, SQLCODE, TRANSACTIONJD, CONNECTIONJD
- Appendix J. Example scripts code-base
- Элемент STYLE
- Test Driver Code
- Regulating Code to Regulate Better
- Part Two - Regulation By Code
- 6. Лекция: Обработка текстов. Регулярные выражения. Unicode.
- Переопределение System.Object.GetHashCode()