Ch 4 - Organizing and Documenting M-Files z Design, write,...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Organizing and Documenting M-Files ! Design, write, then test code ! Careful code design takes time! ! Good design shortens time needed to write and debug code ! Several techniques for designing code 1 Use of a Consistent Style ! Visually and structurally organized code easier to debug ! Consider the following structure: 2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Visual Blocking and Whitespace ! Visual Consistency important (indent to make more readable) ! Indentation does not improve poorly written code ! Whitespace is a matter of personal preference ! Indentation ! Between variables ! Within nested parenthesis 3 Meaningful Variable Names ! Descriptive variable names aid in reading code ! Calculate inner and outer pipe radii d=5; t=0.02 r=d/2; r2=r+t d_in=5; thick=0.02 r_in=d_in/2; r_out=r_in+thick 4
Background image of page 2
! Critical for any code that is not going to be used immediately ! Considered an inseparable part of writing the code ! Two primary forms ! External written report ! Internal description of statements ! Comment statements coexist with code
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/29/2011 for the course PGE 310 taught by Professor Klaus during the Spring '06 term at University of Texas at Austin.

Page1 / 7

Ch 4 - Organizing and Documenting M-Files z Design, write,...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online