Lecture Notes for CS 325
The Implementation Process, 28 February 2000
- production - make the design a practical entity
- write code for other humans to read; they must acheive understanding
- code for testing and maintenance
- programming practice
- translate design into simple, clear code
- coding is language independent
- approaching the design hierarchy
- top-down vs. bottom up implementation
- design need not dictate implementation
- incremental build and test
- top-down and bottom-up testing are different
- poor design (ill structured, incomplete) leads to a top-down
implementation (design in code).
- layered designs lead to bottom-up implementation
- of course, you can do both
- local implementation increments vs. global requirements ones
- structured programming
- the object-oriented x of the 70s
- static and dynamic program structure
- discovering dynamic behavior from static structure
- structured programming makes dynamic behavior correspond to static
structure
- single-entry, single-exit statements - if, loop, sequence
- simplified verification
- hierarchical linerization
- ease of understanding guides program structure
- information hiding
- data structures modeling problem and solution concepts
- only a limited number of operations make sense for a data structure
- hide the data structure, present the operations
- no direct data structure manipulation preserves integrity
- reduces coupling and improves maintenance
- hides data structure complexity
- selective direct access to data - read-only access
- language support via data abstractions
- some languages fake data abstractions better than others
- data abstraction is always useful, supported or not
- programming style
- programmers tend to do what they're told when given clear objectives
- general rules for writing code -
standards from
Taligent and gnu; standards for Java and C++
- descriptive names - hungarian notation,
original and
modified
- single entry, single exit control constructs
- few or no gotos
- hide information
- create descriptive types
- shallow nesting
- small modules
- simple module interfaces
- consistent and clear program layout
- avoid side effects
- deal with the unexpected
- the vexing comment
- no code comments, generally
- input-output oriented procedure comments
- high-level module comments
- follow local standards
- maintaining consistency between comments and code
- object-oriented code and the law of demeter
- procedural coding guidelines apply to method development
- additional guidelines to cover state and method interaction
- the law of demeter attempts to control inter-object complexity
- avoid non-parameter, non-instance objects
- globals, scope violators, and friends
- use only instance, parameter, local, global and recursive objects
This page last modified on 1 March 2000.