|
|
|
|
| Tutorial |
Making Your Code Easy to Read
To be able to understand text when reading, your brain must analyze the information
it receives from your eyes, identify the important parts, and then translate these parts
into correct order.Analysis is performed in two steps: physical analysis and logical
analysis. Physical analysis is performed first, by examining the visual structure of the
text; for example, paragraphs, rows, columns, and even spaces between words.This
process breaks up the perception of the text as a whole (for example, the sheet of
paper or the window on your desktop containing the text) into a tree-like structure of
smaller chunks. Assuming a top-down tree with the tree node at the top and leaves at
the bottom, the top of the tree contains the most generic information; for example,
the order of paragraphs that you have to read. At the bottom of the tree is something
like the order of words in a line, or even the order of characters in a word.
The logical analysis process takes this physical information, traverses the tree in order,
and tries to translate the information into a meaningful result.Whether this is a grammatical
translation (what structure does the sentence have?) or a contextual translation
(what does the sentence mean?) doesn’t matter for this discussion; the important thing
is that the better the results of the physical analysis, the easier, faster, and better the
results of the logical analysis.
Logical analysis can compensate for missing information from physical analysis, but
only to a limited extent.
Asanexampletakethissentenceifyoucanreadityourlogicalanalyzerworksverywell.
You probably can read the preceding sentence, but it takes much longer and requires
much more concentration than the rest of the sentences in this book. Important information
is missing (the spaces) for the first step in analysis, and you’re not used to that.
We could make it easier by adding a bit of punctuation:
Asanexample, takethissentence--ifyoucanreadit, yourlogicalanalyzerworksverywell.
The punctuation is useful information for your physical analyzer. Notice that it’s much
easier to read this version, as well as to refocus at any point of your choice.On to the
next step:
|
|
|
|
|
|
| Link Partners: Asia florist, Flowers to India, Hong kong flowers, Site submit, Cheap web hosting, China florist, Japan florist |
|