PDF Professional C 5th Edition Marc Gregoire download
PDF Professional C 5th Edition Marc Gregoire download
com
https://ebookmeta.com/product/professional-c-5th-edition-
marc-gregoire/
OR CLICK BUTTON
DOWNLOAD NOW
https://ebookmeta.com/product/professional-c-6th-edition-marc-
gregoire/
ebookmeta.com
https://ebookmeta.com/product/professional-c-6th-edition-gregoire/
ebookmeta.com
https://ebookmeta.com/product/linkedin-marketing-techniques-for-law-
and-professional-practices-2nd-edition-marc-w-halpert/
ebookmeta.com
https://ebookmeta.com/product/designs-from-linear-codes-2nd-edition-
cunsheng-ding/
ebookmeta.com
Introduction to Quantum Control and Dynamics (Advances in
Applied Mathematics) 2nd Edition Domenico D’Alessandro
https://ebookmeta.com/product/introduction-to-quantum-control-and-
dynamics-advances-in-applied-mathematics-2nd-edition-domenico-
dalessandro/
ebookmeta.com
https://ebookmeta.com/product/human-tooth-crown-and-root-morphology-
the-arizona-state-university-dental-anthropology-system-g-richard-
scott/
ebookmeta.com
https://ebookmeta.com/product/acid-revival-the-psychedelic-
renaissance-and-the-quest-for-medical-legitimacy-1st-edition-giffort/
ebookmeta.com
https://ebookmeta.com/product/congratulations-the-best-is-over-
essays-1st-edition-r-eric-thomas-2/
ebookmeta.com
Romance with Voluptuousness Caribbean Women and Thick
Bodies in the United States 1st Edition Kamille Gentles
Peart
https://ebookmeta.com/product/romance-with-voluptuousness-caribbean-
women-and-thick-bodies-in-the-united-states-1st-edition-kamille-
gentles-peart/
ebookmeta.com
Table of Contents
COVER
TITLE PAGE
COPYRIGHT
DEDICATION
ABOUT THE AUTHOR
ABOUT THE TECHNICAL EDITORS
ACKNOWLEDGMENTS
INTRODUCTION
WHO THIS BOOK IS FOR
WHAT THIS BOOK COVERS
HOW THIS BOOK IS STRUCTURED
CONVENTIONS
WHAT YOU NEED TO USE THIS BOOK
READER SUPPORT FOR THIS BOOK
PART I: Introduction to Professional C++
1 A Crash Course in C++ and the Standard Library
C++ CRASH COURSE
YOUR FIRST BIGGER C++ PROGRAM
SUMMARY
EXERCISES
Notes
2 Working with Strings and String Views
DYNAMIC STRINGS
STRING FORMATTING
SUMMARY
EXERCISES
Notes
3 Coding with Style
THE IMPORTANCE OF LOOKING GOOD
DOCUMENTING YOUR CODE
DECOMPOSITION
NAMING
USING LANGUAGE FEATURES WITH STYLE
FORMATTING
STYLISTIC CHALLENGES
SUMMARY
EXERCISES
Notes
PART II: Professional C++ Software Design
4 Designing Professional C++ Programs
WHAT IS PROGRAMMING DESIGN?
THE IMPORTANCE OF PROGRAMMING DESIGN
DESIGNING FOR C++
TWO RULES FOR YOUR OWN C++ DESIGNS
REUSING EXISTING CODE
DESIGNING A CHESS PROGRAM
SUMMARY
EXERCISES
5 Designing with Objects
AM I THINKING PROCEDURALLY?
THE OBJECT-ORIENTED PHILOSOPHY
LIVING IN A WORLD OF CLASSES
CLASS RELATIONSHIPS
SUMMARY
EXERCISES
6 Designing for Reuse
THE REUSE PHILOSOPHY
HOW TO DESIGN REUSABLE CODE
SUMMARY
EXERCISES
PART III: C++ Coding the Professional Way
7 Memory Management
WORKING WITH DYNAMIC MEMORY
ARRAY-POINTER DUALITY
LOW-LEVEL MEMORY OPERATIONS
COMMON MEMORY PITFALLS
SMART POINTERS
SUMMARY
EXERCISES
Notes
8 Gaining Proficiency with Classes and Objects
INTRODUCING THE SPREADSHEET EXAMPLE
WRITING CLASSES
UNDERSTANDING OBJECT LIFE CYCLES
SUMMARY
EXERCISES
Notes
9 Mastering Classes and Objects
FRIENDS
DYNAMIC MEMORY ALLOCATION IN OBJECTS
MORE ABOUT METHODS
DIFFERENT KINDS OF DATA MEMBERS
NESTED CLASSES
ENUMERATED TYPES INSIDE CLASSES
OPERATOR OVERLOADING
BUILDING STABLE INTERFACES
SUMMARY
EXERCISES
10 Discovering Inheritance Techniques
BUILDING CLASSES WITH INHERITANCE
INHERITANCE FOR REUSE
RESPECT YOUR PARENTS
INHERITANCE FOR POLYMORPHISM
MULTIPLE INHERITANCE
INTERESTING AND OBSCURE INHERITANCE
ISSUES
CASTS
SUMMARY
EXERCISES
11 Odds and Ends
MODULES
HEADER FILES
FEATURE TEST MACROS FOR CORE LANGUAGE
FEATURES
THE STATIC KEYWORD
C UTILITIES
SUMMARY
EXERCISES
12 Writing Generic Code with Templates
OVERVIEW OF TEMPLATES
CLASS TEMPLATES
FUNCTION TEMPLATES
VARIABLE TEMPLATES
CONCEPTS
SUMMARY
EXERCISES
13 Demystifying C++ I/O
USING STREAMS
STRING STREAMS
FILE STREAMS
BIDIRECTIONAL I/O
FILESYSTEM SUPPORT LIBRARY
SUMMARY
EXERCISES
14 Handling Errors
ERRORS AND EXCEPTIONS
EXCEPTION MECHANICS
EXCEPTIONS AND POLYMORPHISM
RETHROWING EXCEPTIONS
STACK UNWINDING AND CLEANUP
COMMON ERROR-HANDLING ISSUES
SUMMARY
EXERCISES
15 Overloading C++ Operators
OVERVIEW OF OPERATOR OVERLOADING
OVERLOADING THE ARITHMETIC OPERATORS
OVERLOADING THE BITWISE AND BINARY
LOGICAL OPERATORS
OVERLOADING THE INSERTION AND
EXTRACTION OPERATORS
OVERLOADING THE SUBSCRIPTING OPERATOR
OVERLOADING THE FUNCTION CALL OPERATOR
OVERLOADING THE DEREFERENCING
OPERATORS
WRITING CONVERSION OPERATORS
OVERLOADING THE MEMORY ALLOCATION AND
DEALLOCATION OPERATORS
OVERLOADING USER-DEFINED LITERAL
OPERATORS
SUMMARY
EXERCISES
16 Overview of the C++ Standard Library
CODING PRINCIPLES
OVERVIEW OF THE C++ STANDARD LIBRARY
SUMMARY
EXERCISES
17 Understanding Iterators and the Ranges Library
ITERATORS
STREAM ITERATORS
ITERATOR ADAPTERS
RANGES
SUMMARY
EXERCISES
18 Standard Library Containers
CONTAINERS OVERVIEW
SEQUENTIAL CONTAINERS
CONTAINER ADAPTERS
ORDERED ASSOCIATIVE CONTAINERS
UNORDERED ASSOCIATIVE CONTAINERS OR
HASH TABLES
OTHER CONTAINERS
SUMMARY
EXERCISES
19 Function Pointers, Function Objects, and Lambda
Expressions
FUNCTION POINTERS
POINTERS TO METHODS (AND DATA MEMBERS)
std::function
FUNCTION OBJECTS
LAMBDA EXPRESSIONS
INVOKERS
SUMMARY
EXERCISES
20 Mastering Standard Library Algorithms
OVERVIEW OF ALGORITHMS
ALGORITHM DETAILS
SUMMARY
EXERCISES
21 String Localization and Regular Expressions
LOCALIZATION
REGULAR EXPRESSIONS
SUMMARY
EXERCISES
22 Date and Time Utilities
COMPILE-TIME RATIONAL NUMBERS
DURATION
CLOCK
TIME POINT
DATE
TIME ZONE
SUMMARY
EXERCISES
23 Random Number Facilities
C-STYLE RANDOM NUMBER GENERATION
RANDOM NUMBER ENGINES
RANDOM NUMBER ENGINE ADAPTERS
PREDEFINED ENGINES AND ENGINE ADAPTERS
GENERATING RANDOM NUMBERS
RANDOM NUMBER DISTRIBUTIONS
SUMMARY
EXERCISES
24 Additional Library Utilities
VOCABULARY TYPES
TUPLES
SUMMARY
EXERCISES
PART IV: Mastering Advanced Features of C++
25 Customizing and Extending the Standard Library
ALLOCATORS
EXTENDING THE STANDARD LIBRARY
SUMMARY
EXERCISES
Notes
26 Advanced Templates
MORE ABOUT TEMPLATE PARAMETERS
CLASS TEMPLATE PARTIAL SPECIALIZATION
EMULATING FUNCTION PARTIAL
SPECIALIZATION WITH OVERLOADING
TEMPLATE RECURSION
VARIADIC TEMPLATES
METAPROGRAMMING
SUMMARY
EXERCISES
27 Multithreaded Programming with C++
INTRODUCTION
THREADS
ATOMIC OPERATIONS LIBRARY
MUTUAL EXCLUSION
CONDITION VARIABLES
LATCHES
BARRIERS
SEMAPHORES
FUTURES
EXAMPLE: MULTITHREADED LOGGER CLASS
THREAD POOLS
COROUTINES
THREADING DESIGN AND BEST PRACTICES
SUMMARY
EXERCISES
PART V: C++ Software Engineering
28 Maximizing Software Engineering Methods
THE NEED FOR PROCESS
SOFTWARE LIFE CYCLE MODELS
SOFTWARE ENGINEERING METHODOLOGIES
BUILDING YOUR OWN PROCESS AND
METHODOLOGY
SOURCE CODE CONTROL
SUMMARY
EXERCISES
29 Writing Efficient C++
OVERVIEW OF PERFORMANCE AND EFFICIENCY
LANGUAGE-LEVEL EFFICIENCY
DESIGN-LEVEL EFFICIENCY
PROFILING
SUMMARY
EXERCISES
30 Becoming Adept at Testing
QUALITY CONTROL
UNIT TESTING
FUZZ TESTING
HIGHER-LEVEL TESTING
TIPS FOR SUCCESSFUL TESTING
SUMMARY
EXERCISES
31 Conquering Debugging
THE FUNDAMENTAL LAW OF DEBUGGING
BUG TAXONOMIES
AVOIDING BUGS
PLANNING FOR BUGS
DEBUGGING TECHNIQUES
SUMMARY
EXERCISES
32 Incorporating Design Techniques and Frameworks
“I CAN NEVER REMEMBER HOW TO…”
THERE MUST BE A BETTER WAY
OBJECT-ORIENTED FRAMEWORKS
SUMMARY
EXERCISES
33 Applying Design Patterns
DEPENDENCY INJECTION
THE ABSTRACT FACTORY PATTERN
THE FACTORY METHOD PATTERN
THE ADAPTER PATTERN
THE PROXY PATTERN
THE ITERATOR PATTERN
THE OBSERVER PATTERN
THE DECORATOR PATTERN
THE CHAIN OF RESPONSIBILITY PATTERN
THE SINGLETON PATTERN
SUMMARY
EXERCISES
34 Developing Cross-Platform and Cross-Language
Applications
CROSS-PLATFORM DEVELOPMENT
CROSS-LANGUAGE DEVELOPMENT
SUMMARY
EXERCISES
PART VI: Appendices
A C++ Interviews
CHAPTER 1: A CRASH COURSE IN C++ AND THE
STANDARD LIBRARY
CHAPTERS 2 AND 21: WORKING WITH STRINGS
AND STRING VIEWS, STRING LOCALIZATION AND
REGULAR EXPRESSIONS
CHAPTER 3: CODING WITH STYLE
CHAPTER 4: DESIGNING PROFESSIONAL C++
PROGRAMS
CHAPTER 5: DESIGNING WITH OBJECTS
CHAPTER 6: DESIGNING FOR REUSE
CHAPTER 7: MEMORY MANAGEMENT
CHAPTERS 8 AND 9: GAINING PROFICIENCY WITH
CLASSES AND OBJECTS, AND MASTERING
CLASSES AND OBJECTS
CHAPTER 10: DISCOVERING INHERITANCE
TECHNIQUES
CHAPTER 11: ODDS AND ENDS
CHAPTERS 12 AND 26: WRITING GENERIC CODE
WITH TEMPLATES, AND ADVANCED TEMPLATES
CHAPTER 13: DEMYSTIFYING C++ I/O
CHAPTER 14: HANDLING ERRORS
CHAPTER 15: OVERLOADING C++ OPERATORS
CHAPTERS 16–20 AND 25: THE STANDARD
LIBRARY
CHAPTER 22: DATE AND TIME UTILITIES
CHAPTER 23: RANDOM NUMBER FACILITIES
CHAPTER 24: ADDITIONAL LIBRARY UTILITIES
CHAPTER 27: MULTITHREADED PROGRAMMING
WITH C++
CHAPTER 28: MAXIMIZING SOFTWARE
ENGINEERING METHODS
CHAPTER 29: WRITING EFFICIENT C++
CHAPTER 30: BECOMING ADEPT AT TESTING
CHAPTER 31: CONQUERING DEBUGGING
CHAPTER 32: INCORPORATING DESIGN
TECHNIQUES AND FRAMEWORKS
CHAPTER 33: APPLYING DESIGN PATTERNS
CHAPTER 34: DEVELOPING CROSS-PLATFORM
AND CROSS-LANGUAGE APPLICATIONS
B Annotated Bibliography
C++
UNIFIED MODELING LANGUAGE
ALGORITHMS AND DATA STRUCTURES
RANDOM NUMBERS
OPEN-SOURCE SOFTWARE
SOFTWARE ENGINEERING METHODOLOGY
PROGRAMMING STYLE
COMPUTER ARCHITECTURE
EFFICIENCY
TESTING
DEBUGGING
DESIGN PATTERNS
OPERATING SYSTEMS
MULTITHREADED PROGRAMMING
C Standard Library Header Files
THE C STANDARD LIBRARY
CONTAINERS
ALGORITHMS, ITERATORS, RANGES, AND
ALLOCATORS
GENERAL UTILITIES
MATHEMATICAL UTILITIES
EXCEPTIONS
I/O STREAMS
THREADING SUPPORT LIBRARY
D Introduction to UML
DIAGRAM TYPES
CLASS DIAGRAMS
INTERACTION DIAGRAMS
INDEX
END USER LICENSE AGREEMENT
List of Illustrations
Chapter 1
FIGURE 1-1
FIGURE 1-2
FIGURE 1-3
Chapter 2
FIGURE 2-1
Chapter 3
FIGURE 3-1
FIGURE 3-2
FIGURE 3-3
Chapter 4
FIGURE 4-1
FIGURE 4-2
FIGURE 4-3
FIGURE 4-4
FIGURE 4-5
FIGURE 4-6
FIGURE 4-7
FIGURE 4-8
Chapter 5
FIGURE 5-1
FIGURE 5-2
FIGURE 5-3
FIGURE 5-4
FIGURE 5-5
FIGURE 5-6
FIGURE 5-7
FIGURE 5-8
FIGURE 5-9
FIGURE 5-10
FIGURE 5-11
FIGURE 5-12
Chapter 6
FIGURE 6-1
FIGURE 6-2
Chapter 7
FIGURE 7-1
FIGURE 7-2
FIGURE 7-3
FIGURE 7-4
Other documents randomly have
different content
colonies, leading them to covet a rapid increase in population,
contributed to this sentiment.
At the same time, there can be no doubt that there was a decided
preference for colonists over immigrants. This was partly due to a
natural race prejudice, but it was augmented by the character of the
immigrants at that time. Considering the nature of the conditions
which led to emigration from both Ireland and Germany, it is not
surprising that a majority of the newcomers were characterized by
extreme destitution. As might also be expected from the frightful
shipping conditions which then existed, many of them arrived in
wretched condition physically. The voyage was long, the ships were
small, poorly ventilated, shockingly overcrowded, and totally
unprovided with adequate provisions for sanitation, cleanliness, and
culinary facilities. It seems to have been the expected thing that a
large part of every shipload of immigrants, particularly of the
Palatines, should arrive in a prostrated condition.
There is a record of one ship which made the voyage in 1731 on
which there was such a scarcity of food provided for the passengers
that they “had to live on rats and mice, which were considered
dainties. The price on board for a rat was eighteen pence, and for a
mouse an English sixpence. The captain was under the impression
that the passengers had considerable money and valuables with
them, and, believing that he might profit by it, he endeavored to
reduce them to a state of starvation. He succeeded too well, for out of
the 156 passengers only 48 reached America.”[17]
These wretched victims were of course thrown upon the mercy of
the citizens of the colony in which they landed; Pennsylvania, and
particularly Philadelphia, were especially subject to visitations of this
kind. The generosity with which these unfortunates were cared for in
this colony is remarkable. Nevertheless, the burden was a heavy one,
and the opposition which arose to the free admission of this class of
persons is not to be wondered at. A new country, struggling to
subdue the wilderness and to establish economic independence,
welcomes hardy and industrious laborers, even though they bring
little capital with them. If the poverty of the immigrant is due to no
fault of his own, and is offset by a sound body and a determined
spirit of industry, there is every hope that the influence of the new
environment may set him permanently on his feet. But an influx of
people so deficient in moral or physical stamina as to promise
nothing, save an additional burden on the already strained resources
of the community, is naturally and justly viewed with alarm. Very
many of the immigrants of this period belonged to this type.
As suggested above, the low physical and economic state of many
of the immigrants was due to the conditions and experiences
attending the passage from the old country to the new. Many an
immigrant who was hale and able-bodied when he started on the
voyage was a physical wreck when he landed. Many others who were
relatively well off economically on leaving home arrived penniless. It
was the practice of the “importers” to compel passengers who had
means to settle the accounts of those who had not, and thus, it is
stated, many who had been well-to-do were reduced to house-to-
house beggary.[18] But many other of the immigrants were hopelessly
destitute when they started. Still others were criminals. It was the
practice of European nations at this time to empty not only their
almshouses, but their jails, into their own colonies, or those of other
nations. Thus many of the colonists, as well as of the immigrants,
belonged to the pauper and criminal classes.[19]
This action of European states was naturally bitterly complained of
by the colonies. But as long as they were colonies, and had no
independent standing, it could be little more than a complaint.[20]
After the War of the Revolution it became a matter of international
relations, and, as will appear later, attracted no little attention.
Pennsylvania, being the destination of the largest number of
immigrants, suffered most from troubles of this sort. Consequently,
in this colony we find the most powerful body of opinion contrary to
the free admission of aliens, and the most frequent and stringent
measures to control it. Many of the stock arguments against
immigration on the grounds of pauperism, criminality, and inability
for self-support developed during this period.
One of the earliest Pennsylvania statutes covering this ground was
an act passed in 1722, imposing a tax on every criminal landed, and
making the shipowner responsible for the good conduct of his
passengers.[21] This was followed by numerous other laws designed to
help control the immigration situation. One of the most important of
these was the act of September 21, 1727, which was passed at the
suggestion of the colonial governor, who feared that the peace and
security of the province was endangered by so many foreigners
coming in, ignorant of the language, settling together and making, as
it were, a separate people. This is one of the earliest instances of the
use of the nonassimilation argument in connection with immigration
legislation. The act in question provided that shipmasters bringing
immigrants must declare whether they had permission from the
court of Great Britain to do so, and must give lists of all passengers
and their intentions in coming. The immigrants must take the oath of
allegiance to the king, and of fidelity to the Proprietary of the
Province. On the day the act was passed, an agreement was signed by
109 persons, representing about four hundred immigrants, who had
arrived at the port and were waiting to be landed. A pathetic touch is
given to the incident by the naïve statement, “Sundry of these
forreigners lying sick on board, never came to be qualified.”
This act remained in force for some time, but appears to have been
more or less of a dead letter, for the shipmasters never seem to have
had any license to bring immigrants, and yet the latter were always
admitted.[22] This law was slightly modified in 1729, and a tax of forty
shillings was laid on each immigrant. This is an early instance of the
use of a head tax as a restrictive measure, for among the reasons
assigned for its passage we find mention of the necessity “to
discourage the great importation and coming in of foreigners and of
lewd, idle, and ill-affected persons into this province, as well from
parts beyond the seas as from the neighboring colonies,” whereby the
safety and quiet of the province are endangered, many of them
becoming a great burden upon the community. It was asserted that
shipmasters resorted to deceitful methods in the furtherance of the
practice of bringing in convicts.[23] This accusation was substantiated
by an event which occurred a short time previously, when “a vessel
arrived at Annapolis with 66 indentures, signed by the Mayor of
Dublin, and 22 wigs to disguise the convicts when they landed.”[24]
The provision imposing a head tax of forty shillings was repealed
within a very few months.[25]
Through the discussions of this matter can be traced a frequent
conflict of opinion between the colonial governor and the assembly.
The former, representing the interests of the Proprietary, was
inclined to welcome anything which tended to increase the
population of the colony at whatever cost. The latter, representing
the people, is concerned for the character of the settlers and the
financial welfare of the colony.[26] This is well illustrated by the
progress of the effort to secure an immigrant hospital in
Philadelphia. The erection of such a building had been recommended
to the assembly by Governor George Thomas as early as 1740, in the
interests of humanity. But the house demurred on the ground of
expense, and several years of haggling passed before a pest-house
was finally erected. In the meantime much difficulty was experienced
with “sickly vessels,” and a law was passed requiring all ships to
anchor a mile from the city, until inspected by the port physician. If
sick passengers were found on board, the shipmaster was required to
land them at a suitable distance from the city and convey them at his
own expense to houses in the country prepared for them.[27]
The house, on its part, made vain attempts for a period of fifteen
years or more to get a bill passed which should check the
overcrowding of immigrants in ships. The ostensible reasons urged
were mainly those of humanity, and they rested on an ample basis.
The degree of overcrowding was frightful. It was stated that in many
cases the chests of apparel belonging to immigrants were shipped in
other vessels to make more room for passengers, so that the
immigrants had no chance even to change their clothes during the
long voyage of sometimes sixty days.[28] But underlying this there was
undoubtedly the desire to reduce the number of immigrants. It was
represented that whereas the German importations were at first of
good class, people of substance, now they were the refuse of the
country, and that “the very goals [sic] have contributed to the
Supplies we are burdened with.”
In the southern colonies we find much the same attitude of
welcome to respectable settlers, and fear of criminals and paupers,
with this difference, that as immigration was slower into these
colonies, more active measures were occasionally taken by the
colonies themselves to encourage it. Thus in 1669 North Carolina
passed a law exempting new settlers from levies for one year, and
from action for debt for five years. But they were debarred from
holding office for three years.[29]
Maryland early experienced difficulties with imported criminals.
On account of the practice, which appears to have been common, of
importing notorious criminals, the general assembly of this province
in 1676 passed an act requiring all shipmasters to declare whether
they had any convicts on board. If so, they were not to be allowed to
land in the province. Any person presuming to import such convicts
must pay a fine of 2000 pounds of tobacco, half to go to the
Proprietary and half to the informer.[30] On December 9 of the same
year the lieutenant governor issued a proclamation requiring all
shipmasters who had landed convicts previous to this act going into
effect to deposit a bond of £50 for their good behavior. Any landed
without this bond were to be put in prison until the bond was paid.[31]
This is one of the earliest instances of bonding shippers for the good
conduct of their passengers.
On the other hand, settlers of good character were regarded as very
valuable acquisitions, and measures were adopted from time to time
to encourage their immigration.[32]
In New England the immigration question was less pressing than
in either the central or southern colonies. There was less need of
passing direct restrictive measures,[33] because the religious
exclusiveness of this section kept away many who might otherwise
have come. And there was little necessity of encouraging
immigration, as the natural increase of the population was sufficient
to maintain an adequate number of inhabitants. In fact, the influx of
population from Europe to New England was practically over by the
middle of the seventeenth century. It is stated that from 1628 to 1641
about twenty thousand English came as permanent colonists to New
England, and for the next century and a half more went from there to
England than came from England there.[34] As a result of these
conditions, the population of this region was much less mixed than
in the other colonies. Nevertheless, it was a prolific and growing
population, and “overflowed into the other colonies, without
receiving corresponding additions from them.”[35]
In spite of this fact, however, a certain jealousy was felt toward
Pennsylvania, on account of the large number of foreigners who
sought her shores. This feeling was expressed by Dr. Jonathan
Mayhew in his election sermon before the governor and legislature of
Massachusetts in 1754. While he surmised that Pennsylvania might
in time experience some inconvenience from too large numbers of
unassimilated Germans, yet he attributed much of her growth and
prosperity to their presence. He was assured that the English
element in Massachusetts was already too well established for there
to be any fear of too great an admixture of alien elements, and
expressed the opinion that all measures to encourage the
immigration of foreign Protestants were to be favored.[36]
New York frankly shared this jealousy of Pennsylvania, and, when
it was too late, made efforts to attract immigrants to her territory.
Thus in 1736 Governor Clarke caused to be widely circulated in
Germany an advertisement in which he proposed to give 500 acres of
land to each of the first two hundred families who should come to
New York from Europe. The measure met with no great success.[37]
Possibly the treatment accorded to the would-be settlers of a
generation earlier still lingered in the memory of their fellow-
countrymen.
In addition to the legislation against paupers and criminals, most
of the colonies had laws designed to prevent the entrance of religious
sects who were not regarded with favor. The class most
discriminated against was the Roman Catholics, and the eighteenth
century found harsh statutes against them in the legislation of most
of the colonies.[38] Virginia, and all the New England colonies except
Rhode Island, had laws designed to prevent the coming in of
Quakers.[39] Rhode Island resembled Pennsylvania in the religious
tolerance which prevailed there.[40] Maryland started on the basis of
religious toleration, but did not maintain this position.[41] A prejudice
against Roman Catholics soon manifested itself, and occasionally
found expression in legislation. Thus in the Maryland statutes for
1699 there is an act entitled, “An act for Raising a Supply towards the
defraying of the Publick Charge of this Province and to prevent too
great a number of Irish Papists being imported into this Province.”
The provisions of the act required shipmasters to pay twenty
shillings per poll for all Irish servants imported, as well as for
negroes.[42] None of these acts, of course, was absolutely prohibitive.
Among the settlers of this period there was one peculiar class
which requires special mention. They were, for the most part,
colonists rather than immigrants, though some of them came from
foreign countries. These were the indented (or indentured) servants,
or redemptioners.[43] There were two main classes of them—those
who were brought under compulsion, and those who came
voluntarily. Of the first class, many were convicted criminals, who
were sent over in great numbers from the mother country, and on
arrival were indented as servants for a term of years. Under the
barbarous legal system of the day many persons were sentenced to
death for insignificant crimes, such as stealing a joint of meat worth
over a shilling, or counterfeiting a lottery ticket. Many humane
judges welcomed exile as an alternative to the death penalty. It is
estimated that possibly as many as fifty thousand criminals were sent
to America from the British Isles, from the year 1717 until the
practice was ended by the War of Independence. Besides the
criminals, in this class of indented servants were many who were
kidnaped and sent over to America. Press gangs were busy in
London, Bristol, and other English seaports, seizing boys and girls,
usually, but not always, from the lowest classes of society, and
sending them over to labor as indented servants in the colonies.
Those who came voluntarily were respectable but destitute persons
who, despairing of success or progress in the old country, sold
themselves into temporary slavery to pay their passage over. Many of
these came from very good classes of society. The southern colonies
received a much larger number of indented servants of all classes
than the northern colonies, as the semiplantation character of the
former made a much larger demand for servile labor than in the farm
colonies of the north.[44]
Shipmasters made an enormous profit from this traffic, adding as
much as 100 per cent of the actual cost of transportation to cover
risks. Adults were bound out for a term of three to six years, children
from ten to fifteen years, and smaller children were, without charge,
surrendered to masters who had to rear and board them.[45] As a rule
the indented servants, on the arrival of a ship at an American port,
were auctioned off to the highest bidder at a public auction very like
a slave market. The last sales of this kind reported took place in
Philadelphia in 1818 and 1819. These were mostly Germans. Many of
the indented servants became eminent and respected citizens of the
colonies, while others degenerated and became the progenitors of the
“poor white trash” of the south.
As a result of this study of the colonial period the fact stands out
prominently that during these years both colonization and
immigration entered into the peopling of the Thirteen Colonies. The
distinction between the two was clearly recognized by the colonists
themselves, and immigrants were accorded different treatment from
colonists. In the handling of the situation many of the stock
arguments against unrestricted immigration were developed, and
some of the important legislative expedients, such as the head tax,
the bonding of shippers, the exclusion of paupers and criminals, etc.,
which have had a wide use in later years, were put into practice. It is
very noteworthy, however, that in all the discussions of this question
during this period one searches in vain for any trace of opposition to
immigration on the grounds of the economic competition of the
newcomer with the older residents. In the unsettled state of the
country at this time, such a thing could hardly be thought of. The
idea of any crowding of the industrial field, or any lack of economic
opportunity for an unlimited number, was almost inconceivable. It is
this, more than any other one thing, which differentiates the
immigration situation during the colonial period from that at the
present time.
Two other fundamental facts in reference to the formation of the
new American people should also be noted in this connection. The
first is that the actual transference of people from Europe to America
during the entire colonial period was relatively slight. Benjamin
Franklin stated that in 1741 a population of about one million had
been produced from an immigration (used in the broad sense) of less
than 80,000.[46] As an indication of how much less important this
“immigration” was than the recent immigration into the United
States has been, it may be noted that the ratio between immigrants
and total population, at the period that Franklin mentioned, was one
to twelve for a period of 120 years or more, while the ratio between
immigrants since 1820 and population in 1900—a period of only
eighty years—was one to four. “After the first outflow from Old to
New England, in 1630–31, emigration was checked, at first by the
changing circumstances of the struggle between the people and the
king, and, when the struggle was over, by the better-known
difficulties of life in the colonies.”[47]
The second of these facts is that such additions to population as
there were, while containing a number of diverse elements, were
predominantly English, and that those who were not English were
almost wholly from races closely allied to the English. These were
principally the Dutch, Swedes, Germans, and Scotch-Irish, which
with the English, as Professor Commons has pointed out, were, less
than two thousand years ago, all one Germanic race in the forests
surrounding the North Sea. “It is the distinctive fact regarding
colonial migration that it was Teutonic in blood and Protestant in
religion.”[48] This Protestantism was important, not so much because
of the superiority of one form of religion over another, as because of
the type of mind and character which Protestantism at that day
represented. It stood for independence of thought, moral conviction,
courage, and hardihood.
The English element, then, was sufficiently preëminent quickly to
reduce all other elements to its type. As a result of the character of
the migration assimilation was easy, quick, and complete. While it
was said that every language of Europe could be found in
Pennsylvania, this diversity was short-lived. “No matter how diverse
the small immigration might have been on its arrival, there was a
steady pressure on its descendants to turn them into Englishmen;
and it was very successful.... The whole coast, from Nova Scotia to
the Spanish possessions in Florida, was one in all essential
circumstances.”[49]
Such, then, was the American people at the time of the Revolution
—a physically homogeneous race, composed almost wholly of native-
born descendants of native-born ancestors, of a decidedly English
type, but with a distinct character of its own. This was the great stock
from which the people of the United States grew, and upon which all
subsequent additions must be regarded as extraneous grafts.
CHAPTER III
1783 TO 1820
The first act passed by the federal government of the United States
which can in any way be called an immigration law was primarily
designed, not to restrict or control the admission of immigrants into
this country, but to make some provision for their comfort and safety
while on the voyage—matters which had been shockingly neglected
in the past, with the result of untold sufferings and horrors. These
evils were largely due to the intolerable overcrowding on shipboard
which was habitual. The act in question aimed to correct these evils
by limiting the number of passengers which might be carried on any
ship to two to every five tons of the ship’s weight. It furthermore
provided that each ship or vessel leaving an American port was to
have on board for each passenger carried sixty gallons of water, one
gallon of vinegar, one hundred pounds of salted provisions, and one
hundred pounds of wholesome ship bread. It is very doubtful how
much good either of these provisions ever did to the immigrants. The
clause in regard to overcrowding, based as it was merely on the ship’s
total weight, was wholly inadequate to prevent extreme
overcrowding in such parts of the vessel as might be assigned to
passengers. And as far as the provision regarding supplies is
concerned, it could have been of no help to the immigrants, as it
applied only to ships leaving an American port. There was one
provision of the law, however, which has been of permanent benefit.
This was the stipulation that at the port of landing a full and
complete report or manifest was to be made by the ship’s officer to
the customs authorities, which was to state the number of passengers
carried, together with the name, sex, age, and occupation of each.
This act was passed on March 2, 1819, and in the year ending
September 30, 1820, the first official statistics of immigration were
collected. From this time to the present we have a continuous record
of arrivals, increasing in detail with subsequent legal requirements.
Thus the year 1820 stands as a fitting beginning for our third period.
The decade of the twenties was one of great industrial activity on
the part of the American people. Manufactures increased. The Erie
Canal was completed, others were commenced, and there was a fever
of excitement about them. The first railroads were projected, and
vied with the canals in arousing public enthusiasm. There was a vast
movement of population westward, and the Ohio River was a busy
thoroughfare.
All of these enterprises aroused a demand for labor, which, as we
have seen, the native population would not readily supply. By the
middle of the decade the stream of immigration had begun to
respond, so that in 1825 the number of arrivals for the year reached
the ten thousand mark for the first time since statistics had been
collected. By the end of the decade the number had more than
doubled. In the fifteen months ending December 31, 1832, there were
over sixty thousand arrivals, and in the year 1842, 104,565—the first
time the hundred thousand mark had been reached. Such an
enormous increase in immigration as this could not fail to have its
effect upon the social life of the nation, and to attract widespread
attention. Coupled with the changing nature of industry, it brought
many new problems before the American people—congestion,
tenement house problems, unemployment, etc. Pauperism,
intemperance, beggary, and prostitution increased.[59] For many of
these evils it began to appear that the immigrants were partly
responsible.
Yet during the twenties it seems that the immigrants were, on the
whole, in good favor. The great economic need which they filled
outweighed the social burden which they imposed, but which, as yet,
was only vaguely felt. The hard manual labor on the construction
enterprises of the period was mainly performed by Irish laborers,
who flocked over in great numbers, constituting the largest single
element in the immigration stream, amounting to probably nearly
half of the entire number. It was believed by many Americans, as well
as by foreign travelers and observers, that the canals and railroads
could never have been built without these sturdy Irishmen. They
were a turbulent and reckless lot, though perhaps not wholly through
their own fault. Their miserable wages were supplemented by
copious supplies of whisky, with the result that the labor camps were
frequently the scenes of riotous demonstrations which shocked the
sensibilities of the American community.
By the end of this decade, however, the evils attendant upon
unregulated immigration were beginning to make themselves felt
among the native population. Chief among these was the danger
from an increase of pauperism. The frightful shipping conditions,
which had marked previous periods, continued with practically no
amelioration. The records of the time are full of heartrending tales of
crowded, filthy, unventilated ships, and penniless, starved, diseased
immigrants, often landed in a state of absolute destitution. The
sickening details of these accounts make the most lurid description
of present-day steerage conditions seem absolutely colorless. Under
such circumstances it was inevitable that a very large number of
these miserable victims should come immediately, or in a very short
time, upon the public for support. The censuses of the poorhouses
showed an altogether disproportionate number of foreign-born
paupers among the inmates. In Philadelphia, for instance, it appears
that at the beginning of the thirties the foreign-born paupers made
up nearly one third of the total number, and by 1834 this proportion
had increased to practically one half.[60] Such a state of affairs
naturally aroused the consternation of the natives, and the feeling
was made more intense by the belief that many of these paupers were
taken directly from the almshouses of foreign countries, and shipped
to this country at public expense. This matter has been the subject of
so much debate that it will be worth while to examine the truth of
these charges in this connection.
Mrs. Trollope, writing in 1832, said, “I frequently heard vehement
complaints, and constantly met the same in the newspapers, of a
practice stated to be very generally adopted in Britain of sending out
cargoes of parish paupers to the United States. A Baltimore paper
heads some such remarks with the words ‘INFAMOUS CONDUCT’
and then tells us of a cargo of aged paupers just arrived from
England, adding ‘John Bull has squeezed the orange and now
insolently casts the skin in our faces.’” Mrs. Trollope states that
careful investigation on her part failed to substantiate this charge.[61]
The article referred to is one which appeared in Niles’ Register for
July 3, 1830. It gives an account of the ship Anacreon from
Liverpool, which arrived at Norfolk with 168 passengers, three
fourths of whom were transported English paupers, cast on our
shores at about four pounds ten shillings per head. Many of them
were very aged. The editor’s vehement protest against such action
contrasts sharply with the complacency with which the same journal
had viewed the advent of a crowd of transported Irish paupers seven
years earlier.[62]
An examination of the evidence on the question tends to support
the statement of the Baltimore editor, rather than the denial of Mrs.
Trollope. Other numbers of Niles’ Register contain frequent accounts
of such practices. A letter written from England, dated February 7,
1823, and published in this journal states, “I was down in the London
docks and there were twenty-six paupers going out in the ship
Hudson, to New York, sent by the parish of Eurbarst, in Sussex, in
carriers’ wagons, who paid their passage and gave them money to
start with when they arrived in the U. States.” The editor states that
“this precious cargo has arrived safely.”[63] Other numbers of the
Register contain similar instances, some of them quoted from other
papers.[64]
So far the evidence consists mostly of newspaper tales, and is
perhaps open to reasonable doubt, though where there was so much
smoke there must have been some fire. But more reliable testimony
is available. Charges of the kind in question finally became so
prevalent that the government ordered an investigation, and on May
15, 1838, Mr. John Forsyth, then Secretary of State, presented a
report on the subject of pauperism and immigration. This contains a
large amount of testimony, from which it will be sufficient to select a
few typical cases.
On June 28, 1831, Mr. R. M. Harrison, United States consul at
Kingston, Jamaica, reported that there was a local law compelling
shipmasters who left that port to carry away paupers, for which they
received $10 each as remuneration. If they refused to take them, they
were fined $300. As various states had laws forbidding the landing of
paupers, it was customary for shipmasters to sign the paupers as
seamen. The pauper had the privilege of choosing his own vessel, and
most of them went to the United States. Mr. Van Buren called the
attention of Lord Palmerston, the British Foreign Secretary, to the
affair, and requested a discontinuance of the practice. Lord
Palmerston replied that the law was to expire December 31, and the
governor of Jamaica had been instructed to withhold his assent to
any similar law.[65]
Mr. Albert Davy, United States consul at Kingston-upon-Hull,
Leeds, England, reported that while no reliable lists were kept at
customhouses, distinguishing paupers from others, it was generally
known that paupers emigrated, and several shipmasters admitted
that passage was paid by parish overseers. If a pauper was an
exceptionally hard case, he could demand considerable sums of
money in addition to his passage, refusing to go unless they were
paid.[66] Mr. F. List on March 8, 1837, reported from Leipsic that not
only paupers, but criminals, were transported from the interior to
seaports, to be embarked for the United States. A certain Mr. de
Stein contracts with the governments to transport paupers for $75
per head, and several of the governments have accepted his
proposition. There is a plan to empty the jails and workhouses in this
way. It is a common practice in Germany to get rid of paupers and
vicious characters by collecting money to send them to the United
States.[67]
That it was customary to transport criminals as well as paupers is
verified by the fact that during 1837 two lots of convicts arrived in
Baltimore: one a party of fourteen convicts on a ship from Bremen,
who had been embarked in irons, which had not been stricken off
until near the fort; the other a shipload of 200 to 250 Hessian
convicts, whose manacles and fetters remained upon their hands and
feet until within the day of their arrival.[68]
A memorial of the corporation of the city of New York, January 25,
1847, states that within the last year the ships Sardinia and Atlas
from Liverpool arrived in New York, one with 294 and the other with
314 steerage passengers, all paupers, sent by the parish of
Grosszimmern, Hesse Darmstadt, to which they belonged and by
which their expenses were paid. Two hundred and thirty-four of
these immigrants, 117 from each ship, eventually found their way
into the New York almshouse.[69]