Notes
Slide Show
Outline
1
Programming MIS-Takes
  • Mr. A.
2
Programming MIS-Takes
  • Programmers always work alone
    • We use separate computers, files, etc.
  • Code is a write-once medium
    • Training heavily emphasizes writing
    • Programs are not reused after completion
  • Correctness must come first
    • Other considerations are postponed
    • We don’t explicitly learn other qualities


3
Programmers always work alone
4
Programmers work together
  • Team members
    • Analysts
    • Designers
    • Coders
    • Testers
    • Technical writers
    • Marketers


  • Customers
    • Requirements phase
    • Installation
    • Technical support
  • Peers
    • Pair programming
    • Code reviews

5
Programming MIS-Takes
  • Programmers always work alone
    • We use separate computers, files, etc.
  • Code is a write-once medium
    • Rewriting is seldom performed
    • Few people read code
  • Correctness must come first
    • Other considerations are postponed
    • We don’t explicitly learn other qualities


6
Reading, writing, and re-writing
7
Programming MIS-Takes
  • Programmers always work alone
    • We use separate computers, files, etc.
  • Code is a write-once medium
    • Rewriting is seldom performed
    • Few people read code
  • Correctness must come first
    • Other considerations are postponed
    • We don’t explicitly learn other qualities


8
Clarity induces correctness
  • Clear
    • Simple
    • Readable
    • Concise
    • Consistent
  • Correct
  • Efficient
    • Small
    • Quick


  • Secure
  • Testable
  • Portable
  • Maintainable
  • Interoperable
  • Compatible
  • Reliable
9
Scenario
  • Game
    • Find the min and max values in a vector of high scores.  If someone beats the min score, they enter the champion’s circle.  If they beat the max score, they become the reigning champion.
  • Business application
    • In order to make a graph, find the min and max values so that all values fit on the graph.
10
Programmers work together
  • Two programmers
  • One solution
11
Not like this
12
Programmers work together
  • Driver of pair programming team
    • Controls keyboard and mouse
    • Enters the code
    • Explains the reasoning to enable discussion
    • Responds constructively to feedback
  • Navigator of pair programming team
    • Keeps a big picture strategic view
    • Watches and alerts the driver of problems
    • Thinks of alternatives and looks up resources
    • Asks questions
13
Not like this
14
Code is often read and re-written
  • Four versions from internet
    • For/while
    • Count up/down
    • Single/multiple function
    • Commented/uncommented
  • Reuse the best parts to create a new version


15
Clarity induces correctness
  • Before
    • Unclear
    • Inconsistent
    • Buggy
  • After
    • Clear
    • Consistent
    • Correct
16
Instructions
  • Draw a card, find your partner and computer
  • Read and understand the code together
  • Pick a base version
  • Work together as driver and navigator
  • Copy files and start a CodeWarrior project
  • Clean it up first and rewrite it as myHiLo
  • Make the tests pass
  • Demonstrate your work