1 / 12

Layout and Style

Layout and Style. Chapter 31. O utline. Laying Out Control Structures Laying Out Individual Statements Laying Out Comments Laying Out Routines Laying Out Classes. Which style is better?. if ( expression ) one-statement; . if ( expression ) { one-statement; } .

mandel
Télécharger la présentation

Layout and Style

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Layout and Style Chapter 31

  2. Outline • Laying Out Control Structures • Laying Out Individual Statements • Laying Out Comments • Laying Out Routines • Laying Out Classes

  3. Which style is better? if ( expression ) one-statement; if ( expression ) { one-statement; } Format single-statement blocks consistently

  4. Which style is better?

  5. Which style is better?

  6. Which style is better? ReadEmployeeData(maxEmps,empData,inputFile,empCount,inputError); ReadEmployeeData(maxEmps, empData, inputFile, empCount, inputError);

  7. Good or bad?

  8. Good or bad?

  9. Good or bad?

  10. Good or bad?

  11. Good or bad? // comment zero CodeStatementZero; CodeStatementOne; // comment one CodeStatementTwo; CodeStatementThree; // comment zero CodeStatementZero; CodeStatementOne; // comment one CodeStatementTwo; CodeStatementThree;

  12. Good or bad?

More Related