(Ebook) A Philosophy of Software Design by Ousterhout, John K ISBN 9781732102200, 1732102201 download pdf
(Ebook) A Philosophy of Software Design by Ousterhout, John K ISBN 9781732102200, 1732102201 download pdf
(Ebook) A Philosophy of Software Design by Ousterhout, John K ISBN 9781732102200, 1732102201 download pdf
com
https://ebooknice.com/product/a-philosophy-of-software-
design-11917402
DOWLOAD EBOOK
https://ebooknice.com/product/a-philosophy-of-software-design-2nd-
edition-58580286
ebooknice.com
ebooknice.com
ebooknice.com
https://ebooknice.com/product/sat-ii-success-
math-1c-and-2c-2002-peterson-s-sat-ii-success-1722018
ebooknice.com
(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master
the SAT Subject Test: Math Levels 1 & 2) by Arco ISBN
9780768923049, 0768923042
https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-
arco-master-the-sat-subject-test-math-levels-1-2-2326094
ebooknice.com
ebooknice.com
https://ebooknice.com/product/studies-in-philosophy-and-the-history-
of-philosophy-50710556
ebooknice.com
ebooknice.com
https://ebooknice.com/product/tcl-and-the-tk-toolkit-18481028
ebooknice.com
A Philosophy of Software
Design
John Ousterhout
Stanford University
A Philosophy of Software Design
by John Ousterhout
Printing History:
April 2018: First Edition (v1.0)
November 2018: First Edition (v1.01)
ISBN 978-1-7321022-0-0
Preface
1 Introduction
1.1 How to use this book
11 Design it Twice
13 Comments Should Describe Things that Aren’t Obvious from the Code
13.1 Pick conventions
13.2 Don’t repeat the code
13.3 Lower-level comments add precision
13.4 Higher-level comments enhance intuition
13.5 Interface documentation
13.6 Implementation comments: what and why, not how
13.7 Cross-module design decisions
13.8 Conclusion
13.9 Answers to questions from Section 13.5
14 Choosing Names
14.1 Example: bad names cause bugs
14.2 Create an image
14.3 Names should be precise
14.4 Use names consistently
14.5 A different opinion: Go style guide
14.6 Conclusion
17 Consistency
17.1 Examples of consistency
17.2 Ensuring consistency
17.3 Taking it too far
17.4 Conclusion
19 Software Trends
19.1 Object-oriented programming and inheritance
19.2 Agile development
19.3 Unit tests
19.4 Test-driven development
19.5 Design patterns
19.6 Getters and setters
19.7 Conclusion
21 Conclusion
Index
Summary of Design Principles
People have been writing programs for electronic computers for more than
80 years, but there has been surprisingly little conversation about how to
design those programs or what good programs should look like. There has
been considerable discussion about software development processes such as
agile development and about development tools such as debuggers, version
control systems, and test coverage tools. There has also been extensive
analysis of programming techniques such as object-oriented programming
and functional programming, and of design patterns and algorithms. All of
these discussions have been valuable, but the core problem of software
design is still largely untouched. David Parnas’ classic paper “On the
Criteria to be used in Decomposing Systems into Modules” appeared in
1971, but the state of the art in software design has not progressed much
beyond that paper in the ensuing 45 years.
The most fundamental problem in computer science is problem
decomposition: how to take a complex problem and divide it up into pieces
that can be solved independently. Problem decomposition is the central
design task that programmers face every day, and yet, other than the work
described here, I have not been able to identify a single class in any
university where problem decomposition is a central topic. We teach for
loops and object-oriented programming, but not software design.
In addition, there is a huge variation in quality and productivity among
programmers, but we have made little attempt to understand what makes the
best programmers so much better or to teach those skills in our classes. I
have talked with several people I consider to be great programmers, but
most of them had difficulty articulating specific techniques that give them
their advantage. Many people assume that software design skill is an innate
talent that cannot be taught. However, there is quite a bit of scientific
evidence that outstanding performance in many fields is related more to
high-quality practice than innate ability (see, for example, Talent is
Overrated by Geoff Colvin).
For many years these issues have perplexed and frustrated me. I have
wondered whether software design can be taught, and I have hypothesized
that design skill is what separates great programmers from average ones. I
finally decided that the only way to answer these questions was to attempt to
teach a course on software design. The result is CS 190 at Stanford
University. In this class I put forth a set of principles of software design.
Students then work through a series of projects to assimilate and practice
the principles. The class is taught in a fashion similar to a traditional
English writing class. In an English class, students use an iterative process
where they write a draft, get feedback, and then rewrite to make
improvements. In CS 190, students develop a substantial piece of software
from scratch. We then go through extensive code reviews to identify design
problems, and students revise their projects to fix the problems. This allows
students to see how their code can be improved by applying design
principles.
I have now taught the software design class three times, and this book is
based on the design principles that emerged from the class. The principles
are fairly high level and border on the philosophical (“Define errors out of
existence”), so it is hard for students to understand the ideas in the abstract.
Students learn best by writing code, making mistakes, and then seeing how
their mistakes and the subsequent fixes relate to the principles.
At this point you may well be wondering: what makes me think I know
all the answers about software design? To be honest, I don’t. There were no
classes on software design when I learned to program, and I never had a
mentor to teach me design principles. At the time I learned to program,
code reviews were virtually nonexistent. My ideas about software design
come from personal experience writing and reading code. Over my career I
have written about 250,000 lines of code in a variety of languages. I’ve
worked on teams that created three operating systems from scratch, multiple
file and storage systems, infrastructure tools such as debuggers, build
systems, and GUI toolkits, a scripting language, and interactive editors for
text, drawings, presentations, and integrated circuits. Along the way I’ve
experienced firsthand the problems of large systems and experimented with
various design techniques. In addition, I’ve read a considerable amount of
code written by other people, which has exposed me to a variety of
approaches, both good and bad.
Out of all of this experience, I’ve tried to extract common threads, both
about mistakes to avoid and techniques to use. This book is a reflection of
my experiences: every problem described here is one that I have
experienced personally, and every suggested technique is one that I have
used successfully in my own coding.
I don’t expect this book to be the final word on software design; I’m
sure there are valuable techniques that I’ve missed, and some of my
suggestions may turn out to be bad ideas in the long run. However, I hope
that the book will start a conversation about software design. Compare the
ideas in this book with your own experiences and decide for yourself
whether the approaches described here really do reduce software
complexity. This book is an opinion piece, so some readers will disagree
with some of my suggestions. If you do disagree, try to understand why. I’m
interested in hearing about things that work for you, things that don’t work,
and any other ideas you may have about software design. I hope that the
ensuing conversations will improve our collective understanding of software
design. I will incorporate what I learn in future editions of this book.
The best way to communicate with me about the book is to send email
to the following address:
I’m interested in hearing specific feedback about the book, such as bugs or
suggestions for improvement, as well as general thoughts and experiences
related to software design. I’m particularly interested in compelling
examples that I can use in future editions of the book. The best examples
illustrate an important design principle and are simple enough to explain in
a paragraph or two. If you would like to see what other people are saying on
the email address and participate in discussions, you can join the Google
Group software-design-book.
If for some reason the software-design-book Google Group should
disappear in the future, search on the Web for my home page; it will contain
updated instructions for how to communicate about the book. Please don’t
send book-related email to my personal email address.
I recommend that you take the suggestions in this book with a grain of
salt. The overall goal is to reduce complexity; this is more important than
any particular principle or idea you read here. If you try an idea from this
book and find that it doesn’t actually reduce complexity, then don’t feel
obligated to keep using it (but, do let me know about your experience; I’d
like to get feedback on what works and what doesn’t).
Many people have offered criticisms or made suggestions that improved
the quality of the book. The following people offered helpful comments on
various drafts of the book: Jeff Dean, Sanjay Ghemawat, John Hartman,
Brian Kernighan, James Koppel, Amy Ousterhout, Kay Ousterhout, Rob
Pike, Partha Ranganathan, Keith Schwartz, and Alex Snaps. Christos
Kozyrakis suggested the terms “deep” and “shallow” for classes and
interfaces, replacing previous terms “thick” and “thin”, which were
somewhat ambiguous. I am indebted to the students in CS 190; the process
of reading their code and discussing it with them has helped to crystallize
my thoughts about design.
Chapter 1
Introduction
(It’s All About Complexity)
Figure 2.1: Each page in a Web site displays a colored banner. In (a) the background color
for the banner is specified explicitly in each page. In (b) a shared variable holds the
background color and each page references that variable. In (c) some pages display an
additional color for emphasis, which is a darker shade of the banner background color; if
the background color changes, the emphasis color must also change.
Unknown unknowns: The third symptom of complexity is that it is not
obvious which pieces of code must be modified to complete a task, or what
information a developer must have to carry out the task successfully. Figure
2.1(c) illustrates this problem. The Web site uses a central variable to
determine the banner background color, so it appears to be easy to change.
However, a few Web pages use a darker shade of the background color for
emphasis, and that darker color is specified explicitly in the individual
pages. If the background color changes, then the the emphasis color must
change to match. Unfortunately, developers are unlikely to realize this, so
they may change the central bannerBg variable without updating the
emphasis color. Even if a developer is aware of the problem, it won’t be
obvious which pages use the emphasis color, so the developer may have to
search every page in the Web site.
Of the three manifestations of complexity, unknown unknowns are the
worst. An unknown unknown means that there is something you need to
know, but there is no way for you to find out what it is, or even whether
there is an issue. You won’t find out about it until bugs appear after you
make a change. Change amplification is annoying, but as long as it is clear
which code needs to be modified, the system will work once the change has
been completed. Similarly, a high cognitive load will increase the cost of a
change, but if it is clear which information to read, the change is still likely
to be correct. With unknown unknowns, it is unclear what to do or whether
a proposed solution will even work. The only way to be certain is to read
every line of code in the system, which is impossible for systems of any
size. Even this may not be sufficient, because a change may depend on a
subtle design decision that was never documented.
One of the most important goals of good design is for a system to be
obvious. This is the opposite of high cognitive load and unknown
unknowns. In an obvious system, a developer can quickly understand how
the existing code works and what is required to make a change. An obvious
system is one where a developer can make a quick guess about what to do,
without thinking very hard, and yet be confident that the guess is correct.
Chapter 18 discusses techniques for making code more obvious.
2.3 Causes of complexity
Now that you know the high-level symptoms of complexity and why
complexity makes software development difficult, the next step is to
understand what causes complexity, so that we can design systems to avoid
the problems. Complexity is caused by two things: dependencies and
obscurity. This section discusses these factors at a high level; subsequent
chapters will discuss how they relate to lower-level design decisions.
For the purposes of this book, a dependency exists when a given piece
of code cannot be understood and modified in isolation; the code relates in
some way to other code, and the other code must be considered and/or
modified if the given code is changed. In the Web site example of Figure
2.1(a), the background color creates dependencies between all of the pages.
All of the pages need to have the same background, so if the background is
changed for one page, then it must be changed for all of them. Another
example of dependencies occurs in network protocols. Typically there is
separate code for the sender and receiver for the protocol, but they must
each conform to the protocol; changing the code for the sender almost
always requires corresponding changes at the receiver, and vice versa. The
signature of a method creates a dependency between the implementation of
that method and the code that invokes it: if a new parameter is added to a
method, all of the invocations of that method must be modified to specify
that parameter.
Dependencies are a fundamental part of software and can’t be
completely eliminated. In fact, we intentionally introduce dependencies as
part of the software design process. Every time you write a new class you
create dependencies around the API for that class. However, one of the
goals of software design is to reduce the number of dependencies and to
make the dependencies that remain as simple and obvious as possible.
Consider the Web site example. In the old Web site with the background
specified separately on each page, all of the Web pages were dependent on
each other. The new Web site fixed this problem by specifying the
background color in a central place and providing an API that individual
pages use to retrieve that color when they are rendered. The new Web site
eliminated the dependency between the pages, but it created a new
dependency around the API for retrieving the background color.
Fortunately, the new dependency is more obvious: it is clear that each
individual Web page depends on the bannerBg color, and a developer can
easily find all the places where the variable is used by searching for its
name. Furthermore, compilers help to manage API dependencies: if the
name of the shared variable changes, compilation errors will occur in any
code that still uses the old name. The new Web site replaced a nonobvious
and difficult-to-manage dependency with a simpler and more obvious one.
The second cause of complexity is obscurity. Obscurity occurs when
important information is not obvious. A simple example is a variable name
that is so generic that it doesn’t carry much useful information (e.g., time).
Or, the documentation for a variable might not specify its units, so the only
way to find out is to scan code for places where the variable is used.
Obscurity is often associated with dependencies, where it is not obvious that
a dependency exists. For example, if a new error status is added to a system,
it may be necessary to add an entry to a table holding string messages for
each status, but the existence of the message table might not be obvious to a
programmer looking at the status declaration. Inconsistency is also a major
contributor to obscurity: if the same variable name is used for two different
purposes, it won’t be obvious to developer which of these purposes a
particular variable serves.
In many cases, obscurity comes about because of inadequate
documentation; Chapter 13 deals with this topic. However, obscurity is also
a design issue. If a system has a clean and obvious design, then it will need
less documentation. The need for extensive documentation is often a red
flag that the design isn’t quite right. The best way to reduce obscurity is by
simplifying the system design.
Together, dependencies and obscurity account for the three
manifestations of complexity described in Section 2.2. Dependencies lead to
change amplification and a high cognitive load. Obscurity creates unknown
unknowns, and also contributes to cognitive load. If we can find design
techniques that minimize dependencies and obscurity, then we can reduce
the complexity of software.
2.4 Complexity is incremental
Complexity isn’t caused by a single catastrophic error; it accumulates in lots
of small chunks. A single dependency or obscurity, by itself, is unlikely to
affect significantly the maintainability of a software system. Complexity
comes about because hundreds or thousands of small dependencies and
obscurities build up over time. Eventually, there are so many of these small
issues that every possible change to the system is affected by several of
them.
The incremental nature of complexity makes it hard to control. It’s easy
to convince yourself that a little bit of complexity introduced by your
current change is no big deal. However, if every developer takes this
approach for every change, complexity accumulates rapidly. Once
complexity has accumulated, it is hard to eliminate, since fixing a single
dependency or obscurity will not, by itself, make a big difference. In order
to slow the growth of complexity, you must adopt a “zero tolerance”
philosophy, as discussed in Chapter 3.
2.5 Conclusion
Complexity comes from an accumulation of dependencies and obscurities.
As complexity increases, it leads to change amplification, a high cognitive
load, and unknown unknowns. As a result, it takes more code modifications
to implement each new feature. In addition, developers spend more time
acquiring enough information to make the change safely and, in the worst
case, they can’t even find all the information they need. The bottom line is
that complexity makes it difficult and risky to modify an existing code base.
Chapter 3
The sky was washed the clear blue of late November the next
morning, and Hazel could count the few little white clouds floating on
it as she walked to church. The cold, fresh air quickened her blood
and made her want to skip and dance, but she stayed demurely at
her mother’s side. They soon left their dingy street and turned into a
well-to-do neighborhood where white people lived, and then went on
with the white people into a large church. The usher nodded
pleasantly to them, and they took a pew to the left, half way up the
aisle. Here they sat in silence while the organ played its solemn,
spiritual music.
As she listened to the music the anxious look, that was usually
present, left Mrs. Tyler’s face. This was her dear and holy place
where her mother and her mother’s mother had worshipped. As a
little girl she had known its first minister—the noble, courageous
citizen who had never failed to plead for the freedom of the slave.
After her marriage with her southern husband she had gone a few
times to listen to the big-hearted oratory at the colored church; but
the service there did not touch her spirit, and she and her husband
had agreed on Sunday mornings to worship in different places the
same Heavenly Father. Hazel had always accompanied her mother,
and she was quite at home among the white people. More than one
greeted her with a smile.
“My heart is resting, oh, my God,
My heart is in Thy care,”
sang the congregation.
Hazel loved this hymn. She joined in the singing with her clear child’s
voice. She always loved the hymns, and she even loved the sermon,
for was not the minister her dear friend? When the sermon was
finished there was the five cents to be dropped into the contribution
plate, and there was the beautiful benediction at the end of the
service asking that the peace of God abide in her heart. “Amen,”
sang the choir, and the organ pealed that the service was over.
“How do you do, Hazel?” the lady behind her asked. “She seems a
little peaked, doesn’t she?” addressing the mother.
The anxious look returned to Mrs. Tyler’s face. “She hasn’t been very
well,” she answered.
“Keep her in the fresh air as much as you can, though I know that
that is difficult to do in cold weather.”
“How do you do, Hazel?” “How do you do, Mrs. Tyler?” came from
many sides as the two walked from the church into the street.
Their Sunday dinner was to be eaten with their old friends, the
Perkins, who lived in Jamaica Plains. As their car stopped, Hazel
fairly raced down the street where she had spent her life until her
father’s death, and turned up the steps of a pleasant cottage, and
almost into the arms of a big, smiling black man. He carried her off at
once, leaving Mrs. Tyler to be ministered to by his young, bright-
faced wife. The two visitors were evidently at home.
The dinner was a lavish one, beginning with turkey and ending with
ice-cream. Mr. Perkins heaped Hazel’s plate, urging her to eat. But
though these were her favorite dishes her appetite was small. He
encouraged her to tell him of her doings, of how well she ranked at
school. “Right at the top, Hazel; you know you are going to college.”
He asked how she liked the new story he had given her, “The Jungle
Book.” After dinner was over he took her to his study across the hall
from the parlor where the two women sat.
“How Henry loves children,” Mrs. Tyler said to her friend. Mrs.
Perkins nodded. Behind where she sat, was the picture of the only
child born to her and her husband, the child whom they had lost five
years ago. She knew how his hungry heart went out to this little girl.
Mrs. Tyler faced the picture. She had loved the child and mothered
her. A lump rose in her throat.
“Sarah,” she said, laying her hand on her friend’s arm, “I’ve got to
talk with you about Hazel. I’m worried, I’m worried.”
“Hazel, why hasn’t she been well?”
“No, all this autumn she has seemed so delicate. She takes cold
easily and she doesn’t throw it off. I fear the long winter for her.”
“I wish you hadn’t left Jamaica Plains.”
“I had to. I mustn’t spend the little money left me. I must work and
save. Hazel will need more every year. But I don’t want to save just
for doctor’s bills. Sometimes, Sarah, she frightens me. She looks as
her father looked——”
Mrs. Tyler stopped. She could not yet speak of her husband’s long
illness and of the blank left by his death.
“I’m not saying this just to complain,” she went on after a moment.
“I’ve a wild idea that I can’t keep out of my head.”
“What is it, Lucy?”
“It’s to send Hazel for the winter to her grandmother Tyler’s.”
“To Alabama? Oh, Lucy, how could you! It’s so far away.”
“I know, but it’s a home in a beautiful place where she could be out-
of-doors all day long. My husband used to tell me about the good
times he had as a boy among the pines with plenty of space around
him. He, like Hazel, would have hated to have been shut up in three
rooms.”
“But it’s in the South,” Mrs. Perkins said earnestly. “We don’t know
the South, Lucy, but I fear it with its jim-crow cars and its lynchings.”
“Don’t,” gasped Mrs. Tyler. Then, after a little, she laughed. “There
are thousands and tens of thousands of colored children who grow
up there in safety. Hazel will be under good care. Her grandmother
will have more time to give to her than I.”
“Has she written for Hazel?”
“Not recently, but I know she would welcome her. She is alone just
now, but she is always mothering some child. She will love Hazel, for
Hazel is like her father in many ways. Perhaps living with her
grandmother, she will learn to be still more like him. I cannot bear the
thought of having her leave me, but I know that if she goes she will
be in good hands.”
A tremendous noise issued from the room across the hall, and Hazel
popped out her head to call, “He’s Shere Khan, a tiger of the jungle,
and I’m Mowgli.”
“Come here and let me eat you, Little Frog,” called out the tiger, and
made a hideous sound between a snarl and roar.
“It’s Sunday, Henry. Don’t make so much noise,” said his wife.
“Don’t make so much noise, Shere Khan,” said Mowgli, and
fearlessly shut herself up with the tiger in the jungle.
Through the door the two women heard the little girl cough.
“How could you get the child South?” Mrs. Perkins asked.
Granny
“Why, oddly enough, one of my neighbors, Mrs. Graham, is going
South in two or three weeks. She lives at Montgomery, only a couple
of hours by train from Mother Tyler’s home. She is a kindly, sensible
soul whom Hazel likes. I can trust the child with her. I dread it,
Sarah,” and Mrs. Tyler clasped her hands tightly together, “I dread it
inexpressibly, but I dread her staying here more.”
“Couldn’t you go with her?”
“That would be impossible. What could I do there to earn money? I
must stay at home and work. I’ve plans for building up a good
business. I feel sure that I can, but it will take time. Perhaps I shall
succeed more quickly if I put all my energy into my work. And then
Hazel will return in the spring, for it wouldn’t be good for her to stay
through a southern summer. If I am busy every minute I’m hoping
that the time won’t seem so long. It will pass quickly if I hear that
Hazel gains in health.”
“Who’s talking about health?” asked Mr. Perkins, as he came out of
his room with Hazel at his side.
“I am,” replied Mrs. Tyler.
“You remember Emerson: ‘Give me health and a day and I will make
the pomp of emperors ridiculous.’ Lucy, may I take this young lady
out for a walk?”
“Surely, Henry.”
Hazel put on her hat and coat and raced off with her boon
companion.
“She will need a warmer coat,” Mrs. Tyler said, and her brow
puckered. “If she stays here she must have warm clothes and even
then I shall have sometimes to keep her indoors. She was restless
yesterday and naughty, and that isn’t like Hazel. Health. That is more
than anything else in the world, isn’t it? What shall I do, Sarah?”
Her friend had risen and was looking at the picture of her little child.
“I can only say this Lucy,” she at length answered. “You will never
cease to reproach yourself if anything happens and you haven’t
done everything possible for Hazel. If a winter in the South will mean
health for her, then if she is ill you will always regret that you did not
send her away.”
“People are ill in the South,” said Mrs. Tyler, wanting to contradict the
advice she sought.
“Of course. But you will have done all you could.”
Mrs. Tyler looked hard at the floor, for a minute. When she raised her
eyes to her friend’s they were full of tears.
“It won’t really be living while she’s away,” she said; “but I’ll write to
mother Tyler to-night.”
CHAPTER III
LEAVE TAKING
When Hazel first learned that she was to go away from her mother,
she cried bitterly. But as the preparations for her departure began,
she regained her spirits. Who could grieve for long in the midst of
such excitement?
In the first place, there was the new trunk, very small and shining.
“Look at it, Charity,” she said, the afternoon it came home “See my
initials on the side, H. T. That stands for Hazel Tyler.”
Charity looked, and envy entered her heart. When she visited her
granny in Virginia her clothes were stuffed into a shabby, collapsible
bag.
“Folks ’ll think you stuck up,” she said.
“Well, let them,” answered Hazel. “This is a steamer trunk, Charity,”
she went on, opening it, “see the cunning tray. When it’s shut you
push it under your berth on the steamer. I’m going to have a warm
shawl in it to wear on deck.”
“Bet you’ll be sick,” said Charity.
Nevertheless, she was deeply impressed with the little trunk, and
watched Hazel as day after day she packed and repacked it.
“I’m putting all my clothes in the bottom, Charity. Mother says for me
to take my summer and my winter clothes both. Here is my blue
gingham, and Mother has let down my white muslin dress again.
Isn’t it pretty with the lace and embroidery?”
Charity sniffed. “Bet you won’t wear your white dress. Folks wear
calico down there. Who’s going to spend the time washing and
ironing for you?”
Hazel looked a little troubled. “Why, Granny, I suppose.”
“Humph, your Granny ’ll be too busy to wait on you.”
Hazel patted the white dress better in place. “I can keep it clean
quite a while,” she said.
“See, Charity, the pretty present Mrs. Perkins gave me,” she said
later, taking a dainty box from the tray and opening it. “Six
handkerchiefs and each marked with an ‘H.’ Nobody can take them,
can they, because the ‘H’ shows they belong to me.”
Charity deliberately took one from the box. “Guess I’ve got one now,”
she declared.
But while she refused to show enthusiasm regarding Hazel’s
preparations she was really greatly interested and appeared one day
with something, new to Hazel, in her hand.
“It’s a sun-bonnet,” she explained, holding it out. “Everyone wears
them down there; the sun is so hot. Mother and I made it for you.”
“Oh, it’s such a pretty pink,” cried Hazel, turning it about on her hand.
“Thank you and your mother so much, Charity,” and she kissed her
companion.
Charity’s eyes shone. “Put it on,” she commanded.
The brown face with the soft hair looked very attractive set in the
pink muslin frill. Hazel viewed herself in the glass and jumped up and
down with pleasure.
“It’s like a play to be wearing a sun-bonnet.”
“Take it off and I’ll show you how to pack it.” And together they put it
in the tray.
“I’ve another present, Charity,” Hazel confided, taking out a small
package, and showing a long, black hair-ribbon. “It’s from Miss Gray,
my teacher. Mother says I must count these presents for Christmas,
because I’ll be away at Christmas. Perhaps I’ll put them in my
stocking Christmas eve.”
“Pooh! Folks don’t hang up stockings South.”
“Why, Charity, you’d think they didn’t do anything down there.”
Charity cogitated. “They don’t do much,” she decided, and added a
little wistfully, “it’s lots more fun on Hammond Street.”
Hazel slipped her hand in her friend’s. “I wish you were going with
me,” she whispered.
“I wish you weren’t going away,” Charity whispered back.
Hazel and her mother had a long discussion regarding a suitable
present to take to Granny. Hazel wanted to buy a black and white
gingham dress she saw at Jordan, Marsh’s; but did Granny wear a
thirty-six like her mother, or a forty-four, like Charity’s mamma? Such
uncertainty made the dress impracticable. A pretty black and white
kitten strayed into the Tyler flat and when Hazel had fed it, and
become attached to it, she felt that it would be a better present even
than the dress. No arguments concerning the difficulty of carrying a
kitten to Alabama could make her forsake her plan; only when her
mother asked that it be left to keep her company did Hazel at once
give it up.
“Yes, do keep it, Mother dear,” she said.
But still Granny’s present was unsettled. Mrs. Perkins unconsciously
determined what it should be.
“Lucy,” she said, one day, “here is a card that entitles you to six
photographs. You have a good picture of Hazel, but she has none of
you. Please have them taken immediately and give the child one.”
“Yes, and give one to Granny,” Hazel said. And although Mrs. Tyler
protested, Granny’s present, carefully packed in many rolls of tissue
paper, was her daughter-in-law’s picture tastefully framed.
Hazel could not decide, even to the day of departure, whether she
should give it to Granny on her arrival or should wait until Christmas.
One day her minister climbed the tenement stairs and called upon
her and her mother. The trunk was in the parlor and he examined
with deep interest the contents that Hazel showed him. Especially he
admired the pink sun-bonnet.
“You must wear it to church next summer,” he said. “Only I should
look at it so much I might forget to preach my sermon.”
He encouraged Mrs. Tyler in what she was doing. “It will be the
making of the child,” he assured her. “I’ve lived a little in that country
and I know how healthful it is.”
At parting he placed a package shaped like a book in Hazel’s hands.
“This is for Christmas,” he said; and taking a pencil from his pocket,
he wrote in big letters, “Not to be opened until Christmas.”
Hazel gave him a kiss, and holding the book declared, “I will keep it
sacredly until Christmas.”
She walked down the stairs with him. “You’ll take good care of my
mother at the church, won’t you?” she asked, squeezing his hand,
“She works so hard. She says she’s saving to send me to college,
and now I’ll lose a whole year at school. It troubles me.”
“Why, it mustn’t trouble you, little girl,” said the minister. They
reached the street and he looked down at her anxious face. “We will
look after your mother. The ladies will see that she gets work. That is
the only way that we can help her, for she will take nothing that she
does not earn.”
Then he raised his hat and bade the child good-bye.
It was nearing the time of departure—Thursday, and the ship sailed
Saturday. The trunk was packed for the last time, with Mrs. Tyler’s
gifts, a box of writing-paper and a dictionary, on top.
“I hope you will write me a little every day, Hazel,” her mother said.
“It will be good practice for you. Mail the letters once or twice a week,
but write a little every day.”
“It will be like a diary,” said Hazel.
“Yes, dear.”
“And you’ll write often to me, Mother, won’t you?”
“I’ll write often, but you will write without waiting for an answer. That
will be your gift to me.”
The days were so full that Hazel had not much time to think of the
Southland to which she was going; but at odd minutes she
questioned what it might be like. She had traveled no further from
Boston than neighboring seashore resorts, and until her father’s
death she had seen little of any but refined people, white or colored.
“Charity,” she said, Friday night, “I’ve been saying good-bye to the
McGinnis’s baby. He is so dear and dimpled and rosy. Are there
many white babies South?”
“Sure,” answered Charity. “But don’t you have nothing to do with
white folks. There’s two kinds of white folks down there: those that
hates you and those that calls you ‘a cute little nigger.’ My mother
says that ain’t so, for she knows the first families of Virginia, but I
ain’t acquainted with ’em.”
“My father used to tell about white people near his home who were
nice,” said Hazel reflectively.
“Poor white trash, I guess. There ain’t any first families in Alabama.”
That night, before they went to bed, Hazel questioned her mother
about the white folks.
“Won’t they like me?” she said. “Will they call out ‘Nigger,’ the way
the boys on Shawmut Avenue do to Charity?”
“I don’t know, dear, I don’t know. Granny can help you about that, not
I. But I would not bother with them, Hazel. They go their way and you
go yours. On the steamer, in the train, at the church and at school—
everywhere you will be separated. Their world will not be your world.
Leave them alone.”
“I will remember,” Hazel said softly.
The kind world that she had known seemed slipping away from her.
She held her mother’s hand tight.
“I will be with the colored people,” she said, “and I will love Granny.”
“And when night comes, Hazel, remember we shall both be saying
our prayers to the same Father in Heaven. I shall ask him to bless
you.”
“And I to bless you, Mother dear.”
“And when I look at the stars at night I shall know that the same stars
shine on you, only you will see the huge heavens and I shall only
see a piece from my city window.”
“And the stars shine on Father, too,” said Hazel. “I think he sees the
stars.”
With this thought she went to bed and, after a little, fell asleep, but
her mother lay awake the night long.
The last present came as they stood on the steamer. Mr. Perkins
brought it to her and demanded and received six hugs in thanks. It
was a soft woolen coat, blue outside and red within, finer than
anything Hazel had ever owned.
“It’s to keep your heart warm for your old friend,” Mr. Perkins said, as
he buttoned it about her. “Take very good care of her, Mrs. Graham;”
he spoke earnestly to the woman at Hazel’s side. “Don’t let her from
your sight.”
“I’ll be mighty careful,” Mrs. Graham answered.
Then the bell rang and visitors were ordered ashore.
Hazel gave her mother one more kiss. “I’ll be back soon,” she
whispered.
Mrs. Tyler did not try to answer; but her last look was at a shy, brave
little girl in a new blue coat, going out into an unknown, untried world.
CHAPTER IV
THE JOURNEY
Charity was right. The shawl did not come out of the trunk until the
ship had passed Cape Hatteras and the voyage was nearly at an
end. Poor Hazel lay in her upper berth, sick and wretched. When at
length she was able to dress and climb to the deck the rough
weather was over, and she saw a clear, blue sky and an expanse of
soft, tranquil water. She grew better at once, and ate her dinner with
an appetite.
The landing was wearying, and the long journey to Alabama in a
dirty, ill-ventilated car was inexpressibly tiring. The child grew
wretchedly weary, and a big lump rose in her throat when night came
on. She was homesick and uncomfortable. Instead of her pleasant
bed at home, there was only a hard seat on which to rest. Mrs.
Graham pillowed her as well as she could, but the sensitive child lay
awake the most of the night: for if she fell asleep from weariness, a
vicious jolt of the train shook her awake again. Early in the evening
their train stopped to wait until an express overtook it and passed on
ahead. Hazel saw the Pullman with its comfortable beds and its
brightly-lighted dining car where colored waiters were serving
delicious-looking food to white people.
“Why don’t we ride in a car like that?” she asked Mrs. Graham.
But she knew the answer before she heard it. “Colored people are
not allowed to in the South.”
All things come to an end, however, even a wakeful night. In the
morning Montgomery was reached, and at the station Hazel was met
by a kindly colored man who said that his name was Jenks and that
he was a friend of Granny’s. He was to look after Hazel and take her
to her grandmother’s home. So the little girl bade Mrs. Graham an
affectionate good-bye and went with her new companion.
Mr. Jenks lived in a quiet, country-like street, and Hazel picked out
his house before they reached it. It had roses growing by the
doorway, and a sweet-faced young woman, like her mother, stood on
the porch.
“You’re tired out, aren’t you, honey?” the young woman said, giving
Hazel a kiss. “You don’t travel again until late afternoon. Come in
and have breakfast, and then lie down and sleep.”
The biscuit and egg tasted delicious. To her hostess’s surprise Hazel
refused coffee. “My mother doesn’t want me to drink it until I am
grown up,” she explained; and instead she had a glass of milk.
Breakfast over, she gladly accepted the invitation to lie down in the
clean, white bed in the little room upstairs. How good it was to get
into a fresh night-gown and creep between the sheets! Her head
swam from the motion of the cars, but soon that stopped and she
was in the land of dreams.
She dreamed that her mother called, “Come, Hazel, it is time for
dinner,” and she answered, “Yes, I’m coming,” and tried to run from
the bedroom into the little kitchen; but she could not move. Again the
voice called her, and with a great effort she caught her mother’s
hand, and awoke to find that she was clutching Mrs. Jenks’ dress.
“You’ve slept a long while, dear,” her hostess said. “There’s only time
to wash and dress for dinner. Here is hot water I’ve brought for you.
You’ll feel better when you’ve had a bath.”
She washed and dressed, and was just fastening her collar when
there was a knock at her door. Opening it she found a little girl of
about six who shyly held out to her a bunch of roses.
“Are these for me?” Hazel asked.
The child nodded.
Hazel looked with astonishment at the flowers. They were like hot-
house roses. At home they would cost ten, fifteen cents apiece, so
much that you only looked at them in the florist’s window. You could
never afford to buy them, unless it were for a wedding or a funeral.
And she held all these lovely pink and white blossoms in her hand!
“Thank you so much,” she said to the child, who still remained
outside. Hazel went to the washstand and filling the glass she found
there with water, placed the roses in it. Then, viewing her treasures
with great pride, she took out one bud and pinned it to her dress.
It seemed very festive, like a party, to be wearing a pink rose. And
the dinner was festive, too, with more roses on the table and Mr. and
Mrs. Jenks and their two little daughters talking and laughing. Hazel
ate heartily of the chicken and sweet potato and guava jelly, the last
a gift from a friend in Florida and only put on the table at special
occasions. But this was a special occasion, for while Hazel was only
a little girl she was a visitor from the North, and from the North’s
best-loved city, Boston.
Dinner over, Hazel and the children played together, building towers
of blocks and destroying them only to build others. The time seemed
short when Mrs. Jenks called her to make ready to go to the train.
“My husband will take you all the way,” she said to Hazel, who rose
reluctantly from the floor. The child went to her room, took the roses
out of the water, dried their stems and tied them together with a bit of
thread from her traveling bag. They would be a comfort, she thought,
in the dirty train. Then putting on her hat and coat she went down
stairs.
It was hard to say good-bye to her new friends. The children clung to
her and Mrs. Jenks invited her to make them a visit when she
returned in the spring. “You haven’t been a bit of trouble,” she
answered in reply to Hazel’s thanks for her hospitality. “I wish I could
keep you over night.”
Hazel wished the same in her heart, but she only said good-bye
again and returned to the railroad station.
“Let me have your check,” Mr. Jenks said. “And have you the money
for your ticket?”
“Yes,” answered Hazel, and with a feeling of pride, she took the
money needed from her leather purse. The business of ticket and
trunk accomplished, the two took their seats in the car and were
soon moving out into the big world.
“It isn’t far now, is it?” asked Hazel when they had traveled for an
hour and a half.
“No,” her companion replied, “we shall soon be at the station; and
then we drive three miles to your grandmother’s.”
The station was reached at last, and when they got out Hazel met a
colored man whom Mr. Jenks called John, and whom he seemed to
know very well. John took the check for Hazel’s trunk, and placed
the luggage on the back of his wagon. Then giving the reins to Mr.
Jenks, he walked away.
“See you right soon,” he called.
“I’m to drive you. Jump in,” Mr. Jenks commanded, and Hazel
climbed to the seat by his side.
It was sunset. There was but one house near the station, and their
road led through a sparsely tenanted country. Slender pines stood in
the fields, and beyond the sky glowed golden. The air was clear and
fragrant, and Hazel found herself drinking in deep breaths. Suddenly
from the meadow came a bird’s note, long and sweet and plaintive.
Again and again the bird called.
“A meadow lark,” Mr. Jenks said.
The child pressed her hands together. She felt exquisitely sad, and
yet full of awe and wonder. The bird sang on and on from the
meadow, and when at length she left it behind, the sunset had
changed to red and the air was growing chill.
“Yes, I have a warm coat,” she said in answer to Mr. Jenks’ look, and
she buttoned the blue coat about her neck.
Fields and pines and pines and fields. The sunset light, purple now,
a single star shining in the west. Then a cabin by the road, and the
horse stopped.
Hazel trembled as Mr. Jenks lifted her down. The cabin door opened
and a tall, large woman came down the steps, put her arm about
Hazel and spoke to Mr. Jenks.
“You done brought my child,” she said. “Come in and rest yourself.”
“Not to-night,” Mr. Jenks answered. “I’m going back to John’s.”
He took the trunk from the wagon and placed it on the ground.
“Good-night, Hazel. Good-night, Aunt Ellen,” and turning his team,
he drove away.
The room that Hazel entered was lighted by a kerosene lamp and a
fire of logs that sent forth a rich, yellow flame. Her grandmother
helped the child take off her hat and coat, and then, sitting on a low
chair by the blaze, drew the little girl toward her.
“You favors your mother, honey,” she said, “but your eyes looks at
me like your father’s did. They’s dark and tired, now. You’s come
over the sea and over the land clear to your granny. Put your head
on my breast where your daddy rested when he was a baby.”
Hazel put her arms around the old woman’s neck and held her tight.
Little warm pulses of feeling swept through her. The pines, the
sunset, the bird’s note, and this loving welcome by the open fire, all
made her heart beat fast and her body shake. She was sobbing
before she knew it.
Granny understood what to do. She put the little girl in her chair, and
leaving her for a moment came back with a gray kitten, very small
and warm and helpless. Hazel ceased crying as she took it on her
lap and gently stroked its fur.
“Is it named?” she asked after a moment.
“No, honey; it’s been saving for you.”
“Then, please, I will call it Lucy after my mother.”
She stroked it tenderly and thought of the purring black and white
kitten in the kitchen at home.
“You has a sweet, loving mother, I know.”
“I’ve her picture for you.” And that settled the question of whether
Granny’s present should be kept until Christmas.
It was decided not to open the trunk until morning. A warm supper
was eaten before the fire, and then Granny declared that it was time
good little girls were in bed.
The room in which they sat seemed very large to Hazel. Granny’s
big bed was at one end, and the fire-place at the other. A door to the
left of the fire-place lead into Hazel’s bedroom, the one other room of
the house.
“Here your father used to sleep, honey,” Granny said, “and here you
rest to-night.”
But in this last statement Granny was mistaken. After Hazel had said
her prayers and had crept among the soft feathers a terrible feeling
of loneliness came over her. She heard her grandmother walking in
the other room, and then the light grew less and she knew the lamp
was out. Her door was open and she could see shadows on the wall
beyond.
“Granny,” she called. “Are you going to bed?”
“Yes, honey.”
“Could I have pussy Lucy with me?”
Her grandmother brought her the little kitten and placed it on the
pillow.
“Shut your eyes, honey, and the sand man will come.”
But the sand man refused to visit the little room. Granny went to bed,
and Hazel could hear no sound save the chirp of a late cricket
outside the open window. Out there were the heavens, where her
father had gone, filled with their myriad stars. Was her mother gazing
at them and thinking of her? She hugged the kitten, and looked for
comfort into the other room. It seemed to her, as she watched the
flickering shadows, that the light was growing less. Yes, the fire
would go out, and she would be left alone in darkness. Her heart
pounded and a strange terror possessed her. She did not yet know
this new home, and while she loved the light of the moon and the
stars, she hated blackness. If she should wake up alone, the fire
gone, only the black night about!
Her throat grew hot. Holding the kitten in one hand against her warm
neck and cheek, she left her bed and walked into Granny’s room.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebooknice.com