Send
Close Add comments:
(status displays here)
Got it! This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
Abstraction and psychological chunking
1. Abstraction and psychological chunking
2. Abstraction
Abstraction is looking at similarities and ignoring differences.
Abstraction, the ability to recognize patterns and see similarities and differences, and handle them appropriately, is a key to higher level intelligence.
Software is intellectual property.
For more information, see
Abstraction .
3. Psychological chunking
Part of the process involves what Hofstadter calls psychological chunking Hofstadter, D. (1979).
Goedel, Escher, Bach: An eternal golden braid. New York: Vintage Books., p. 285-287. . Hofstadter relates how Adriaan de Groot performed studies of expert and novice chess players in the 1940's.
Briefly, each was given a small amount of time to look at a chess board with chess pieces and then asked to reconstruct what they saw.
On board positions where pieces were placed such that they had realistic strategic meaning in a chess game, the beginners tended to make mistakes at random while the experts tended to place entire groups of pieces incorrectly, but with a somewhat similar strategic positioning.
On the other hand, when the pieces were placed at random, the experts were found to be no better than beginners at reconstructing the board.
One conclusion is that while the expert and the beginner see the same board, the expert chunks the information into a meaningful context. As such, the expert does not see bad moves.
4. Musical analogy, etc.
One would postulate that professional musicians can chunk entire phrases of music at a time, while beginning musicians may be stuck with one note at a time. And so on in other areas.
5. Programming language style
This same phenomena occurs in programming language notation. While the beginning programmer tends to be confused by rules of syntax, the experienced programmer is more concerned with semantics and can often, at a glance, take in an entire page of programming text, so long as it adheres to familiar guidelines of making us of white space such as blank lines and consistent indentation to reduce visual noise.
Just like the expert chess player and the expert musician, the expert programmer simply does not see bad program syntax, greatly simplifying the task of programming.
6. Indentation rules
every left brace, indent the following lines one tab stop.
On every right brace, undent the following lines one tab stop
If you mix tabs and spaces, what looks good to you may not look good in other editors.
7. Good style
main ... {
while ... {
if {
}
}
}
8. Bad style
main ... {
while ... {
if {
}
}
}
9. Grouping and chunking parts of a program
Blank lines can be used to group parts of code that logically go together.
Do not use more than one blank line. It uses more rows on the valuable screen space and does not help much for chunking.
10. Consistent style
Use a visually consistent style.
Consistent declarations - say before initializations and not interspersed in the code.
General rule: Do similar things in the same way.
11. End of page
12. Multiple choice questions for this page
5 questions omitted (login required)