CSCE 315 Lecture 3

From Notes
Jump to navigation Jump to search

« previous | Monday, January 23, 2012 | next »


Other good constructs:

  • Keep control info and only control info in for loop
  • Use whitespace to separate ideas (after commas, parts of conditionals)
  • Use idiomatic if-elseif-else statements where possible
  • Avoid "magic numbers" (generally anything other than 0 or 1)
  • End line with an operator if line breaks are necessary; use indentation for continuation
  • Keep methods in some logical order

Comments

Internal documentation that will always be up-to-date

Should not replace good coding, but complement it.