100% found this document useful (1 vote)
43 views65 pages

Programming Principles and Practice Using C 3rd Edition Stroustrup download

The document provides information about the book 'Programming Principles and Practice Using C++' by Bjarne Stroustrup, including links to download various editions and related titles. It emphasizes the importance of programming as a skill and outlines the book's structure, which is designed for beginners and those seeking a deeper understanding of programming principles. The content covers a wide range of topics essential for real-world programming using C++.

Uploaded by

znwtcfq9230
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
43 views65 pages

Programming Principles and Practice Using C 3rd Edition Stroustrup download

The document provides information about the book 'Programming Principles and Practice Using C++' by Bjarne Stroustrup, including links to download various editions and related titles. It emphasizes the importance of programming as a skill and outlines the book's structure, which is designed for beginners and those seeking a deeper understanding of programming principles. The content covers a wide range of topics essential for real-world programming using C++.

Uploaded by

znwtcfq9230
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Programming Principles and Practice Using C 3rd

Edition Stroustrup download

https://textbookfull.com/product/programming-principles-and-
practice-using-c-3rd-edition-stroustrup/

Download full version ebook from https://textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

Programming: Principles and Practice Using C++ , Second


Edition Stroustrup

https://textbookfull.com/product/programming-principles-and-
practice-using-c-second-edition-stroustrup/

Programming Principles and Practice Using C Third


Edition Bjarne Stroustrup

https://textbookfull.com/product/programming-principles-and-
practice-using-c-third-edition-bjarne-stroustrup/

A Tour of C 3rd Edition Stroustrup B.

https://textbookfull.com/product/a-tour-of-c-3rd-edition-
stroustrup-b/

Tour of C A C In Depth Series 3rd Edition Stroustrup

https://textbookfull.com/product/tour-of-c-a-c-in-depth-
series-3rd-edition-stroustrup/
A Tour of C++ Stroustrup

https://textbookfull.com/product/a-tour-of-c-stroustrup/

A Tour of C++ Stroustrup

https://textbookfull.com/product/a-tour-of-c-stroustrup-2/

Introduction to Computation and Programming Using


Python 3rd Edition John V. Guttag

https://textbookfull.com/product/introduction-to-computation-and-
programming-using-python-3rd-edition-john-v-guttag/

Introduction to Computation and Programming Using


Python 3rd Edition John V. Guttag

https://textbookfull.com/product/introduction-to-computation-and-
programming-using-python-3rd-edition-john-v-guttag-2/

Principles and Practice of Radiation Oncology 7th


Edition Edward C. Halperin

https://textbookfull.com/product/principles-and-practice-of-
radiation-oncology-7th-edition-edward-c-halperin/
About This eBook
ePUB is an open, industry-standard format for eBooks.
However, support of ePUB and its many features varies
across reading devices and applications. Use your device or
app settings to customize the presentation to your liking.
Settings that you can customize often include font, font size,
single or double column, landscape or portrait mode, and
figures that you can click or tap to enlarge. For additional
information about the settings and features on your reading
device or app, visit the device manufacturer’s Web site.
Many titles include programming code or configuration
examples. To optimize the presentation of these elements,
view the eBook in single-column, landscape mode and
adjust the font size to the smallest setting. In addition to
presenting code and configurations in the reflowable text
format, we have included images of the code that mimic the
presentation found in the print book; therefore, where the
reflowable format may compromise the presentation of the
code listing, you will see a “Click here to view code image”
link. Click the link to view the print-fidelity code image. To
return to the previous page viewed, click the Back button on
your device or app.
Programming: Principles
and Practice Using C++

Third Edition

Bjarne Stroustrup

Hoboken, New Jersey


Cover photo by Photowood Inc./Corbis.
Author photo courtesy of Bjarne Stroustrup.
Page 294: “Promenade a Skagen” by Peder Severin Kroyer.
Page 308: Photo of NASA’s Ingenuity Mars Helicopter, The
National Aeronautics and Space Administration (NASA).
Page 354: Photo of Hurricane Rita as seen from space, The
National Oceanic and Atmospheric Administration (NOAA).

Many of the designations used by manufacturers and sellers


to distinguish their products are claimed as trademarks.
Where those designations appear in this book, and the
publisher was aware of a trademark claim, the designations
have been printed with initial capital letters or in all capitals.

The author and publisher have taken care in the preparation


of this book, but make no expressed or implied warranty of
any kind and assume no responsibility for errors or
omissions. No liability is assumed for incidental or
consequential damages in connection with or arising out of
the use of the information or programs contained herein.

For information about buying this title in bulk quantities, or


for special sales opportunities (which may include electronic
versions; custom cover designs; and content particular to
your business, training goals, marketing focus, or branding
interests), please contact our corporate sales department at
[email protected] or (800) 382-3419.

For government sales inquiries, please contact


[email protected].
For questions about sales outside the U.S., please contact
[email protected].

Visit us on the Web: informit.com/aw

Library of Congress Control Number: 2024932369

Copyright 2024 by Pearson Education, Inc.

All rights reserved. This publication is protected by


copyright, and permission must be obtained from the
publisher prior to any prohibited reproduction, storage in a
retrieval system, or transmission in any form or by any
means, electronic, mechanical, photocopying, recording, or
likewise. For information regarding permissions, request
forms and the appropriate contacts within the Pearson
Education Global Rights & Permissions Department, please
visit www.pearson.com/permissions.

This book was typeset in Times and Helvetica by the author.

ISBN-13: 978-0-13-830868-1
ISBN-10: 0-13-83086-3
First printing, May 2024
$PrintCode
Contents

Preface

0 Notes to the Reader


0.1 The structure of this book
0.2 A philosophy of teaching and learning
0.3 ISO standard C++
0.4 PPP support
0.5 Author biography
0.6 Bibliography

Part I: The Basics

1 Hello, World!
1.1 Programs
1.2 The classic first program
1.3 Compilation
1.4 Linking
1.5 Programming environments

2 Objects, Types, and Values


2.1 Input
2.2 Variables
2.3 Input and type
2.4 Operations and operators
2.5 Assignment and initialization
2.6 Names
2.7 Types and objects
2.8 Type safety
2.9 Conversions
2.10 Type deduction: auto

3 Computation
3.1 Computation
3.2 Objectives and tools
3.3 Expressions
3.4 Statements
3.5 Functions
3.6 vector
3.7 Language features

4 Errors!
4.1 Introduction
4.2 Sources of errors
4.3 Compile-time errors
4.4 Link-time errors
4.5 Run-time errors
4.6 Exceptions
4.7 Avoiding and finding errors

5 Writing a Program
5.1 A problem
5.2 Thinking about the problem
5.3 Back to the calculator!
5.4 Back to the drawing board
5.5 Turning a grammar into code
5.6 Trying the first version
5.7 Trying the second version
5.8 Token streams
5.9 Program structure

6 Completing a Program
6.1 Introduction
6.2 Input and output
6.3 Error handling
6.4 Negative numbers
6.5 Remainder: %
6.6 Cleaning up the code
6.7 Recovering from errors
6.8 Variables

7 Technicalities: Functions, etc.


7.1 Technicalities
7.2 Declarations and definitions
7.3 Scope
7.4 Function call and return
7.5 Order of evaluation
7.6 Namespaces
7.7 Modules and headers

8 Technicalities: Classes, etc.


8.1 User-defined types
8.2 Classes and members
8.3 Interface and implementation
8.4 Evolving a class: Date
8.5 Enumerations
8.6 Operator overloading
8.7 Class interfaces
Part II: Input and Output

9 Input and Output Streams


9.1 Input and output
9.2 The I/O stream model
9.3 Files
9.4 I/O error handling
9.5 Reading a single value
9.6 User-defined output operators
9.7 User-defined input operators
9.8 A standard input loop
9.9 Reading a structured file
9.10 Formatting
9.11 String streams

10 A Display Model
10.1 Why graphics?
10.2 A display model
10.3 A first example
10.4 Using a GUI library
10.5 Coordinates
10.6 Shapes
10.7 Using Shape primitives
10.8 Getting the first example to run

11 Graphics Classes
11.1 Overview of graphics classes
11.2 Point and Line
11.3 Lines
11.4 Color
11.5 Line_style
11.6 Polylines
11.7 Closed shapes
11.8 Text
11.9 Mark
11.10 Image

12 Class Design
12.1 Design principles
12.2 Shape
12.3 Base and derived classes
12.4 Other Shape functions
12.5 Benefits of object-oriented programming

13 Graphing Functions and Data


13.1 Introduction
13.2 Graphing simple functions
13.3 Function
13.4 Axis
13.5 Approximation
13.6 Graphing data

14 Graphical User Interfaces


14.1 User-interface alternatives
14.2 The “Next” button
14.3 A simple window
14.4 Button and other Widgets
14.5 An example: drawing lines
14.6 Simple animation
14.7 Debugging GUI code

Part III: Data and Algorithms


15 Vector and Free Store
15.1 Introduction
15.2 vector basics
15.3 Memory, addresses, and pointers
15.4 Free store and pointers
15.5 Destructors
15.6 Access to elements
15.7 An example: lists
15.8 The this pointer

16 Arrays, Pointers, and References


16.1 Arrays
16.2 Pointers and references
16.3 C-style strings
16.4 Alternatives to pointer use
16.5 An example: palindromes

17 Essential Operations
17.1 Introduction
17.2 Access to elements
17.3 List initialization
17.4 Copying and moving
17.5 Essential operations
17.6 Other useful operations
17.7 Remaining Vector problems
17.8 Changing size
17.9 Our Vector so far

18 Templates and Exceptions


18.1 Templates
18.2 Generalizing Vector
18.3 Range checking and exceptions
18.4 Resources and exceptions
18.5 Resource-management pointers

19 Containers and Iterators


19.1 Storing and processing data
19.2 Sequences and iterators
19.3 Linked lists
19.4 Generalizing Vector yet again
19.5 An example: a simple text editor
19.6 vector, list, and string

20 Maps and Sets


20.1 Associative containers
20.2 map
20.3 unordered_map
20.4 Timing
20.5 set
20.6 Container overview
20.7 Ranges and iterators

21 Algorithms
21.1 Standard-library algorithms
21.2 Function objects
21.3 Numerical algorithms
21.4 Copying
21.5 Sorting and searching

Index
Preface

Damn the
torpedoes!
Full speed ahead.
– Admiral
Farragut

Programming is the art of expressing solutions to problems


so that a computer can execute those solutions. Much of the
effort in programming is spent finding and refining solutions.
Often, a problem is only fully understood through the
process of programming a solution for it.
This book is for someone who has never programmed
before but is willing to work hard to learn. It helps you
understand the principles and acquire the practical skills of
programming using the C++ programming language. It can
also be used by someone with some programming
knowledge who wants a more thorough grounding in
programming principles and contemporary C++.
Why would you want to program? Our civilization runs on
software. Without understanding software, you are reduced
to believing in “magic” and will be locked out of many of the
most interesting, profitable, and socially useful technical
fields of work. When I talk about programming, I think of the
whole spectrum of computer programs from personal
computer applications with GUIs (graphical user interfaces),
through engineering calculations and embedded systems
control applications (such as digital cameras, cars, and cell
phones), to text manipulation applications as found in many
humanities and business applications. Like mathematics,
programming – when done well – is a valuable intellectual
exercise that sharpens our ability to think. However, thanks
to feedback from the computer, programming is more
concrete than most forms of math and therefore accessible
to more people. It is a way to reach out and change the
world – ideally for the better. Finally, programming can be
great fun.
There are many kinds of programming. This book aims to
serve those who want to write nontrivial programs for the
use of others and to do so responsibly, providing a decent
level of system quality. That is, I assume that you want to
achieve a level of professionalism. Consequently, I chose
the topics for this book to cover what is needed to get
started with real-world programming, not just what is easy
to teach and learn. If you need a technique to get basic
work done right, I describe it, demonstrate concepts and
language facilities needed to support the technique, and
provide exercises for it. If you just want to understand toy
programs or write programs that just call code provided by
others, you can get along with far less than I present. In
such cases, you will probably also be better served by a
language that’s simpler than C++. On the other hand, I
won’t waste your time with material of marginal practical
importance. If an idea is explained here, it’s because you’ll
almost certainly need it.
Programming is learned by writing programs. In this,
programming is similar to other endeavors with a practical
component. You cannot learn to swim, to play a musical
instrument, or to drive a car just from reading a book – you
must practice. Nor can you become a good programmer
without reading and writing lots of code. This book focuses
on code examples closely tied to explanatory text and
diagrams. You need those to understand the ideals,
concepts, and principles of programming and to master the
language constructs used to express them. That’s essential,
but by itself, it will not give you the practical skills of
programming. For that, you need to do the exercises and
get used to the tools for writing, compiling, and running
programs. You need to make your own mistakes and learn to
correct them. There is no substitute for writing code.
Besides, that’s where the fun is!
There is more to programming – much more – than
following a few rules and reading the manual. This book is
not focused on “the syntax of C++.” C++ is used to
illustrate fundamental concepts. Understanding the
fundamental ideals, principles, and techniques is the
essence of a good programmer. Also, “the fundamentals”
are what last: they will still be essential long after today’s
programming languages and tools have evolved or been
replaced.
Code can be beautiful as well as useful. This book is
written to help you to understand what it means for code to
be beautiful, to help you to master the principles of creating
such code, and to build up the practical skills to create it.
Good luck with programming!

Previous Editions
The third edition of Programming: Principles and Practice
Using C++ is about half the size of the second edition.
Students having to carry the book will appreciate the lighter
weight. The reason for the reduced size is simply that more
information about C++ and its standard library is available
on the Web. The essence of the book that is generally used
in a course in programming is in this third edition (“PPP3”),
updated to C++20 plus a bit of C++23. The fourth part of
the previous edition (“PPP2”) was designed to provide extra
information for students to look up when needed and is
available on the Web:

Chapter 1: Computers, People, and Programming


Chapter 11: Customizing Input and Output
Chapter 22: Ideas and History
Chapter 23 Text Manipulation
Chapter 24: Numerics
Chapter 25: Embedded Systems Programming
Chapter 26: Testing
Chapter 27: The C Programming Language
Glossary

Where I felt it useful to reference these chapters, the


references look like this: PPP2.Ch22 or PPP2.§27.1.

Acknowledgments
Special thanks to the people who reviewed drafts of this
book and suggested many improvements: Clovis L. Tondo,
Jose Daniel Garcia Sanchez, J.C. van Winkel, and Ville
Voutilainen. Also, Ville Voutilainen did the non-trivial
mapping of the GUI/Graphics interface library to Qt, making
it portable to an amazing range of systems.
Also, thanks to the many people who contributed to the
first and second editions of this book. Many of their
comments are reflected in this third edition.
0

Notes to the Reader

eiπ + 1
– Leonhard Euler

This chapter is a grab bag of information; it aims to give you an idea of


what to expect from the rest of the book. Please skim through it and
read what you find interesting. Before writing any code, read “PPP
support” (§0.4). A teacher will find most parts immediately useful. If
you are reading this book as a novice, please don’t try to understand
everything. You may want to return and reread this chapter once you
feel comfortable writing and executing small programs.

§0.1 The structure of this book


General approach; Drills, exercises, etc.; What comes after this
book?
§0.2 A philosophy of teaching and learning
A note to students; A note to teachers
§0.3 ISO standard C++
Portability; Guarantees; A brief history of C++
§0.4 PPP support
Web resources
§0.5 Author biography
§0.6 Bibliography
0.1 The structure of this book
This book consists of three parts:

Part I (Chapter 1 to Chapter 8) presents the fundamental concepts and


techniques of programming together with the C++ language and library
facilities needed to get started writing code. This includes the type system,
arithmetic operations, control structures, error handling, and the design,
implementation, and use of functions and user-defined types.
Part II (Chapter 9 to Chapter 14) first describes how to get numeric and
text data from the keyboard and from files, and how to produce
corresponding output to the screen and to files. Then, we show how to
present numeric data, text, and geometric shapes as graphical output, and
how to get input into a program from a graphical user interface (GUI). As
part of that, we introduce the fundamental principles and techniques of
object-oriented programming.
Part III (Chapter 15 to Chapter 21) focuses on the C++ standard library’s
containers and algorithms framework (often referred to as the STL). We
show how containers (such as vector, list, and map) are implemented and
used. In doing so, we introduce low-level facilities such as pointers, arrays,
and dynamic memory. We also show how to handle errors using exceptions
and how to parameterize our classes and functions using templates. As
part of that, we introduce the fundamental principles and techniques of
generic programming. We also demonstrate the design and use of
standard-library algorithms (such as sort, find, and inner_product).

The order of topics is determined by programming techniques, rather than


programming language features.
CC
To ease review and to help you if you miss a key point during a first reading
where you have yet to discover which kind of information is crucial, we place
three kinds of “alert markers” in the margin:

CC: concepts and techniques (this paragraph is an example of that)


AA: advice
XX: warning

The use of CC, AA, and XX, rather than a single token in different colors, is to
help where colors are not easy to distinguish.

0.1.1 General approach


In this book, we address you directly. That is simpler and clearer than the
conventional “professional” indirect form of address, as found in most
scientific papers. By “you” we mean “you, the reader,” and by “we” we mean
“you, the author, and teachers,” working together through a problem, as we
might have done had we been in the same room. I use "I" when I refer to my
own work or personal opinions.
AA
This book is designed to be read chapter by chapter from the beginning to
the end. Often, you’ll want to go back to look at something a second or a third
time. In fact, that’s the only sensible approach, as you’ll always dash past
some details that you don’t yet see the point in. In such cases, you’ll
eventually go back again. Despite the index and the cross-references, this is
not a book that you can open to any page and start reading with any
expectation of success. Each section and each chapter assume understanding
of what came before.
Each chapter is a reasonably self-contained unit, meant to be read in “one
sitting” (logically, if not always feasible on a student’s tight schedule). That’s
one major criterion for separating the text into chapters. Other criteria include
that a chapter is a suitable unit for drills and exercises and that each chapter
presents some specific concept, idea, or technique. This plurality of criteria
has left a few chapters uncomfortably long, so please don’t take “in one
sitting” too literally. In particular, once you have thought about the review
questions, done the drill, and worked on a few exercises, you’ll often find that
you have to go back to reread a few sections.
A common praise for a textbook is “It answered all my questions just as I
thought of them!” That’s an ideal for minor technical questions, and early
readers have observed the phenomenon with this book. However, that cannot
be the whole ideal. We raise questions that a novice would probably not think
of. We aim to ask and answer questions that you need to consider when
writing quality software for the use of others. Learning to ask the right (often
hard) questions is an essential part of learning to think as a programmer.
Asking only the easy and obvious questions would make you feel good, but it
wouldn’t help make you a programmer.
We try to respect your intelligence and to be considerate about your time. In
our presentation, we aim for professionalism rather than cuteness, and we’d
rather understate a point than hype it. We try not to exaggerate the
importance of a programming technique or a language feature, but please
don’t underestimate a simple statement like “This is often useful.” If we quietly
emphasize that something is important, we mean that you’ll sooner or later
waste days if you don’t master it.
Our use of humor is more limited than we would have preferred, but
experience shows that people’s ideas of what is funny differ dramatically and
that a failed attempt at humor can be confusing.
CC
We do not pretend that our ideas or the tools offered are perfect. No tool,
library, language, or technique is “the solution” to all of the many challenges
facing a programmer. At best, a language can help you to develop and express
your solution. We try hard to avoid “white lies”; that is, we refrain from
oversimplified explanations that are clear and easy to understand, but not true
in the context of real languages and real problems.

0.1.2 Drills, exercises, etc


AA
Programming is not just an intellectual activity, so writing programs is
necessary to master programming skills. We provide three levels of
programming practice:

Drills: A drill is a very simple exercise devised to develop practical, almost


mechanical skills. A drill usually consists of a sequence of modifications of
a single program. You should do every drill. A drill is not asking for deep
understanding, cleverness, or initiative. We consider the drills part of the
basic fabric of the book. If you haven’t done the drills, you have not
“done” the book.
Exercises: Some exercises are trivial, and others are very hard, but most
are intended to leave some scope for initiative and imagination. If you are
serious, you’ll do quite a few exercises. At least do enough to know which
are difficult for you. Then do a few more of those. That’s how you’ll learn
the most. The exercises are meant to be manageable without exceptional
cleverness, rather than to be tricky puzzles. However, we hope that we
have provided exercises that are hard enough to challenge anybody and
enough exercises to exhaust even the best student’s available time. We do
not expect you to do them all, but feel free to try.
Try this: Some people like to put the book aside and try some examples
before reading to the end of a chapter; others prefer to read ahead to the
end before trying to get code to run. To support readers with the former
preference, we provide simple suggestions for practical work labeled Try
this at natural breaks in the text. A Try this is generally in the nature of a
drill but focused narrowly on the topic that precedes it. If you pass a Try
this without trying it out – maybe because you are not near a computer or
you find the text riveting – do return to it when you do the chapter drill; a
Try this either complements the chapter drill or is a part of it.

In addition, at the end of each chapter we offer some help to solidify what’s
learned:

Review: At the end of each chapter, you’ll find a set of review questions.
They are intended to point you to the key ideas explained in the chapter.
One way to look at the review questions is as a complement to the
exercises: the exercises focus on the practical aspects of programming,
whereas the review questions try to help you articulate the ideas and
concepts. In that, they resemble good interview questions.
Terms: A section at the end of each chapter presents the basic vocabulary
of programming and of C++. If you want to understand what people say
about programming topics and to articulate your own ideas, you should
know what each term means.
Postscript: A paragraph intended to provide some perspective for the
material presented.

In addition, we recommend that you take part in a small project (and more if
time allows for it). A project is intended to produce a complete useful program.
Ideally, a project is done by a small group of people (e.g., three people)
working together (e.g., while progressing through the later chapters of the
book). Most people find such projects the most fun and that they tie
everything together.
CC
Learning involves repetition. Our ideal is to make every important point at
least twice and to reinforce it with exercises.

0.1.3 What comes after this book?


AA
At the end of this book, will you be an expert at programming and at C++? Of
course not! When done well, programming is a subtle, deep, and highly skilled
art building on a variety of technical skills. You should no more expect to
become an expert at programming in four months than you should expect to
become an expert in biology, in math, in a natural language (such as Chinese,
English, or Danish), or at playing the violin in four months – or in half a year, or
a year. What you should hope for, and what you can expect if you approach
this book seriously, is to have a really good start that allows you to write
relatively simple useful programs, to be able to read more complex programs,
and to have a good conceptual and practical background for further work.
The best follow-up to this initial course is to work on a project developing
code to be used by someone else; preferably guided by an experienced
developer. After that, or (even better) in parallel with a project, read either a
professional-level general textbook, a more specialized book relating to the
needs of your project, or a textbook focusing on a particular aspect of C++
(such as algorithms, graphics, scientific computation, finance, or games); see
§0.6.
AA
Eventually, you should learn another programming language. We don’t
consider it possible to be a professional in the realm of software – even if you
are not primarily a programmer – without knowing more than one language.
Why? No large program is written in a single language. Also, different
languages typically differ in the way code is thought about and programs are
constructed. Design techniques, availability of libraries, and the way programs
are built differ, sometimes dramatically. Even when the syntaxes of two
languages are similar, the similarity is typically only skin deep. Performance,
detection of errors, and constraints on what can be expressed typically differ.
This is similar to the ways natural languages and cultures differ. Knowing only
a single language and a single culture implies the danger of thinking that “the
way we do things” is the only way or the only good way. That way
opportunities are missed, and sub-optimal programs are produced. One of the
best ways to avoid such problems is to know several languages (programming
languages and natural languages).

0.2 A philosophy of teaching and learning


What are we trying to help you learn? And how are we approaching the
process of teaching? We try to present the minimal concepts, techniques, and
tools for you to do effective practical programs, including

Program organization
Debugging and testing
Class design
Computation
Function and algorithm design
Graphics (two-dimensional only)
Graphical user interfaces (GUIs)
Files and stream input and output (I/O)
Memory management
Design and programming ideals
The C++ standard library
Software development strategies

To keep the book lighter than the small laptop on which it is written, some
supplementary topics from the second edition are placed on the Web (§0.4.1):

Computers, People, and Programming (PPP2.Ch1)


Ideals and History (PPP2.Ch22)
Text manipulation (incl. Regular expression matching) (PPP2.Ch23)
Numerics (PPP2.Ch24)
Embedded systems programming (PPP2.Ch25)
C-language programming techniques (PPP2.Ch27)

Working our way through the chapters, we cover the programming techniques
called procedural programming (as with the C programming language), data
abstraction, object-oriented programming, and generic programming. The
main topic of this book is programming, that is, the ideals, techniques, and
tools of expressing ideas in code. The C++ programming language is our main
tool, so we describe many of C++’s facilities in some detail. But please
remember that C++ is just a tool, rather than the main topic of this book. This
is “programming using C++,” not “C++ with a bit of programming theory.”
Each topic we address serves at least two purposes: it presents a technique,
concept, or principle and also a practical language or library feature. For
example, we use the interface to a two-dimensional graphics system to
illustrate the use of classes and inheritance. This allows us to be economical
with space (and your time) and also to emphasize that programming is more
than simply slinging code together to get a result as quickly as possible. The
C++ standard library is a major source of such “double duty” examples –
many even do triple duty. For example, we introduce the standard-library
vector, use it to illustrate widely useful design techniques, and show many of
the programming techniques used to implement it. One of our aims is to show
you how major library facilities are implemented and how they map to
hardware. We insist that craftsmen must understand their tools, not just
consider them “magical.”
Some topics will be of greater interest to some programmers than to others.
However, we encourage you not to prejudge your needs (how would you know
what you’ll need in the future?) and at least look at every chapter. If you read
this book as part of a course, your teacher will guide your selection.
CC
We characterize our approach as “depth-first.” It is also “concrete-first” and
“concept-based.” First, we quickly (well, relatively quickly, Chapter 1 to
Chapter 9) assemble a set of skills needed for writing small practical programs.
In doing so, we present a lot of tools and techniques in minimal detail. We
focus on simple concrete code examples because people grasp the concrete
faster than the abstract. That’s simply the way most humans learn. At this
initial stage, you should not expect to understand every little detail. In
particular, you’ll find that trying something slightly different from what just
worked can have “mysterious” effects. Do try, though! Please do the drills and
exercises we provide. Just remember that early on you just don’t have the
concepts and skills to accurately estimate what’s simple and what’s
complicated; expect surprises and learn from them.
AA
We move fast in this initial phase – we want to get you to the point where
you can write interesting programs as fast as possible. Someone will argue,
“We must move slowly and carefully; we must walk before we can run!” But
have you ever watched a baby learning to walk? Babies really do run by
themselves before they learn the finer skills of slow, controlled walking.
Similarly, you will dash ahead, occasionally stumbling, to get a feel of
programming before slowing down to gain the necessary finer control and
understanding. You must run before you can walk!
XX
It is essential that you don’t get stuck in an attempt to learn “everything”
about some language detail or technique. For example, you could memorize all
of C++’s built-in types and all the rules for their use. Of course you could, and
doing so might make you feel knowledgeable. However, it would not make you
a programmer. Skipping details will get you “burned” occasionally for lack of
knowledge, but it is the fastest way to gain the perspective needed to write
good programs. Note that our approach is essentially the one used by children
learning their native language and also the most effective approach used to
learn a foreign language. We encourage you to seek help from teachers,
friends, colleagues, Mentors, etc. on the inevitable occasions when you are
stuck. Be assured that nothing in these early chapters is fundamentally
difficult. However, much will be unfamiliar and might therefore feel difficult at
first.
Later, we build on your initial skills to broaden your base of knowledge. We
use examples and exercises to solidify your understanding, and to provide a
conceptual base for programming.
AA
We place a heavy emphasis on ideals and reasons. You need ideals to guide
you when you look for practical solutions – to know when a solution is good
and principled. You need to understand the reasons behind those ideals to
understand why they should be your ideals, why aiming for them will help you
and the users of your code. Nobody should be satisfied with “because that’s
the way it is” as an explanation. More importantly, an understanding of ideals
and reasons allows you to generalize from what you know to new situations
and to combine ideas and tools in novel ways to address new problems.
Knowing “why” is an essential part of acquiring programming skills.
Conversely, just memorizing lots of poorly understood rules is limiting, a
source of errors, and a massive waste of time. We consider your time precious
and try not to waste it.
Many C++ language-technical details are banished to other sources, mostly
on the Web (§0.4.1). We assume that you have the initiative to search out
information when needed. Use the index and the table of contents. Don’t
forget the online help facilities of your compiler. Remember, though, to
consider every Web resource highly suspect until you have reason to believe
better of it. Many an authoritative-looking Web site is put up by a
programming novice or someone with something to sell. Others are simply
outdated. We provide a collection of links and information on our support Web
site: www.stroustrup.com/programming.xhtml.
Please don’t be too impatient for “realistic” examples. Our ideal example is
the shortest and simplest code that directly illustrates a language facility, a
concept, or a technique. Most real-world examples are far messier than ours,
yet do not consist of more than a combination of what we demonstrate.
Successful commercial programs with hundreds of thousands of lines of code
are based on techniques that we illustrate in a dozen 50-line programs. The
fastest way to understand real-world code is through a good understanding of
the fundamentals.
We do not use “cute examples involving cuddly animals” to illustrate our
points. We assume that you aim to write real programs to be used by real
people, so every example that is not presented as specifically language-
technical is taken from a real-world use. Our basic tone is that of professionals
addressing (future) professionals.
C++ rests on two pillars:

Efficient direct access to machine resources: making C++ effective for


low-level, machine-near, programming as is essential in many application
domains.
Powerful (Zero-overhead) abstraction mechanisms: making it possible to
escape the error-prone low-level programming by providing elegant,
flexible, and type-and-resource-safe, yet efficient facilities needed for
higher-level programming.

This book teaches both levels. We use the implementation of higher-level


abstractions as our primary examples to introduce low-level language features
and programming techniques. The aim is always to write code at the highest
level affordable, but that often requires a foundation built using lower-level
facilities and techniques. We aim for you to master both levels.

0.2.1 A note to students


AA
Many thousands of first-year university students taught using the first two
editions of this book had never before seen a line of code in their lives. Most
succeeded, so you can do it, too.
You don’t have to read this book as part of a course. The book is widely used
for self-study. However, whether you work your way through as part of a
course or independently, try to work with others. Programming has an – unfair
– reputation as a lonely activity. Most people work better and learn faster when
they are part of a group with a common aim. Learning together and discussing
problems with friends is not cheating! It is the most efficient – as well as most
pleasant – way of making progress. If nothing else, working with friends forces
you to articulate your ideas, which is just about the most efficient way of
testing your understanding and making sure you remember. You don’t actually
have to personally discover the answer to every obscure language and
programming environment problem. However, please don’t cheat yourself by
not doing the drills and a fair number of exercises (even if no teacher forces
you to do them). Remember: programming is (among other things) a practical
skill that you must practice to master.
Most students – especially thoughtful good students – face times when they
wonder whether their hard work is worthwhile. When (not if) this happens to
you, take a break, reread this chapter, look at the “Computers, People, and
Programming” and “Ideals and History” chapters posted on the Web (§0.4.1).
There, I try to articulate what I find exciting about programming and why I
consider it a crucial tool for making a positive contribution to the world.
Please don’t be too impatient. Learning any major new and valuable skill
takes time.
The primary aim of this book is to help you to express your ideas in code,
not to teach you how to get those ideas. Along the way, we give many
examples of how we can address a problem, usually through analysis of a
problem followed by gradual refinement of a solution. We consider
programming itself a form of problem solving: only through complete
understanding of a problem and its solution can you express a correct program
for it, and only through constructing and testing a program can you be certain
that your understanding is complete. Thus, programming is inherently part of
an effort to gain understanding. However, we aim to demonstrate this through
examples, rather than through “preaching” or presentation of detailed
prescriptions for problem solving.

0.2.2 A note to teachers


CC
No. This is not a traditional Computer Science 101 course. It is a book about
how to construct working software. As such, it leaves out much of what a
computer science student is traditionally exposed to (Turing completeness,
state machines, discrete math, grammars, etc.). Even hardware is ignored on
the assumption that students have used computers in various ways since
kindergarten. This book does not even try to mention most important CS
topics. It is about programming (or more generally about how to develop
software), and as such it goes into more detail about fewer topics than many
traditional courses. It tries to do just one thing well, and computer science is
not a one-course topic. If this book/course is used as part of a computer
science, computer engineering, electrical engineering (many of our first
students were EE majors), information science, or whatever program, we
expect it to be taught alongside other courses as part of a well-rounded
introduction.
Many students like to get an idea why subjects are taught and why they are
taught in the way they are. Please try to convey my teaching philosophy,
general approach, etc. to your students along the way. Also, to motivate
students, please present short examples of areas and applications where C++
is used extensively, such as aerospace, medicine, games, animation, cars,
finance, and scientific computation.

0.3 ISO standard C++


C++ is defined by an ISO standard. The first ISO C++ standard was ratified in
1998, so that version of C++ is known as C++98. The code for this edition of
the book uses contemporary C++, C++20 (plus a bit of C++23). If your
compiler does not support C++20 [C++20], get a new compiler. Good, modern
C++ compilers can be downloaded from a variety of suppliers; see
www.stroustrup.com/compilers.xhtml. Learning to program using an earlier and less
supportive version of the language can be unnecessarily hard.
On the other hand, you may be in an environment where you are able to
use only C++14 or C++17. Most of the contents of this book will still apply,
but you’ll have trouble with features introduced in C++20:

modules (§7.7.1). Instead of modules use header files (§7.7.2). In particular,


use #include "PPPheaders.h" to compile our examples and your exercises,
rather than #include "PPP.h" (§0.4).
ranges (§20.7). Use explicit iterators, rather than ranges. For example,
rather than ranges::sort(v). If/when that gets tedious,
sort(v.begin(),v.end())
write your own ranges versions of your favorite algorithms (§21.1).
span (§16.4.1). Fall back on the old “pointer and size” technique. For
example, void f(int* p, int n); rather than void f(span<int> s); and do your own
range checking as needed.
concepts (§18.1.3). Use plain template<typename T> and hope for the best.
The error messages from that for simple mistakes can be horrendous.

0.3.1 Portability
CC
It is common to write C++ to run on a variety of machines. Major C++
applications run on machines we haven’t ever heard of! We consider the use of
C++ on a variety of machine architectures and operating systems most
important. Essentially every example in this book is not only ISO Standard
C++, but also portable. By portable, we mean that we make no assumptions
about the computer, the operating system, and the compiler beyond that an
up-to-date standard-conforming C++ implementation is available. Unless
specifically stated, the code we present should work on every C++
Another Random Scribd Document
with Unrelated Content
more peculiarly urged to it by the openly expressed veneration or
secret acquiescence of the wisest men. Religious faith, although the
most deeply seated in the breast of any of our sentiments, is,
singular as it may appear, that which we are most eager in
communicating to others. Whatever too has been long suppressed,
breaks forth with redoubled force when the obstacle is removed.
Besides, the religious sentiments of the Jews were not, like those of
the heathens, the speculations of human reason, but truths,
confirmed by the sanction of God; and their zeal in making
proselytes was not the vain desire to swell the numbers of a sect,
but to deliver those who were under the dominion of error.
Myron and our travellers took leave of each other, in the hope of
meeting after a few months. He went through the camp to seek for
company as far as Tyre, and they took the road to Hebron.
From Gaza two roads conduct to Jerusalem. One passes by
Eleutheropolis and the plain of Sephela; the other through the hills
by Hebron. Although the former was the easier and more customary,
Elisama preferred the latter. He had a friend in Hebron, whom he
had not seen for many years, and in whose company he wished to
perform the pilgrimage; and he was desirous of making Helon’s first
entrance into the Land of Promise as solemn and impressive as
possible. By taking the easier road, they must have gone a long way
through the country of the Philistines, and not have been joined by
pilgrims, till they reached Morescheth, and then only in small
numbers. On the other road, they entered immediately on the
Jewish territory, and their way conducted them through scenes
adorned with many an historical remembrance. They had not
proceeded far inward from the sea, in the direction of the river
Besor, when they reached the confines of Judah; they stood at the
foot of its hills, and the land of the heathen lay behind them. Helon
seemed to feel for the first time what home and native country
mean. In Egypt, where he had been born and bred, he had been
conscious of no such feeling; for he had been taught to regard
himself as only a sojourner there. Into this unknown, untrodden
native country he was about to enter, and before he set his foot
upon it, at the first sight of it, the breeze seemed to waft from its
hills a welcome to his home. “Land of my fathers,” he exclaimed,
“Land of Promise, promised to me also from my earliest years!” and
quickened his steps to reach it. He felt the truth of the saying, that
Israel is Israel only in the Holy Land. “Here,” said Elisama, “is the
boundary of Judah.” Helon, unable to speak, threw himself on the
sacred earth, kissed it and watered it with his tears, and Sallu,
letting go the bridles of the camels, did the same. Elisama stood
beside them, and as he stretched his arms over them, and in the
name of the God of Abraham, of Isaac, and of Jacob, blessed their
going out and their coming in, his eyes too overflowed with tears,
and his heart seemed to warm again, as with the renewal of a
youthful love. See, he exclaimed,

The winter is past, the rain is over and gone,


The flowers appear on the earth;
The time of the singing of birds is come,
The voice of the turtledove is heard in our land.
The figtree putteth forth her green figs,
The vines give fragrance from their blossoms.—Cant. ii. 10.

They proceeded slowly on their way; Helon gazed around him on


every side, and thought he had never seen so lovely a spring. The
latter rains had ceased, and had given a quickening freshness to the
breezes from the hills, such as he had never known in the Delta. The
narcissus and the hyacinth, the blossoms of the apricot and peach,
shed their last fragrance around. The groves of terebinth, the
oliveyards and vineyards stood before them in their living green: the
corn, swollen by the rain, was ripening fast for the harvest, and the
fields of barley were already yellow. The wide meadows, covered
with grass for the cattle, the alternation of hill and valley, the rocks
hewn out in terraces, and filled with earth and planted, offered a
constant variety of delightful views. You might see that this was a
land, the dew of which Jehovah had blessed, in which the prayer of
Isaac over Jacob had been fulfilled, when the patriarch said, “God
give thee of the dew of heaven, and of the fatness of the earth, and
plenty of corn and wine.”[79] Helon drank of the pure, clear mountain
stream, whose sparkling reflection seemed to him like a smile from a
parent’s eyes on a returning wanderer, and thought the sweet water
of the Nile, so praised by the Egyptians, could bear no comparison
with it. Elisama reminded him of the words of the psalm:

“Thou lookest down upon our land and waterest it,


And makest it full of sheaves.
The river of God is full of water.
Thou preparest corn and tillest the land,
Thou waterest its furrows and softenest its clods;
Thou moistenest it with showers, thou blessest its springing,
Thou crownest the year with thy blessing,
And thy footsteps drop fatness.
They drop upon the pastures of the wilderness,
And the hills are encompassed with rejoicing:
The pastures are clothed with flocks,
And the fields are covered with corn:
All shout for joy and sing.”—Ps. lxv.

Helon replied to him from another psalm:


The springs arise among the valleys,
They run among the hills.
Here the thirsty wild beast cools itself,
The wild ass quenches his thirst.
The fowls of heaven dwell beside them,
And sing among the branches.
He watereth the hills from his clouds above;
The fruit of his works satisfieth the earth.
He maketh grass to grow for cattle,
And herb for the service of man,
Preparing bread from the earth
And wine that maketh glad man’s heart;
The fragrance of the oil for ointment,
And bread that giveth strength.
The cedars of Lebanon, tall as heaven,
He has planted, he watereth them!—Ps. civ.

“This,” exclaimed both together, “is indeed the Land of Promise;”


and Helon called to mind the words of the prophet Ezekiel, “Thus
saith the Lord Jehovah, I lifted up my hand to bring them out of
Egypt into a land which I had promised for them, a land flowing with
milk and honey, a land that is the glory of all lands.”[80]
These words Helon repeated incessantly as he proceeded. The
pure mountain air, which he had never drawn before, inspired the
body, as the feeling of home refreshed the mind. This moment, and
that in which he had returned to the law, moments of deep and
indelible interest, seemed to rise like lofty summits, far above the
ordinary level of the events of life. When he thought on the narrative
of his uncle, he was inclined to compare the former of these events
with the terrific annunciation of the law from Sinai—the latter, with
the joy of Israel, when, under the command of Joshua, they crossed
the Jordan, and first set their feet on the Promised Land.
During the whole of this journey to Hebron, external impressions
seemed to have no other power over him, than to awaken trains of
thought, connected with the subject by which his whole soul was
occupied. When Elisama pointed out to him Minois and Gerar, which
lay far to the south; and reminded him that Gerar was the place
where Abraham had involved himself in difficulties by the
concealment of the truth from Abimelech;[81] and where the pious
Asa had defeated the Ethiopians;[82] these hints were sufficient for
his imagination to cover the plains with the flocks of the patriarch,
and the hosts of the virtuous king of Judah.
They passed near Beersheba, which had given rise to the
expression so common in scripture history, “from Dan to Beersheba,”
to denote the whole extent of the Holy Land, from north to south.
Beersheba was the frontier town on the south, distant from Dan a
hundred and sixty sabbath-days’ journies, or fifty-three leagues.
Elisama related how Abraham and Isaac had dug a well here, and
called it Beersheba, in memory of the oaths exchanged between
them and Abimelech;[83] how Jehovah had here appeared to Jacob,
and permitted him to go down to Egypt to his beloved Joseph;[84]
how Elias the Tishbite had fled hither from the face of Ahab and
Jezebel;[85] how Samuel’s sons had judged the people here;[86] and
how, in latter times, it had become a seat of idolatrous worship
under Uzziah; in consequence of which, Amos had given the
warning, “Pass not to Beersheba,”[87] and had denounced calamity on
those who say, “The worship of Beersheba liveth.”[88] At the return
from the captivity this was one of the first cities which the exiles
repeopled. Notwithstanding the length of the journey, which they
performed on foot, Elisama seemed to feel no fatigue; and every hill
or valley, every town or village, which they passed, gave him fresh
occasion to produce his inexhaustible store of historical recollections.
Their road lay by Debir, called also sometimes Kiriath Sanna,
sometimes Kiriath Sepher; and it reminded him of the heroic prize,
the hand of his own daughter Achsa, which Caleb had proposed to
the man who should conquer it.[89]
At length Hebron rose before them, and each approached it with
characteristic feelings. Helon viewed it only as having been for seven
years the city of David’s residence;[90] and could have imagined, that
the tones of the sweet singer’s harp still lingered about its walls.
Elisama longed to see the friend of his youth, and to repose under
his hospitable roof. There was an unusual commotion beneath the
towering palms at the gate and in all the streets. It was evident that
they were preparing to depart for Jerusalem on the morrow.
They were received with the cordial welcome of early but long
separated friends. Elisama had scarcely laid himself down, to have
his feet washed, when the discourse between him and his host
flowed as freely as if the old man had only walked a sabbath-day’s
journey. Helon observed, that here the ancient custom was
preserved of crouching upon the carpet at meals; while in Alexandria
they reclined on Grecian cushions. He fell asleep, and night
prolonged the dreams of day.
CHAPTER II.
THE PILGRIMAGE.

At the first crowing of the cock, all was in motion; their host was
making the last arrangements for his departure, the neighbours
entered to announce that the march was about to begin.
Refreshments were offered to the travellers, and especially to
Elisama; but he declared with earnestness, that, even amidst the
idolaters of Egypt, he had scarcely ever allowed himself to taste food
early in a morning, and much less would he do so in Israel, and in
the city of David, and on a pilgrimage to Jerusalem. The commotion
in the street became greater and greater, and it was scarcely dawn,
when they set forth. All the doors of the houses were open, all the
roofs were covered with persons watching their departure. Helon, as
he passed through the streets of Hebron in the ruddy light of the
dawn, and by the palm trees at the gate, was reminded that Hebron
was one of the oldest cities in the world, even older than Zoan in
Egypt;[91] that it had been conquered by Joshua, and given as a
portion to Caleb, the bravest and most faithful of the explorers of
the land;[92] that it had afterwards become a city of the priests, and
had been for seven years the residence of David; that it had been
taken by the Idumeans, and reconquered by the Maccabees,[93] and
once more incorporated with Judah. But when he had passed the
gate, and gained a view of the lovely valley full of vine-yards and
corn-fields, and looked around on the region where patriarchs had
tended their flocks and pitched their tents, and lived in friendly
communion with Jehovah, all the high and enthusiastic feelings of
the preceding day were renewed in his mind. From all the cross-
roads, men, women, and children were streaming towards the
highway to Jerusalem. They had scarcely proceeded a sabbath-day’s
journey, when they saw the grove of terebinths; cymbals, flutes, and
psalms resounded from the midst of it, and hundreds were standing
under the turpentine-tree of Abraham, a tree of immense size and
wide-spreading branches. Helon entered the grove of Mamre with
feelings of religious veneration. Here Abraham had dwelt, here the
angels had appeared to him; beneath these trees Isaac had been
promised, and the rite of circumcision instituted; here Ishmael had
been born, and driven from his father’s tent; and not far off was the
cave of Machpelah, where Abraham and Sarah, Isaac and Rebecca,
Jacob and Leah were buried.[94] And on this spot, consecrated by so
many recollections, the children of these patriarchs were now
preparing to depart, on their festal pilgrimage to Jerusalem. The
occasion and the place seemed to banish from all hearts every other
feeling but piety and good-will; mutual greetings were exchanged;
friends and relations sought each other out, and associated
themselves for the journey, and all faces beamed with joy. “It is time
to set out,” said some of the elders to the judge of Hebron: “already
has the priest asked the watchman on the temple, Does it begin to
be light towards Hebron?” The priests and elders led the procession;
the people followed, and the slaves with the camels were placed in
the midst of them, the Levites had distributed themselves with their
instruments among the multitude, and as they set forward they sung
this psalm:
How am I glad when they say unto me,
I will go up to the house of Jehovah!
My foot hath stood already in thy gates, O Jerusalem!
Jerusalem, thou beautifully built;
Chief city, where all unite together!
Thither do the tribes go up,
The tribes of Jehovah to the festival of remembrance,
To praise the name of Jehovah.
There are the thrones of judgment,
The thrones of the house of David.
Pray for the peace of Jerusalem;
May they prosper that love thee!
Peace be in thy walls,
Prosperity in thy palaces!
For my brethren and companions’ sake,
I wish thee peace!
For the sake of the temple of our God,
I bless thee with good.—Ps. cxxii.

It is impossible to conceive of the soul-felt exultation with which


this psalm was sung, and of its effect on old and young. Now the
voices rose, like the notes of the mounting lark, on the summit of
the hills, now sunk again in the depths of the valleys. How
differently did it operate now upon the heart of Helon, and when he
sung it before to his solitary harp on his roof in Alexandria! How did
he bless the memory of Samuel, who had given his schools of the
prophets the harp and the flute;[95] and of David, who, bred up
among them, did not forget them even when seated on his throne,
[96]
but appointed Levites for the cultivation of music; and himself
often laid down his sceptre, to assume the harp. It was on such a
pilgrimage, with such accompaniments, that the sublimity and force
of the psalms, and the superiority of Jewish poetry, made itself fully
felt.
Helon was astonished at the effect which they had upon himself
and all around him. The youths and maidens bounded for joy, and
tears of pleasure stood in the eyes of the aged. Those who were
going up for the first time to the festival looked and listened to those
who had already been there, as if to hear from them an explanation
of the full meaning of what they sung. The old heard in these festive
acclamations the echo of their own youthful joys, and while their
hearts swelled with the remembrance of the feelings of their earliest
pilgrimage, they beat yet higher with gratitude to Jehovah, who had
permitted them, in their grey hairs, to behold such glorious days for
Israel, the Syrian tyranny overthrown, and Hyrcanus seated on the
throne.
Sublime are the acclamations of a people freed from a foreign
yoke! But here was more. It was the fraternal union of a whole
people, in the holiest bond of a common faith, going up to appear
before the altar of Jehovah, and to commemorate the wonders of
love and mercy which he had manifested towards their forefathers.
They seemed a band of brothers. “In Alexandria,” said Helon, “Jew is
against Jew, and family against family—but here is one holy people,
loving each other as the children of one Israel, joint heirs of one
great and blessed name.” Every one had bidden adieu to the
occupations and the anxieties of ordinary life. They had come to give
thanks and to pray, and no sounds but those of thankfulness and
prayer were heard among them. The hostilities and alienations
produced by self-love and the collision of interests appeared to have
been left at home, and the general joy dispersed every melancholy
feeling which an individual might have been disposed to indulge. On
these pilgrimages they seemed as free from care as the people of
old, when, rescued from Egyptian bondage, they were fed by manna
from heaven, on their way to the land that flowed with milk and
honey. Jehovah had promised to protect the whole country, so that
no enemy should invade its borders, while the people went up,
thrice in every year, to appear before him[97]—how much more
confidently might each father of a family intrust his own household
to his protection! Nothing was more remarkable than that the aged
and the weakly were able to bear this journey of thirty-six sabbath-
days’ journies, over hill and dale, without complaining of fatigue. It
seemed as if the strong had given to the weaker a portion of their
own vigour; or rather, as if Jehovah himself had strengthened the
feeble knees for this journey. They expressed these sentiments, by
singing, immediately after the former, the following psalm:

I will lift up mine eyes unto the hills


From which my help cometh.
My help cometh from Jehovah,
The Maker of heaven and earth.
He will not suffer thy foot to be moved;
He that keepeth thee will not slumber,
He that keepeth Israel neither slumbereth nor sleepeth.
Jehovah is thy guardian,
Thy shade upon thy right hand:
The sun shall not smite thee by day,
Nor the moon by night.
Jehovah shall preserve thee from all evil,
He shall preserve thy soul.
Jehovah preserveth thy going out and thy coming in,
From this time forth and for evermore.—Ps. cxxi.

It was a beautiful sight, when the procession came from the plain
among the hills. The rocky walls, between which their path
sometimes lay, re-echoed with their songs. Helon withdrew a little
from the line, to an eminence which commanded a view in both
directions, and could see the train, covering both the ascent and the
descent of the hill, spreading over the plain, and winding like a
wreath around the hill beyond.
In every town and village to which they came, they were received
with shouts of joy. Before the doors of the houses stood tables with
dates, honey, and bread. New crowds of persons, dressed in their
holyday attire, were waiting at the junction of the roads, in the
fields, and at the entrance of the towns, and joined themselves to
the long procession. Here and there before the houses, in the fields
or in the vineyards, stood an unclean person, or a woman, or a
child, who had been compelled to remain at home, and who replied
with tears to the salutation of the passing multitude. It seemed as if
the people carried all joy with them from the country to Jerusalem,
and only sorrow was left for those who remained behind. Before a
house in Bethshur, stood a fine boy of ten years old. Tears streamed
from his large dark eyes, and the open features of his noble
countenance had an expression of profound grief. His mother was
endeavouring to comfort him, and to lead him back into the court,
assuring him that his father would take him the next time. But the
boy listened neither to her consolations nor her promises, and
continued to exclaim, “O father, father, let me go to the temple! I
know all the psalms by heart.” He stretched out his arms to the
passers-by in earnest entreaty, and happening to see among them a
man of the neighbourhood whom he knew, he flew to him, and
clinging to his girdle and his upper garment, besought him with tears
to take him with him, till the man, moved by his earnestness, asked
his mother to allow him to go, promising to take care of him till he
should find out his father.
“And this,” said Helon, “is the object of children’s longing in Israel;
so early does the desire of keeping the festival display itself! Brought
up in Palestine, he felt it would have been with him exactly as with
the child.”
They now passed through a wood and then descended a lofty hill
whose slope was wholly covered with vines. In the valley before
them lay the pools of Solomon. They slackened their pace, and the
following psalm was sung:
How lovely are thy tabernacles, Lord of hosts!
My soul longeth and fainteth for the courts of the Lord,
My heart and my flesh cry out for the living God.
As the bird that findeth her house,
As the swallow, a nest for her young,
So I thine altars, O Lord of hosts,
My king and my God!
Blessed are they that dwell in thy house;
They are still praising Thee;
Blessed is the man who placeth his confidence in Thee
And thinketh of the way to Jerusalem!
Should they pass through the valley of sorrow
They find it full of springs.
Blessings be on him who goeth before them,
They increase in strength as they go on,
Till they appear before God in Zion.
O Lord of hosts, hear my prayer!
Give ear, O God of Jacob!
O God, our shield, look down,
Behold the face of thine anointed!
A day in thy courts is better than a thousand.
I had rather be a doorkeeper in the house of God
Than dwell in the tents of wickedness.
For Jehovah our God is a sun and shield;
Jehovah giveth grace and glory,
No good thing will he withhold from them that walk uprightly.
O Lord of hosts,
Blessed is the man that trusteth in Thee!—Ps. lxxxiv.

They were now arrived at the pools of Solomon, into which the
brook Etham was received, and which had formerly supplied
Jerusalem with water, by means of a costly aqueduct. The three
pools lay on different levels, one below another, on a sloping ground.
Around each was a double row of noble palms, in which the whole of
this spot abounded. Here, beside the springs and in the refreshing
shade of the trees, the pilgrims encamped to rest at noon. They had
accomplished twenty-six sabbath-days’ journies of their march and
ten yet remained.
This aqueduct of Solomon’s was a stupendous work. The fountain
of Etham, whose waters the pools received, was about one hundred
and fifty paces above them. The pools were of an oblong form, the
highest one hundred and sixty, the second two hundred, the lowest
two hundred and twenty paces in length, and all ninety paces in
breadth. The celebrated gardens of Solomon lay beneath these
reservoirs, and were a work equally admirable in their kind. They lay
in a rocky valley, enclosed by high hills, and were five hundred paces
long and two hundred broad. A solitude, which had nothing in it wild
or savage, made them a delightful retreat. In the stillness of this
glen, amidst fruit-trees of every variety, the king might find a noble
recreation from the cares of royalty. From these extraordinary
gardens Solomon derived his imagery, when he said, “A garden
enclosed is my sister, my spouse;”[98] and when he speaks in the
same passage of a spring shut up, and a fountain sealed, we are
reminded of the fountain of Etham, which Solomon is said to have
sealed with his own signet ring. Both may serve to explain the words
of the Preacher. “I made me great works, I builded me houses, I
planted me vineyards; I made me gardens and orchards, and I
planted trees in them of all kind of fruits; I made me pools of water
to water therewith the wood of green trees.”[99] Both the reservoirs
and the aqueduct appeared, by the solidity of their construction, to
have been designed to last for ever, and were worthy of the king by
whom they were made, and of his times, of which the Book of
Chronicles declares, that “Silver was in Jerusalem like stones.”[100]
Our travellers blessed his memory, as they drank, beneath the shade
of the palms, the refreshing draught of the cool rock water. It was
just mid-day, the heat of the sun was intense, and all longed for
repose and coolness.
After a short rest the sacks and wine-skins were unpacked from
the camels, while others produced their humble stores from their
mantles or their bosoms. The upper garments were spread for
carpets, on which they lay for rest, or crouched to eat. Now you
might see that these pilgrims were a band of brothers. It is true, the
very poorest had brought something with him. For weeks before,
ever since the feast of tabernacles, they had denied themselves, in
order to save something for this festival; and on this day at least the
command of Moses might appear to have been literally fulfilled,
“There shall be no beggar among you.” But besides this the rich had
provided for the poor a supply of those things which on ordinary
occasions they were not able to procure themselves. Some sent to
the old men a cup of generous wine, or regaled the children with
confectionary and fruits. From Tekoah, the birthplace of the prophet
Amos, which was not far off, came asses loaded with the celebrated
honey of Tekoah; and from Beth-Cherem, celebrated for its wines,
others with large and sweet raisins. From the cheerful mirth which
pervaded the whole assembly, and the delightful coolness of the
water and the trees, they seemed more like a company celebrating,
in a fine evening, the festival of the new moon, than a caravan
halting at mid-day. No one felt the heat or complained of weariness,
except a few aged and weakly persons, who indulged themselves in
a short rest.
Behind a hill the walls of Tekoah were discerned in the distance,
and beyond it the desert of Tekoah, the free pasture of the bees, for
whose honey the town was celebrated. “Does not this scene remind
thee of the prophet-herdsman of Tekoah?” said Elisama to Helon.
“How should it not,” replied Helon, “when I see his prophecy almost
fulfilled before my eyes?”[101]
In that day will I raise up the fallen tabernacle of David,
And close up its breaches, and raise up its ruins,
And build it afresh as in the days of old,
That they may conquer the remnant of Edom,
And of all nations whom I will consecrate to myself,
Saith Jehovah who doeth this.
Behold the day cometh, saith Jehovah,
When the plowman shall overtake the reaper,
And the treader of grapes him that soweth seed.
And the mountains shall drop sweet wine,
And all the hills shall stream.
I will bring back the captivity of my people Israel
And they shall build the desolate cities,
And plant vineyards and drink the wine thereof,
They shall make gardens and eat the fruit of them,
And I will plant them firmly in their land,
And they shall no more be plucked out of their land which I have
given them,
Saith the Lord thy God.

They waited another hour in this pleasant valley, till the great heat
of noon was moderated. During this time some youths came to
Helon, and said to him, “Though you speak our language you are
not a youth of Judah, your turban betrays you.” Helon informed
them that he was an Aramæan Jew, a native of Alexandria indeed,
but one who had chosen Jerusalem, in preference to Leontopolis.
They acknowledged him with joy as one of themselves, and invited
him to accompany them in a walk around the encampment. Helon
gladly accepted the offer.
What a multitude of interesting groups presented themselves on
every side, as they wandered from one palm tree to another! Every
party as they passed offered them wine, mead, honey, dates and the
like, and greeted them with friendly words. Boys had insinuated
themselves among the circles of the men, and listened, with fixed
eyes and open mouth, to every word which they uttered respecting
Jerusalem and the festival. The boy whom Helon had seen weeping
so bitterly before the solitary house had found out his father, was
lying in his lap and repeating to him the psalms which he had learnt.
A group of maidens were listening to a description of the
magnificent vestments of the high-priest. They past by a company of
men, who were speaking of the heroic deeds of Hyrcanus and the
Maccabees, and rejoicing that Edom and Samaria had been made
subject by him to Israel. One feeling of joy pervaded all bosoms, but
it expressed itself in various ways, according to the age or sex of
each.
One group rivetted the attention of Helon so long, that he did not
leave them till it was near the time of departure. Under almost the
furthest palm trees sat seven robust young men, with an equal
number of women and several children. “This is Mardochai of Ziph,
with his children and children’s children,” said one of the youths who
accompanied Helon. They approached him, took him by the hand,
and congratulated him upon being able to go up to the feast, with
such a train of his descendents. “Yes,” exclaimed the old man, while
tears trembled in his dark eyes, “Jehovah hath abundantly blessed
me. I see my offspring, like the sand on the seashore—children and
children’s children, to the number of fifty souls!”
This aged pair had not for several years gone up to the festival:
but their children had now persuaded them to appear once more
before Jehovah. They had been the last in the procession, and their
sons and daughters had been obliged almost to carry them in their
arms—a burthen which they had joyfully sustained—for they had
refused either to ride or be conveyed in a carriage. “Where could a
psalm of degrees be more in its place?” said a lively youth of the
company. At the word several of them ran to fetch their musical
instruments, and standing around the deeply moved old man, they
sung the following psalm:
Blessed is every one that feareth Jehovah,
That walketh in his ways.
For thou shalt eat of the labour of thy hands:
Happy art thou, and it is well with thee!
Thy wife is a fruitful vine, by the walls of thine house,
Thy children, like olive plants around thy table.
Behold, thus shall the man be blessed that feareth Jehovah:
Jehovah will bless thee out of Zion.
Thou shalt see the prosperity of Jerusalem thine whole life long,
Yea, thou shalt see thy children’s children.
Peace be upon Israel!—Ps. cxxviii.

During this time others had come up, and soon the news was
spread through the whole assemblage, that Mardochai of Ziph was
once more among them; and nearly all the pilgrims came and
formed a circle about him. The judges and elders of Hebron were
among them, and all greeted the venerable pair and wished them
peace.
“Ye shall lead the procession!” said an elder of Hebron! “The place
of honour belongs to you. The pilgrims of Hebron cannot advance
with any blessing better or more rare.”
The sons took their father, the daughters their mother, in their
arms, the priests and elders followed, and the march began again to
complete the ten sabbath-days’ journies which they were still distant
from Jerusalem.
Far from the expressions of joy being exhausted by all the songs
and acclamations of the morning, they seemed only to be beginning,
when they set forward again. From the pools of Solomon they took
their way through the hills to Bethlehem. The cymbals, cornets, and
timbrels of the Levites struck up their music again, and many a soul-
inspiring psalm was heard from the lips of an assemblage now
swollen to several thousand persons. In a pilgrimage to the temple,
could he be forgotten, whose pious heart first conceived the wish to
build a house for Jehovah? The warrior-bard was commemorated in
the following psalm:
Lord remember David!
All his afflictions.
How he sware unto the Lord
And vowed unto the Mighty One of Jacob;
Surely I will not go into mine house,
Nor go up into my bed;
I will not give sleep to mine eyes,
Nor slumber to mine eyelids,
Until I find out a place for the Lord,
A habitation for the Mighty One of Jacob.
Lo, we heard of it at Ephratah,
We found it in the fields of Jaar:
Let us go into his tabernacle,
Let us worship at his footstool!—Ps. cxxxii.

It seemed as if the multitude could not leave the last strophe,


which they repeated over and over again. They then went on to the
second part of the psalm, which was probably sung at the dedication
of the temple, and repeated in the same way the elevating words
with which it concludes,

Jehovah hath chosen Zion,


He hath desired it for his habitation.

The instruments now struck in with a louder tone, and the


multitude lifted up its voice, as the words of Jehovah were repeated.
This is my rest for ever;
Here will I dwell: for I have chosen it.
I will abundantly bless her provision,
I will satisfy her poor with bread;
I will clothe her priests with salvation,
Her holy ones shall shout aloud for joy.
There will I exalt the might of David
And prepare a lamp for mine anointed.
His enemies will I clothe with shame,
But on his head shall the crown flourish.

Proceeding in this way they reached Bethlehem Ephratah, “little


among the thousands of Judah,” and yet so highly honoured. Both
its names allude to the fertility of the country in which it stands.
Bethlehem signifies the place of bread; and Ephratah, fruitful. In its
luxuriant pastures Jacob fed his flocks; in its fertile fields Boaz was
reaping when he found his kinswoman Ruth. Here his seven sons
were born to Jesse, and here the man after God’s own heart grew
up, till the day when he came forth to avenge the honour of his
people on the boastful heathen.
Bethlehem is a small town, six sabbath-days’ journies from the
holy city. It is situated upon a narrow, rocky ridge, surrounded by
vallies and hills, having an extensive view over the diversified
country in its neighbourhood, the region around Jericho, the Dead
Sea, and the Arabian mountains. Before its gates you look to the
plain of the valley of Rephaim, and all around is the garden of God.
The Kedron flows through its fruitful fields, which are thickly set with
olives and figtrees, with vines and corn. But its greatest glory is that
of which Micah prophetically speaks, “And thou Bethlehem Ephratah,
who art little among the thousands of Judah, out of thee shall he
come forth that is to be Ruler in Israel, whose goings forth have
been from of old, from everlasting.”[102]
In Bethlehem they met with another company of pilgrims, coming
from Lachish, Adullam, and Libna, which lie westward of Bethlehem.
All who could, endeavoured to make Bethlehem in their way to
Jerusalem on these occasions. It was the city of David, the road
passed by the grave of Rachel, and it was dear to many, as the city
to which the greatest of all the promises had been given.
The elders of the different cities had soon agreed about the order
of the march from Bethlehem to Jerusalem. The venerable pair,
Mardochai of Ziph and his wife, were borne before, the elders
followed, but without any distinctive badge, and the people arranged
themselves as they chose. Some time, however, elapsed before they
set out. There were greetings of friends and acquaintance, who met
after a long interval; those who had travelled furthest needed
refreshment. At length the Levites began their music and their
songs, and the people set forward. They had soon descended from
the heights of Bethlehem into the valley of Rephaim. As the living
stream poured down from the hills, among the corn-fields and
mulberry-groves of the vale, this was the praise of Jerusalem which
ascended in a mingled strain of voices and instruments.

They that trust in the Lord shall be as mount Zion,


Which cannot be removed, but abideth for ever.
As the mountains are around Jerusalem,
So the Lord is round about his people,
From henceforth and for evermore:
For the sceptre of the wicked shall not remain on the lot of the
righteous.
Do good, O Lord, unto those that are good,
To them that are upright in their hearts!
As for those that turn aside into crooked ways,
Jehovah shall destroy them, with all the workers of iniquity.
Peace be upon Israel!—Ps. cxxv.

When they had proceeded about two sabbath-days’ journies, or a


little more, from Bethlehem, they approached the grave of Rachel.
[103]
At another time this place of the rest of Jacob’s beloved wife,
the hardly earned recompense of his labours, might have produced
some melancholy emotions, but now such thoughts were banished
by the universal joy. Helon remarked to Elisama, that this was not
the time of which their prophet had spoken: “In Rama was heard a
voice, lamentation and bitter weeping; Rachel weeping for her
children.”[104] “May it be always so with the children of Israel,” replied
Elisama.
The eager haste of the multitudes now increased with every step,
and their impatience for the first sight of Jerusalem was expressed in
the following psalm:

Great is the Lord; and greatly to be praised


The mountain of his holiness in the city of our God.
Beautiful for situation, the joy of the whole land
Is mount Zion, on the north of the city of the great King.
God is known in her palaces for a refuge,
We think of thy loving-kindness, O God,
In the midst of thy temple.
As thy name, so thy praise reacheth to the ends of the earth.
Thy right hand is full of righteousness.
Let the hill of Zion rejoice,
Let the daughters of Judah be glad
Because of thy judgments!
Walk about Zion, go round about her!
Tell her towers!
Mark well her bulwarks!
Consider her palaces!
That ye may tell it to the generation following.
For this God is our God, for ever and ever.
He will be our guide, as in our youth.—Ps. xlviii.

Expectation had reached the highest pitch. The last strophes were
not completely sung; many were already silent, eagerly watching for
the first sight of Jerusalem. All eyes were turned towards the north;
a faint murmur spread from rank to rank among the people, only
those who had been at the festival before continued the psalm, and
these solitary scattered voices formed a solemn contrast with the
silence of the rest of the multitude. Helon’s heart was in his eye, and
he could scarcely draw his breath. When the psalm was concluded,
the instruments prolonged the sound for a moment, and then all
that mighty multitude, so lately jubilant, was still as death.
All at once the foremost ranks exclaimed, Jerusalem, Jerusalem!
Jerusalem, Jerusalem! resounded through the valley of Rephaim.
“Jerusalem, thou city built on high, we wish thee peace!” The
children dragged their parents forward with them, and all hands
were lifted up to bless.
The high white walls of the Holy City cast a gleam along the
valley: Zion arose with its palaces, and from Moriah the smoke of the
offering was ascending to heaven. It was the hour of the evening
sacrifice. Scarcely had the multitude recovered a little, when they
began to greet the temple and the priests:

Bless ye the Lord, all ye servants of the Lord,


Who stand by night in the house of the Lord!
Lift up your hands towards the sanctuary,
And bless the Lord.
So will Jehovah bless thee out of Zion;
He who made heaven and earth.—Ps. cxxxiv.

They had now reached the termination of their march. The day of
preparation was beginning; the following evening was the Passover.
From the gates of Jerusalem came forth, in every direction, the
pilgrims who had already arrived and the inhabitants of the city, to
welcome the new comers from Hebron and from Libna. The
venerable pair, Mardochai of Ziph and his wife, who were still borne
in front, received the blessings of all who met them.
Close by the gate, some one from behind laid hold of Elisama; “Art
thou Elisama of Alexandria?” Elisama turned round and recognised
Iddo, an old and faithful friend of his family. The old men met with
inexpressible delight, and Elisama presented Helon to Iddo. The
pilgrims had now reached the city, and were dispersing in different
directions to their respective quarters. Iddo conducted the strangers
through the Water-gate to his house on the open place.
CHAPTER III.
THE DAY OF PREPARATION FOR THE PASSOVER.

Their reception in the house of Iddo surpassed all Helon’s


expectations. At the seasons of the festivals, no inhabitant of
Jerusalem considered his house as his own. Their city was the city of
the whole people, not of the inhabitants alone; and when Israel
came up to appear before Jehovah, every citizen regarded his
dwelling as belonging to his brethren as much as to himself.
Jerusalem lies on the confines of Judah and Benjamin. Its names,
the Holy City, the City of the Congregation of Israel, the Gate of the
People, point out its destination. No other city was ever in the same
sense the capital and centre of a country.
“You are at home,” said their host, as he led them into his house;
“and at this time, I am not more so than you. The citizen of
Jerusalem considers himself, equally with his brethren, as a pilgrim
at the festival.”
In fact the whole house was filled with strangers. Elisama found
among them many old acquaintances—but great was his joy when
he discovered, in the number, Selumiel of Jericho, the brother of
Iddo. His emotion overpowered his utterance, and he could only
press him silently, and with tears in his eyes, to his breast. Selumiel
had been the dearest friend of his youth; he had lived long in
Alexandria, and they had spent the earliest days of manhood there
together; they had imparted each to the other all their youthful
plans. At a later period they had been separated, and had not met
for more than thirty years: but their hearts had remained united,
and their joy at meeting was mutual. Elisama seemed to be changed
by the sight of him, as if youth itself had returned with the friend of
his youth.
While the feet of the guests were washing, which is the first duty
of hospitality in the East, and indeed properly their welcome,
Elisama and Selumiel were engaged in uninterrupted discourse, as if
they had been sitting alone in the court, and rapidly ran over earlier
and later times, Alexandria and Jericho. In the mean time Iddo and
some of the guests had joined Helon, and were congratulating him
upon his first pilgrimage. Selumiel and Iddo had in common a hearty
and straight forward character, by which they might have been
known as brothers. But, besides that they were attached to different
parties in religion, Iddo had more liveliness and cheerfulness. “My
son out of Egypt,” he addressed Helon, “to-morrow at this time,
when the Passover begins, thou wilt see what thou hast never seen
before. Already, on the tenth of the month, I chose a lamb without
blemish for the occasion. Before sunset this evening, I fetched the
water into the house, with which the unleavened bread is to be
made. If you please you shall go with me after supper and seek the
leaven in the house. A young Israelite, who has come for the first
time to the Passover, should leave nothing unseen, but learn all the
practices of Israel in the most complete manner possible. But I
forgot, you are come from Hebron to-day, and must be weary.”
Helon seemed almost offended to be suspected of weariness, after
a march made under such circumstances. With glowing cheek he
repelled the imputation, and begged that Iddo would not spare him.
“Just like his father,” exclaimed his host, “jealous of nothing so
much as of being thought a genuine Aramæan Jew. To-morrow, I
will conduct thee to his grave in the valley of Jehoshaphat. In truth
he was a noble-minded man, an Israelite without guile. He died in
this house, and it was of thee, Helon, that he spoke to me in his last
moments.” He then related the circumstances of his death, and
many anecdotes of his intercourse with him. Their connection had
been much the same as that of Selumiel with Elisama. Helon listened
to him, as if his father’s spirit spoke from his lips, so intimate had
been their friendship, so similar their characters.
In such discourse the time passed rapidly, and a servant came to
call the guests from the cooling fountain of the inner court to the
roof, where they were to sup. Here Iddo was accustomed to
entertain his guests at the festival, when there was any one among
them, on whom the spectacle, beheld for the first time, was likely to
make an indelible impression. It was a fine, clear, cloudless night.
The moon shone sweetly upon Jerusalem and changed the night to
a softer and cooler day than that which had been twelve hours
before. A breeze from the Mount of Olives cooled the heated air. The
neighbours had in like manner brought their guests to sup on the
roofs of their houses, and as far as the eye could reach on every
side, feasting and illumination were seen. A busy hum ascended
from the streets beneath, and the white tents glistened in the valley
of Kedron.
What a scene! The whole environs of Jerusalem were turned into
an encampment, all the hills and vallies, all the streets and open
places were covered with tents. It was impossible that the houses
should contain all the strangers, notwithstanding the unbounded
hospitality which was practised on these occasions, and hence it was
necessary that a large proportion of them should remain in tents
during the festival. In the pleasant season of the year, at which the
Passover was held, this had nothing inconvenient or disagreeable in
it; it was the universal custom at the feast of tabernacles, and it
reminded them of the patriarchal life, and the wandering in the
desert. This gave to Jerusalem a singular but very interesting
appearance. All was motion, life and animation, and the thought of
the purpose for which these myriads of men had come up from near
or distant regions, filled the mind with solemn and elevated feeling.
A million of human beings have frequently been assembled here on
such an occasion, all for the purpose of appearing with prayer and
praise before Jehovah.
Carried away by the sight, Helon involuntarily exclaimed,
Behold how good and how pleasant it is
For brethren to dwell together in unity!
It is like the precious ointment upon the head of Aaron,
That ran down upon his beard,
That went down to the skirts of his garments.
So the dew of Hermon descends
Upon the hills of Zion:
For there hath Jehovah commanded his blessing,
Prosperity for ever more!—Ps. cxxxiii.

The guests gazed on him with surprise. “Why,” continued Helon,


“do you not see before your eyes the application of the psalm? On
such an evening as this, or at least in the view of such a spectacle
as this, must it have been composed. Is it not the dew of Hermon,—
are not these the sons of Israel from the Tyrian Climax and the plain
of Jesreel, which fall here on the hills of Zion?”
“Listen!” said Iddo. Through the uproar of the streets they could
discern a distant sound of cymbals, trumpets, and song, which came
in the direction of the New City. “The Galileans are entering by the
gate of Ephraim; they are late; and yet they cannot this time have
been obstructed by the Samaritans; Hyrcanus has removed that
obstacle from their way.” The distant sound of music and song,
heard in this calm, soft night, seemed to Helon even more beautiful
than the jubilation with which the march from Bethlehem had been
attended. Penetrating through all the tumult of the city, which he
heard not as he drank them in, the spiritual and ethereal tones
seemed to him almost like the heavenly host, when they ascend
from earth, to keep an eternal festival before the presence of
Jehovah. On such an evening, what flight of imagination could be
too bold for a youth of such enthusiastic temperament?
The guests had laid themselves down upon the carpets, when
Iddo took Helon by the arm. Elisama had been compelled to occupy
the place of honour, and Selumiel and he were inseparable. “You will
stay by me,” said his host to Helon, “and we will occupy as is
becoming, the lowest place. Look down below on the square; there
it was that Ezra once stood, when the people returned from the
captivity, and read the law to them.”
“I remember it,” said Helon; “it is written, Ezra read upon the open
place before the Water-gate, from the morning until mid-day, and
praised the Lord the great God; and the people answered Amen,
Amen, with lifting up their hands, and bowed their heads and
worshipped the Lord with their faces to the ground.”[105]
“Often have I stood here,” said Iddo, “contemplating that spot,
with this history in my mind, and have thought, with gratitude to
Jehovah who has delivered his people, on that Amen, sent up by the
assembled multitude, lifting their hands to heaven. But let us eat
and be merry.”
Their mirth was such as suited the age and the piety of the
company, and their enjoyment was heightened by the expressions of
joy which they heard all around them. The old men discoursed of
the felicity of the times, and the glorious reign of Hyrcanus; above
all, of the victory which his sons had obtained over the Samaritans,
and the destruction of the abomination of Gerizim.
In the mean time the master of the house called upon his younger
guests to assist him in purifying his house from the leaven. This was
the evening of the fourteenth day of the month Nisan, the
preparation day for the Passover. Lest the command of Jehovah, to
eat unleavened bread for seven days, and to allow no leaven to be
seen any where, should chance to be violated, they performed the
ceremony of putting away the leaven on this evening. The master of
the family gave each of his guests a torch, and led them in a solemn
procession through the house. He had himself a dish and a brush in
his hand, and he said “Praised be thou, O Lord our God, king of the
world, who hast sanctified us by thy precepts, and hast enjoined
upon us to put away the leaven.” All present said Amen. They then
proceeded to examine every corner of the house, opening every
drawer, chest, and cupboard. Here and there lay a piece of leavened
bread, purposely left in the way; the master took it up, laid it in his
dish, and carefully swept the place. When the company had gone
round the house, to the outer door, he said, “Whatsoever leavened
thing there is in my house, which I have not seen nor put away, may
it be scattered in pieces and accounted as the dust of the earth.”
The search had lasted two hours; the dish was locked up, and the
guests retired to sleep.
Unable, however, to obtain sleep, from the crowd of feelings which
coursed each other through his mind, when he thought that he was
at length in Jerusalem, in the Holy City, Helon was one of the first
who arose. He went immediately to the roof of the house—the Alijah
was open; he entered it and performed his morning devotions, with
a fervour which he had never felt before, put the Tallith on his head,
bound the Tephillim on his brow and his hand, and recited the Kri-
schma. His whole body was in agitation; now he lifted his hand
towards heaven, now threw himself on his face on the ground, now
bent his head to the middle of his body. In the earnestness of his
prayer he seemed to wrestle with God. Here in the Holy City, how
much had he to ask from the God of his fathers!
When his prayer was ended, and he came out upon the roof, he
looked down upon Jerusalem, which now lay before him in all the
brightness of daylight. As yet all was still; even from the temple,
which rose in elevated majesty above the towers and palaces of the
city, no sound was to be heard. The loud tumult of the strangers on
the preceding evening was hushed, and it seemed as if the repose
which announced the vicinity of the sanctuary, had diffused itself
around and reduced all to silence. All the lofty emotions of his heart
returned with equal strength, but not the same impetuosity as on
the preceding evening. His inward delight was even greater, but it
was calm and holy. He felt that near the presence of Jehovah, in the
solemn assembly of his people, on the spot where the noblest and
wisest of his countrymen had met together for such high purposes,
his joy ought to be tranquil and sober, and the emotion, thus driven
back upon the heart, only became the deeper and more vivid.
Helon felt that this was his initiation into a new life. When the day
dawns, on which all the visions of childhood and the dreams of
youth are about to be fulfilled—to which the man awakes, in the firm
belief that it will realize every thing for which his heart has longed,
there is a stillness, an earnest expectation, a humble confidence
which take possession of such a youthful bosom, from which it is
easily anticipated, that a period decisive for the formation of the
character has arrived, and that what is now felt and done will have a
predominating influence over all the future life.
Sallu came to him, to ask his commands. When he had received
them, he remained standing a little while and said, “Master, I am
only a servant in Israel, but I too am of the seed of Abraham, and I
feel that this is the land of our fathers and of their God. Let us not
return into Egypt!”
When Elisama arose, his first occupation was to open the baggage
and take out thence the presents destined for his host. It was his
rule never to come empty-handed, and on this occasion he had
indeed come with his hands full. To the mistress of the house he
sent all that remained, and it was no trifling store, of the provisions
for the journey, some skins of delicious Chian wine, which he had
purchased in the caravan, and a quantity of the finest Egyptian linen.
To Iddo he gave a turban curiously wrought, of a costly stuff, and an
Alexandrian robe of ceremony, informing him that it had been his
brother-in-law's, and that his sister had destined it for him.
To Selumiel he carried a book. It consisted of several pieces of
papyrus, the stalk of which is divided with a needle into thin leaves,
which are then laid together and fastened with the water of the Nile.
Several of them were then laid upon each other and fitted together,
and on these oblong leaves the book was written. It was an
Egyptian invention and very highly prized. “I have brought you,” said
he to Selumiel, “the Hebrew work of Jesus Sirach, the same which
his grandson has translated into Greek. It is highly esteemed in
Egypt both by Jews and heathens. I could easily have procured a
transcript of the Greek version, from one of our literati in the
Bruchion; but that would not have answered my purpose; it was
with difficulty that I could obtain this copy of the Hebrew. I give it
thee for the sake of the passage on friendship. Read here; ‘A faithful
friend is the medicine of life, and they who fear the Lord shall find
him. For he who feareth the Lord shall be happy in his friendship,
and as he is, such shall his friend be also.’[106] And here too, ‘Forsake
not an old friend.’” Selumiel smiled, a thing which he rarely did, and
said, “I accept the present, on the condition that you come to
Jericho with me, in order that I may be able to return it.” “We shall
see,” said Elisama, “but in so doing I should be giving little, to
receive much in return.” “Friendship,” said Selumiel, “has all things in
common.”
As our travellers came from a heathen land, it was necessary they
should be purified before they could go into the temple. This would
have prevented Helon from attending at the morning sacrifice, and
besides he wished first to discharge a duty of filial piety, and to visit
the grave of his father, before he appeared in the presence of
Jehovah, whom his father had taught him to honour.
When the ceremonies of bathing, cutting off the hair, and others in
which purification consisted, were over, he went forth to the valley of
Jehoshaphat, to his father’s tomb. It was by his own dying request
that he had been interred there; for Iddo would fain have given him
a place in the sepulchre of his own family. From the words of the
prophet Joel, “I will gather all nations, and will bring them down to
the valley of Jehoshaphat, and will plead with them there for my
people,”[107] it had become a prevalent opinion, that this would be
the scene of the general resurrection and of the judgment of
Jehovah, and therefore many of the Jews wished to be buried there.
It took its name from the king Jehoshaphat, who was said to have
been interred in that place.
Iddo, Elisama, and Selumiel accompanied Helon. Leaving the city
by the Water-gate, they turned to the south-east and kept along the
brook Kedron. Willows and tall cedars threw their shadows upon the
graves. They wandered silently along the Kedron, till they saw a
large stone, such as the Jews are accustomed to place upon every
grave, as a warning rather than a monument, to prevent the
passers-by from defiling themselves unawares. To-day especially, it
was necessary for them to keep at a distance of several paces from
it, if they would not render themselves so far unclean, as to
incapacitate them for taking any part in the religious rites of the day.
Helon felt an irresistible impulse to throw himself upon the grave,
but the others forcibly held him back. Tears streamed from his eyes
as he incessantly exclaimed, “My father! my father!” With head and
breast inclined forward he was supported by his companions,
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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like