100% found this document useful (8 votes)
294 views

PDF (Ebook) Learning PHP, MySQL & JavaScript (Early Release) by Robin Nixon ISBN 9781492093817, 1492093815 download

The document provides information about various editions of the ebook 'Learning PHP, MySQL & JavaScript' by Robin Nixon, including links for downloading and details on the content covered. It emphasizes the importance of mastering PHP, MySQL, JavaScript, CSS, and HTML5 for creating dynamic websites and outlines the book's structure and intended audience. Additionally, it mentions the availability of supplemental materials and resources for further learning through O'Reilly Media.

Uploaded by

dimitferer1l
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (8 votes)
294 views

PDF (Ebook) Learning PHP, MySQL & JavaScript (Early Release) by Robin Nixon ISBN 9781492093817, 1492093815 download

The document provides information about various editions of the ebook 'Learning PHP, MySQL & JavaScript' by Robin Nixon, including links for downloading and details on the content covered. It emphasizes the importance of mastering PHP, MySQL, JavaScript, CSS, and HTML5 for creating dynamic websites and outlines the book's structure and intended audience. Additionally, it mentions the availability of supplemental materials and resources for further learning through O'Reilly Media.

Uploaded by

dimitferer1l
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Download Full Version ebook - Visit ebooknice.

com

(Ebook) Learning PHP, MySQL & JavaScript (Early


Release) by Robin Nixon ISBN 9781492093817,
1492093815

https://ebooknice.com/product/learning-php-mysql-javascript-
early-release-24129590

Click the button below to download

DOWLOAD EBOOK

Discover More Ebook - Explore Now at ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Learning PHP, MySQL & JavaScript by Robin Nixon


ISBN 9781491918661, 1491918667

https://ebooknice.com/product/learning-php-mysql-javascript-4761774

ebooknice.com

(Ebook) Learning PHP, MySQL & JavaScript: With jQuery, CSS


& HTML5 (Early Release 5th) by Robin Nixon ISBN
9781491978917, 1491978910
https://ebooknice.com/product/learning-php-mysql-javascript-with-
jquery-css-html5-early-release-5th-6855160

ebooknice.com

(Ebook) Learning PHP, MySQL, and JavaScript by Robin Nixon


ISBN 9780596157135, 0596157134

https://ebooknice.com/product/learning-php-mysql-and-
javascript-1216936

ebooknice.com

(Ebook) Learning PHP MySQL JavaScript and CSS by Robin


Nixon ISBN 9781449319267, 1449319262

https://ebooknice.com/product/learning-php-mysql-javascript-and-
css-2618790

ebooknice.com
(Ebook) Learning PHP, MySQL & JavaScript - With jQuery,
CSS & HTML5 by Robin Nixon ISBN 9781491978917, 1491978910

https://ebooknice.com/product/learning-php-mysql-javascript-with-
jquery-css-html5-7294746

ebooknice.com

(Ebook) Learning PHP, MySQL & JavaScript, 6th Edition by


Robin Nixon ISBN 9781492093800, 9781492093824, 1492093807,
1492093823
https://ebooknice.com/product/learning-php-mysql-javascript-6th-
edition-23267530

ebooknice.com

(Ebook) Learning PHP, MySQL & JavaScript, 7th Edition by


Robin Nixon ISBN 9781098152352, 9781098152291, 1098152352,
1098152298
https://ebooknice.com/product/learning-php-mysql-javascript-7th-
edition-54117148

ebooknice.com

(Ebook) Learning PHP, MySQL, JavaScript, CSS & HTML5,


Third Edition: A Step-by-Step Guide to Creating Dynamic
Websites by Robin Nixon ISBN 9781491949467, 1491949465
https://ebooknice.com/product/learning-php-mysql-javascript-css-
html5-third-edition-a-step-by-step-guide-to-creating-dynamic-
websites-4724548
ebooknice.com

(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason;


Viles, James ISBN 9781459699816, 9781743365571,
9781925268492, 1459699815, 1743365578, 1925268497
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374

ebooknice.com
Learning PHP, MySQL &
JavaScript
SIXTH EDITION

With Early Release ebooks, you get books in their earliest form—the
author’s raw and unedited content as they write—so you can take
advantage of these technologies long before the official release of these
titles.

With PHP 8, MySQL 8, PDO, CSS, HTML5, jQuery


& React

Robin Nixon
Learning PHP, MySQL & JavaScript
by Robin Nixon
Copyright © 2021 Robin Nixon. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North,
Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales
promotional use. Online editions are also available for most titles
(http://oreilly.com). For more information, contact our
corporate/institutional sales department: 800-998-9938 or
[email protected].

Editor: Rachel Roumeliotis

Production Editor: Caitlin Ghegan

Copyeditor: TK

Proofreader: TK

Indexer: TK

Interior Designer: David Futato

Cover Designer: Karen Montgomery

Illustrator: Catherine Dullea

July 2009: First Edition


August 2012: Second Edition
June 2014: Third Edition
December 2014: Fourth Edition
May 2018: Fifth Edition
November 2021

Revision History for the Early Release


2021-02-04: First release

See http://oreilly.com/catalog/errata.csp?isbn=9781492093817 for release


details.
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc.
Learning PHP, MySQL & JavaScript, the cover image, and related trade
dress are trademarks of O’Reilly Media, Inc.
While the publisher and the author have used good faith efforts to ensure
that the information and instructions contained in this work are accurate, the
publisher and the author disclaim all responsibility for errors or omissions,
including without limitation responsibility for damages resulting from the
use of or reliance on this work. Use of the information and instructions
contained in this work is at your own risk. If any code samples or other
technology this work contains or describes is subject to open source
licenses or the intellectual property rights of others, it is your responsibility
to ensure that your use thereof complies with such licenses and/or rights.
978-1-492-09381-7
[LSI]
Preface

The combination of PHP and MySQL is the most convenient approach to


dynamic, database-driven web design, holding its own in the face of
challenges from integrated frameworks—such as Ruby on Rails—that are
harder to learn. Due to its open source roots (unlike the competing
Microsoft .NET Framework), it is free to implement and is therefore an
extremely popular option for web development.
Any would-be developer on a Unix/Linux or even a Windows/Apache
platform will need to master these technologies. And, combined with the
partner technologies of JavaScript, React, CSS, and HTML5, you will be
able to create websites of the caliber of industry standards like Facebook,
Twitter, and Gmail.

Audience
This book is for people who wish to learn how to create effective and
dynamic websites. This may include webmasters or graphic designers who
are already creating static websites but wish to take their skills to the next
level, as well as high school and college students, recent graduates, and
self-taught individuals.
In fact, anyone ready to learn the fundamentals behind responsive web
design will obtain a thorough grounding in the core technologies of PHP,
MySQL, JavaScript, CSS, and HTML5, and you’ll learn the basics of the
React library and React Native Framework, too.
Assumptions This Book Makes
This book assumes that you have a basic understanding of HTML and can
at least put together a simple, static website, but does not assume that you
have any prior knowledge of PHP, MySQL, JavaScript, CSS, or HTML5—
although if you do, your progress through the book will be even quicker.

Organization of This Book


The chapters in this book are written in a specific order, first introducing all
of the core technologies it covers and then walking you through their
installation on a web development server so that you will be ready to work
through the examples.
In the first section, you will gain a grounding in the PHP programming
language, covering the basics of syntax, arrays, functions, and object-
oriented programming.
Then, with PHP under your belt, you will move on to an introduction to the
MySQL database system, where you will learn everything from how
MySQL databases are structured to how to generate complex queries.
After that, you will learn how you can combine PHP and MySQL to start
creating your own dynamic web pages by integrating forms and other
HTML features. You will then get down to the nitty-gritty practical aspects
of PHP and MySQL development by learning a variety of useful functions
and how to manage cookies and sessions, as well as how to maintain a high
level of security.
In the next few chapters, you will gain a thorough grounding in JavaScript,
from simple functions and event handling to accessing the Document
Object Model, in-browser validation, and error handling. You’ll also get a
comprehensive primer on using the popular React library for JavaScript.
With an understanding of all three of these core technologies, you will then
learn how to make behind-the-scenes Ajax calls and turn your websites into
highly dynamic environments.
Next, you’ll spend two chapters learning all about using CSS to style and
lay out your web pages, before discovering how the React libraries can
make your development job a great deal easier. You’ll then move on to the
final section on the interactive features built into HTML5, including
geolocation, audio, video, and the canvas. After this, you’ll put together
everything you’ve learned in a complete set of programs that together
constitute a fully functional social networking website.
Along the way, you’ll find plenty of advice on good programming practices
and tips that can help you find and solve hard-to-detect programming
errors. There are also plenty of links to websites containing further details
on the topics covered.

Supporting Books
Once you have learned to develop using PHP, MySQL, JavaScript, CSS,
and HTML5, you will be ready to take your skills to the next level using the
following O’Reilly reference books:

Dynamic HTML: The Definitive Reference by Danny Goodman


PHP in a Nutshell by Paul Hudson
MySQL in a Nutshell by Russell Dyer
JavaScript: The Definitive Guide by David Flanagan
CSS: The Definitive Guide by Eric A. Meyer and Estelle Weyl
HTML5: The Missing Manual by Matthew MacDonald

Conventions Used in This Book


The following typographical conventions are used in this book:
Plain text
Indicates menu titles, options, and buttons.
Italic
Indicates new terms, URLs, email addresses, filenames, file extensions,
pathnames, directories, and Unix utilities. Also used for database, table,
and column names.

Constant width

Indicates commands and command-line options, variables and other


code elements, HTML tags, and the contents of files.

Constant width bold


Shows program output and is used to highlight sections of code that are
discussed in the text.

Constant width italic


Shows text that should be replaced with user-supplied values.

NOTE
This element signifies a tip, suggestion, or general note.

WARNING
This element indicates a warning or caution.

Using Code Examples


Supplemental material (code examples, exercises, etc.) is available for
download at github.com/RobinNixon/lpmj6.
This book is here to help you get your job done. In general, if example code
is offered with this book, you may use it in your programs and
documentation. You do not need to contact us for permission unless you’re
reproducing a significant portion of the code. For example, writing a
program that uses several chunks of code from this book does not require
permission. Selling or distributing a set of examples from O’Reilly books
does require permission. Answering a question by citing this book and
quoting example code does not require permission. Incorporating a
significant amount of example code from this book into your product’s
documentation does require permission.
We appreciate, but do not require, attribution. An attribution usually
includes the title, author, publisher, and ISBN. For example: “Learning
PHP, MySQL & JavaScript 6th Edition by Robin Nixon (O’Reilly).
Copyright 2021 Robin Nixon, [[[ISBN NUMBER GOES HERE]]].”
If you feel your use of code examples falls outside fair use or the
permission given above, feel free to contact us at [email protected].

O’Reilly Online Learning

NOTE
For more than 40 years, O’Reilly Media has provided technology and business training,
knowledge, and insight to help companies succeed.

Our unique network of experts and innovators share their knowledge and
expertise through books, articles, and our online learning platform.
O’Reilly’s online learning platform gives you on-demand access to live
training courses, in-depth learning paths, interactive coding environments,
and a vast collection of text and video from O’Reilly and 200+ other
publishers. For more information, visit http://oreilly.com.
How to Contact Us
Please address comments and questions concerning this book to the
publisher:

O’Reilly Media, Inc.

1005 Gravenstein Highway North

Sebastopol, CA 95472

(800) 998-9938 (in the United States or Canada)

(707) 829-0515 (international or local)

(707) 829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any
additional information. You can access this page at [[[ERRATA URL GOES
HERE]]].
To comment or ask technical questions about this book, send email to
[email protected].
For news and more information about our books and courses, see our
website at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia

Acknowledgments
I would like to thank Senior Content Acquisitions Editor, Amanda Quinn,
Content Development Editor, Melissa Potter, and everyone who worked so
hard on this book, including ???, ??? & ??? for their comprehensive
technical reviews, ??? for overseeing production, ??? for copy editing, ???
for proofreading, ??? for creating the index, Karen Montgomery for the
original sugar glider front cover design, ??? for the latest book cover, my
original editor, Andy Oram, for overseeing the first five editions, and
everyone else too numerous to name who submitted errata and offered
suggestions for this new edition.
Chapter 1. Introduction to
Dynamic Web Content

The World Wide Web is a constantly evolving network that has already
traveled far beyond its conception in the early 1990s, when it was created to
solve a specific problem. State-of-the-art experiments at CERN (the
European Laboratory for Particle Physics, now best known as the operator
of the Large Hadron Collider) were producing incredible amounts of data—
so much that the data was proving unwieldy to distribute to the participating
scientists, who were spread out across the world.
At this time, the internet was already in place, connecting several hundred
thousand computers, so Tim Berners-Lee (a CERN fellow) devised a
method of navigating between them using a hyperlinking framework, which
came to be known as Hypertext Transfer Protocol, or HTTP. He also created
a markup language called Hypertext Markup Language, or HTML. To bring
these together, he wrote the first web browser and web server.
Today we take these tools for granted, but back then, the concept was
revolutionary. The most connectivity so far experienced by at-home modem
users was dialing up and connecting to a bulletin board that was hosted by a
single computer, where you could communicate and swap data only with
other users of that service. Consequently, you needed to be a member of
many bulletin board systems in order to effectively communicate
electronically with your colleagues and friends.
But Berners-Lee changed all that in one fell swoop, and by the mid-1990s,
there were three major graphical web browsers competing for the attention
of 5 million users. It soon became obvious, though, that something was
missing. Yes, pages of text and graphics with hyperlinks to take you to other
pages was a brilliant concept, but the results didn’t reflect the instantaneous
potential of computers and the internet to meet the particular needs of each
user with dynamically changing content. Using the web was a very dry and
plain experience, even if we did now have scrolling text and animated
GIFs!
Shopping carts, search engines, and social networks have clearly altered
how we use the web. In this chapter, we’ll take a brief look at the various
components that make up the web, and the software that helps make using it
a rich and dynamic experience.

NOTE
It is necessary to start using some acronyms more or less right away. I have tried to
clearly explain them before proceeding, but don’t worry too much about what they stand
for or what these names mean, because the details will become clear as you read on.

HTTP and HTML: Berners-Lee’s Basics


HTTP is a communication standard governing the requests and responses
that are sent between the browser running on the end user’s computer and
the web server. The server’s job is to accept a request from the client and
attempt to reply to it in a meaningful way, usually by serving up a requested
web page—that’s why the term server is used. The natural counterpart to a
server is a client, so that term is applied both to the web browser and the
computer on which it’s running.
Between the client and the server there can be several other devices, such as
routers, proxies, gateways, and so on. They serve different roles in ensuring
that the requests and responses are correctly transferred between the client
and server. Typically, they use the internet to send this information. Some of
these in-between devices can also help speed up the internet by storing
pages or information locally in what is called a cache, and then serving this
content up to clients directly from the cache rather than fetching it all the
way from the source server.
A web server can usually handle multiple simultaneous connections, and
when not communicating with a client, it spends its time listening for an
incoming connection. When one arrives, the server sends back a response to
confirm its receipt.

The Request/Response Procedure


At its most basic level, the request/response process consists of a web
browser asking the web server to send it a web page and the server sending
back the page. The browser then takes care of displaying the page (see
Figure 1-1).
Figure 1-1. The basic client/server request/response sequence

The steps in the request and response sequence are as follows:


1. You enter http://server.com into your browser’s address bar.
2. Your browser looks up the Internet Protocol (IP) address for
server.com.
3. Your browser issues a request for the home page at server.com.
4. The request crosses the internet and arrives at the server.com web
server.
5. The web server, having received the request, looks for the web
page on its disk.
6. The web server retrieves the page and returns it to the browser.
7. Your browser displays the web page.
For an average web page, this process also takes place once for each object
within the page: a graphic, an embedded video or Flash file, and even a
CSS template.
In step 2, notice that the browser looks up the IP address of server.com.
Every machine attached to the internet has an IP address—your computer
included—but we generally access web servers by name, such as
google.com. As you probably know, the browser consults an additional
internet service called the Domain Name Service (DNS) to find the server’s
associated IP address and then uses it to communicate with the computer.
For dynamic web pages, the procedure is a little more involved, because it
may bring both PHP and MySQL into the mix. For instance, you may click
on a picture of a raincoat. Then PHP will put together a request using the
standard database language, SQL—many of whose commands you will
learn in this book—and send the request to the MySQL server. The MySQL
server will return information about the raincoat you selected, and the PHP
code will wrap it all up in some HTML, which the server will send to your
browser (see Figure 1-2).
Figure 1-2. A dynamic client/server request/response sequence

The steps are as follows:


1. You enter http://server.com into your browser’s address bar.
2. Your browser looks up the IP address for server.com.
3. Your browser issues a request to that address for the web server’s
home page.
4. The request crosses the internet and arrives at the server.com web
server.
5. The web server, having received the request, fetches the home page
from its hard disk.
6. With the home page now in memory, the web server notices that it
is a file incorporating PHP scripting and passes the page to the
PHP interpreter.
7. The PHP interpreter executes the PHP code.
8. Some of the PHP contains SQL statements, which the PHP
interpreter now passes to the MySQL database engine.
9. The MySQL database returns the results of the statements to the
PHP interpreter.
10. The PHP interpreter returns the results of the executed PHP code,
along with the results from the MySQL database, to the web server.
11. The web server returns the page to the requesting client, which
displays it.

Although it’s helpful to be aware of this process so that you know how the
three elements work together, in practice you don’t really need to concern
yourself with these details, because they all happen automatically.
The HTML pages returned to the browser in each example may well
contain JavaScript, which will be interpreted locally by the client, and
which could initiate another request—the same way embedded objects such
as images would.

The Benefits of PHP, MySQL, JavaScript,


CSS, and HTML5
At the start of this chapter, I introduced the world of Web 1.0, but it wasn’t
long before the rush was on to create Web 1.1, with the development of
such browser enhancements as Java, JavaScript, JScript (Microsoft’s slight
variant of JavaScript), and ActiveX. On the server side, progress was being
made on the Common Gateway Interface (CGI) using scripting languages
such as Perl (an alternative to the PHP language) and server-side scripting
—inserting the contents of one file (or the output of running a local
program) into another one dynamically.
Once the dust had settled, three main technologies stood head and shoulders
above the others. Although Perl was still a popular scripting language with
a strong following, PHP’s simplicity and built-in links to the MySQL
database program had earned it more than double the number of users. And
JavaScript, which had become an essential part of the equation for
dynamically manipulating Cascading Style Sheets (CSS) and HTML, now
took on the even more muscular task of handling the client side of the
asynchronous communication (exchanging data between a client and server
after a web page has loaded). Using asynchronous communication, web
pages perform data handling and send requests to web servers in the
background—without the web user being aware that this is going on.
No doubt the symbiotic nature of PHP and MySQL helped propel them
both forward, but what attracted developers to them in the first place? The
simple answer has to be the ease with which you can use them to quickly
create dynamic elements on websites. MySQL is a fast and powerful yet
easy-to-use database system that offers just about anything a website would
need in order to find and serve up data to browsers. When PHP allies with
MySQL to store and retrieve this data, you have the fundamental parts
required for the development of social networking sites and the beginnings
of Web 2.0.
And when you bring JavaScript and CSS into the mix too, you have a recipe
for building highly dynamic and interactive websites—especially as there is
now a wide range of sophisticated frameworks of JavaScript functions you
can call on to really speed up web development, such as the well-known
jQuery, which until very recently was one of the most common way
programmers access asynchronous communication features, and the more
recent React JavaScript library which has been growing quickly in
popularity, and is now one of the most widely downloaded and
implemented frameworks, so much so that since 2020 the Indeed job site
lists more than twice as many positions for React developers than for
jQuery.

MariaDB: The MySQL Clone


After Oracle purchased Sun Microsystems (the owners of MySQL), the
community became wary that MySQL might not remain fully open source,
so MariaDB was forked from it to keep it free under the GNU GPL.
Development of MariaDB is led by some of the original developers of
MySQL and it retains exceedingly close compatibility with MySQL.
Therefore, you may well encounter MariaDB on some servers in place of
MySQL—but not to worry, everything in this book works equally well on
both MySQL and MariaDB, which is based on the same code base as
MySQL Server 5.5. To all intents and purposes you can swap one with the
other and notice no difference.
Anyway, as it turns out, many of the initial fears appear to have been
allayed as MySQL remains open source, with Oracle simply charging for
support and for editions that provide additional features such as geo-
replication and automatic scaling. However, unlike MariaDB, MySQL is no
longer community driven, so knowing that MariaDB will always be there if
ever needed will keep many developers sleeping at night, and probably
ensures that MySQL itself will remain open source.
Using PHP
With PHP, it’s a simple matter to embed dynamic activity in web pages.
When you give pages the .php extension, they have instant access to the
scripting language. From a developer’s point of view, all you have to do is
write code such as the following:

<?php
echo " Today is " . date("l") . ". ";
?>

Here's the latest news.

The opening <?php tells the web server to allow the PHP program to
interpret all the following code up to the ?> tag. Outside of this construct,
everything is sent to the client as direct HTML. So, the text Here's the
latest news. is simply output to the browser; within the PHP tags, the
built-in date function displays the current day of the week according to
the server’s system time.
The final output of the two parts looks like this:

Today is Wednesday. Here's the latest news.

PHP is a flexible language, and some people prefer to place the PHP
construct directly next to PHP code, like this:

Today is <?php echo date("l"); ?>. Here's the latest news.

There are even more ways of formatting and outputting information, which
I’ll explain in the chapters on PHP. The point is that with PHP, web
developers have a scripting language that, although not as fast as compiling
your code in C or a similar language, is incredibly speedy and also
integrates seamlessly with HTML markup.
NOTE
If you intend to enter the PHP examples in this book into a program editor to work
along with me, you must remember to add <?php in front and ?> after them to ensure
that the PHP interpreter processes them. To facilitate this, you may wish to prepare a file
called example.php with those tags in place.

Using PHP, you have unlimited control over your web server. Whether you
need to modify HTML on the fly, process a credit card, add user details to a
database, or fetch information from a third-party website, you can do it all
from within the same PHP files in which the HTML itself resides.

Using MySQL
Of course, there’s not a lot of point to being able to change HTML output
dynamically unless you also have a means to track the information users
provide to your website as they use it. In the early days of the web, many
sites used “flat” text files to store data such as usernames and passwords.
But this approach could cause problems if the file wasn’t correctly locked
against corruption from multiple simultaneous accesses. Also, a flat file can
get only so big before it becomes unwieldy to manage—not to mention the
difficulty of trying to merge files and perform complex searches in any kind
of reasonable time.
That’s where relational databases with structured querying become
essential. And MySQL, being free to use and installed on vast numbers of
internet web servers, rises superbly to the occasion. It is a robust and
exceptionally fast database management system that uses English-like
commands.
The highest level of MySQL structure is a database, within which you can
have one or more tables that contain your data. For example, let’s suppose
you are working on a table called users, within which you have created
columns for surname, firstname, and email, and you now wish to
add another user. One command that you might use to do this is as follows:
INSERT INTO users VALUES('Smith', 'John', '[email protected]');

You will previously have issued other commands to create the database and
table and to set up all the correct fields, but the SQL INSERT command
here shows how simple it can be to add new data to a database. SQL is a
language designed in the early 1970s that is reminiscent of one of the oldest
programming languages, COBOL. It is well suited, however, to database
queries, which is why it is still in use after all this time.
It’s equally easy to look up data. Let’s assume that you have an email
address for a user and need to look up that person’s name. To do this, you
could issue a MySQL query such as the following:

SELECT surname,firstname FROM users WHERE


email='[email protected]';

MySQL will then return Smith, John and any other pairs of names that
may be associated with that email address in the database.
As you’d expect, there’s quite a bit more that you can do with MySQL than
just simple INSERT and SELECT commands. For example, you can
combine related data sets to bring related pieces of information together,
ask for results in a variety of orders, make partial matches when you know
only part of the string that you are searching for, return only the nth result,
and a lot more.
Using PHP, you can make all these calls directly to MySQL without having
to directly access the MySQL command-line interface yourself. This means
you can save the results in arrays for processing and perform multiple
lookups, each dependent on the results returned from earlier ones, to drill
down to the item of data you need.
For even more power, as you’ll see later, there are additional functions built
right into MySQL that you can call up to efficiently run common operations
within MySQL, rather than creating them out of multiple PHP calls to
MySQL.
Using JavaScript
The oldest of the three core technologies discussed in this book, JavaScript,
was created to enable scripting access to all the elements of an HTML
document. In other words, it provides a means for dynamic user interaction
such as checking email address validity in input forms and displaying
prompts such as “Did you really mean that?” (although it cannot be relied
upon for security, which should always be performed on the web server).
Combined with CSS (see the following section), JavaScript is the power
behind dynamic web pages that change in front of your eyes rather than
when a new page is returned by the server.
However, JavaScript can also be tricky to use, due to some major
differences in the ways different browser designers have chosen to
implement it. This mainly came about when some manufacturers tried to
put additional functionality into their browsers at the expense of
compatibility with their rivals.
Thankfully, the developers have mostly now come to their senses and have
realized the need for full compatibility with one another, so it is less
necessary these days to have to optimize your code for different browsers.
However, there remain millions of users using legacy browsers, and this
will likely be the case for a good many years to come. Luckily, there are
solutions for the incompatibility problems, and later in this book we’ll look
at libraries and techniques that enable you to safely ignore these differences.
For now, let’s take a look at how to use basic JavaScript, accepted by all
browsers:

<script type="text/javascript">
document.write("Today is " + Date() );
</script>

This code snippet tells the web browser to interpret everything within the
<script> tags as JavaScript, which the browser does by writing the text
Today is to the current document, along with the date, using the
JavaScript function Date. The result will look something like this:

Today is Wed Jan 01 2025 01:23:45

NOTE
Unless you need to specify an exact version of JavaScript, you can normally omit the
type="text/javascript" and just use <script> to start the interpretation of
the JavaScript.

As previously mentioned, JavaScript was originally developed to offer


dynamic control over the various elements within an HTML document, and
that is still its main use. But more and more, JavaScript is being used for
asynchronous communication, the process of accessing the web server in
the background.
Asynchronous communication is what allows web pages to begin to
resemble standalone programs, because they don’t have to be reloaded in
their entirety to display new content. Instead, an asynchronous call can pull
in and update a single element on a web page, such as changing your
photograph on a social networking site or replacing a button that you click
with the answer to a question. This subject is fully covered in Chapter 18.
Then, in Chapter 24, we take a good look at the jQuery framework, which
you can use to save reinventing the wheel when you need fast, cross-
browser code to manipulate your web pages. Of course, there are other
frameworks available too, so we also take a look at React, one of the most
popular choices of today, in Chapter 24 . Both are extremely reliable, and
are major tools in the utility kits of many seasoned web developers.

Using CSS
CSS is the crucial companion to HTML, ensuring that the HTML text and
embedded images are laid out consistently and in a manner appropriate for
the user’s screen. With the emergence of the CSS3 standard in recent years,
CSS now offers a level of dynamic interactivity previously supported only
by JavaScript. For example, not only can you style any HTML element to
change its dimensions, colors, borders, spacing, and so on, but now you can
also add animated transitions and transformations to your web pages, using
only a few lines of CSS.
Using CSS can be as simple as inserting a few rules between <style> and
</style> tags in the head of a web page, like this:

<style>
p {
text-align:justify;
font-family:Helvetica;
}
</style>

These rules change the default text alignment of the <p> tag so that
paragraphs contained in it are fully justified and use the Helvetica font.
As you’ll learn in Chapter 19 , there are many different ways you can lay
out CSS rules, and you can also include them directly within tags or save a
set of rules to an external file to be loaded in separately. This flexibility not
only lets you style your HTML precisely, but can also (for example)
provide built-in hover functionality to animate objects as the mouse passes
over them. You will also learn how to access all of an element’s CSS
properties from JavaScript as well as HTML.

And Then There’s HTML5


As useful as all these additions to the web standards became, they were not
enough for ever more ambitious developers. For example, there was still no
simple way to manipulate graphics in a web browser without resorting to
plug-ins such as Flash. And the same went for inserting audio and video
into web pages. Plus, several annoying inconsistencies had crept into
HTML during its evolution.
So, to clear all this up and take the internet beyond Web 2.0 and into its next
iteration, a new standard for HTML was created to address all these
shortcomings: HTML5. Its development began as long ago as 2004, when
the first draft was drawn up by the Mozilla Foundation and Opera Software
(developers of two popular web browsers), but it wasn’t until the start of
2013 that the final draft was submitted to the World Wide Web Consortium
(W3C), the international governing body for web standards.
It has taken a few years for HTML5 to develop, but now we are at a very
solid and stable version 5.1 (since 2016). It’s a never-ending cycle of
development, though, and more functionality is sure to be built into it over
time, with version 5.2 (planned to make the plugin system obsolete)
released as a W3C recommendation in 2017, and HTML 5.3 (with
proposed features such as auto-capitalisation) still in planning as of 2020,
and so on. Some of the best features in HTML5 for handling and displaying
media include the <audio>, <video>, and <canvas> elements, which
add sound, video, and advanced graphics. Everything you need to know
about these and all other aspects of HTML5 is covered in detail starting in
Chapter 25 .

NOTE
One of the little things I like about the HTML5 specification is that XHTML syntax is
no longer required for self-closing elements. In the past, you could display a line break
using the <br> element. Then, to ensure future compatibility with XHTML (the
planned replacement for HTML that never happened), this was changed to <br />, in
which a closing / character was added (since all elements were expected to include a
closing tag featuring this character). But now things have gone full circle, and you can
use either version of these types of elements. So, for the sake of brevity and fewer
keystrokes, in this book I have reverted to the former style of <br>, <hr>, and so on.

The Apache Web Server


In addition to PHP, MySQL, JavaScript, CSS, and HTML5, there’s a sixth
hero in the dynamic web: the web server. In the case of this book, that
means the Apache web server. We’ve discussed a little of what a web server
does during the HTTP server/client exchange, but it does much more
behind the scenes.
For example, Apache doesn’t serve up just HTML files—it handles a wide
range of files, from images and Flash files to MP3 audio files, RSS (Really
Simple Syndication) feeds, and so on. And these objects don’t have to be
static files such as GIF images. They can all be generated by programs such
as PHP scripts. That’s right: PHP can even create images and other files for
you, either on the fly or in advance to serve up later.
To do this, you normally have modules either precompiled into Apache or
PHP or called up at runtime. One such module is the GD (Graphics Draw)
library, which PHP uses to create and handle graphics.
Apache also supports a huge range of modules of its own. In addition to the
PHP module, the most important for your purposes as a web programmer
are the modules that handle security. Other examples are the Rewrite
module, which enables the web server to handle a range of URL types and
rewrite them to its own internal requirements, and the Proxy module, which
you can use to serve up often-requested pages from a cache to ease the load
on the server.
Later in the book, you’ll see how to use some of these modules to enhance
the features provided by the three core technologies.

Handling Mobile Devices


We are now firmly in a world of interconnected mobile computing devices,
and the concept of developing websites solely for desktop computers has
become rather dated. Instead, developers now aim to develop responsive
websites and web apps that tailor themselves to the environment in which
they find themselves running.
So, new in this edition, I show how you can easily create these types of
products using just the technologies detailed in this book, along with the
powerful jQuery Mobile library of responsive JavaScript functions. With it,
Exploring the Variety of Random
Documents with Different Content
isolated, degraded and ineffective; if there is too much, or the wrong
kind, the group becomes separate and forgets the whole. Let there
be “diversities of gifts but the same spirit.”
The present state of things as regards fellowship and coöperation
in special groups is, on the whole, one of deficiency rather than
excess. The confusion or “individualism” that we see in literature,
art, religion and industry means a want of the right kind of class
unity and spirit. There is a lack of mutual aid and support not only
among hand-workers, where it is much needed, but also among
scholars, artists, professional men, writers and men of affairs. The
ordinary business or professional man hardly feels himself a member
of any brotherhood larger than the family; with his wife and children
about him he stands in the midst of a somewhat cold and jostling
world, keeping his feet as best he can and seeking a mechanical
security in bank-account and life insurance—being less fortunate in
this regard, perhaps, than the trades-unionist, who has been forced
by necessity to stand shoulder-to-shoulder with his fellows and give
and take sacrifice for the common good. And much the same is true
of scholars and artists: they are likely not to draw close enough
together to keep one another warm and foster the class ideals which
lead the individual on to a particular kind of efficiency: there is a lack
of those snug nests of special tradition and association in which
more settled civilizations are rich.
Organization, of certain kinds, is no doubt more extensive and
elaborate than ever before, and organization, it may be said,
involves the interdependence, the unity, of parts. But will this be a
conscious and moral unity? In a high kind of organization it will; but
rapid growth may give us a system that is mechanical rather than, in
the higher sense, social. When organization quickly extends there is
a tendency to lower its type, as a rubber band becomes thinner the
more you stretch it; the relations grow less human, and so may
degrade instead of elevating the individual’s relation to his whole. In
a measure this has taken place in our life. The vast structure of
industry and commerce remains, for the most part, unhumanized,
and whether it proves a real good or not depends upon our success
or failure in making it vital, conscious, moral. There is union on a low
plane and isolation on a higher. The progress of communication has
supplied the mechanical basis for a spiritual organization far beyond
anything in the past; but this remains unachieved. On the whole, in
the words of Miss Jane Addams, with whom this is a cherished idea,
“The situation demands the consciousness of participation and well-
being which comes to the individual when he is able to see himself
‘in connection and coöperation with the whole’; it needs the solace
of collective art inherent in collective labor.”[114]
It is indeed probable that the growth of class fellowship will help
to foster that spirit of art in work which we so notably lack, and the
repose and content which this brings. There is truth in the view that
a confused and standardless competition destroys art, which
requires not only a group ideal but a certain deliberation, a chance
to brood over things and work perfection into them. When the
workman is more sure of his position, when he feels his fellows at
his shoulder and knows that the quality of his work will be
appreciated, he will have more courage and patience to be an artist.
We all draw our impulse toward perfection not from vulgar opinion
or from our pay, but from the approval of fellow craftsmen. The
truth, little seen in our day, is that all work should be done in the
spirit of art, and that no society is humanly organized in which this is
not chiefly the case.
It is also true that closer fellowship—dominated by good ideals—
should bring the sympathetic and moral motives to diligence and
efficiency into more general action, and relegate the ‘work or starve’
motive more to the background. Some of us love our work and are
eager to do it well; others have to be driven. Is this because the
former are naturally a superior sort of people, because the work
itself is essentially more inviting, or because the social conditions are
such that sympathy and fellowship are more enlisted with it?
Allowing something for the first two, I suspect the third is the
principal reason. What work is there that would not be pleasant in
moderate quantities, in good fellowship, and in the feeling of
service? No great proportion, I imagine, of our task. Washing dishes
is not thought desirable, and yet men do it joyfully when they go
camping together.
Class organization is not, as some people assert, necessarily
hostile to freedom. All organization is, properly, a means through
which freedom is sought. As conditions change, men are compelled
to find new forms of union through which to express themselves,
and the rise of industrial classes is of this nature.
In fact, the question of freedom, as applied to class conditions,
has two somewhat distinct aspects. These are:
1. Freedom to rise from one class into another, freedom of
individual opportunity, or carrière ouverte aux talents. This is chiefly
for the man of exceptional capacity and ambition. It is important,
but not more so than the other, namely:
2. Freedom of classes, or, what is the same thing, of those
individuals who have not the wish or power to depart from the
sphere of life in which circumstance has placed them. It means
justice, opportunity, humane living, for the less privileged groups as
groups; not opportunity to get out of them but to be something in
them; a chance for the teamster to have comfort, culture and good
surroundings for himself and his family without ceasing to be a
teamster.
The first of these has been much better understood in America
than the second. That it is wrong to keep a man down who might
rise is quite familiar, but that those who cannot rise, or do not care
to, have also just claims is almost a novel idea, though they are
evidently that majority for whom our institutions are supposed to
exist. Owing to a too exclusive preoccupation with ideals of
enterprise and ambition, a certain neglect, and even reproach, have
rested upon those who do quietly the plain work of life.
Ours, if you think of it, is rather too much success on the tontine
plan, where one puts all he has into a pool in the hope of being one
of a few survivors to get what the rest lose; it would be better to
take to heart that idea of Emerson’s that each may succeed in his
own way, without putting others down. It is a great thing that every
American boy may aspire to be president of the United States, or of
the Standard Oil Company, but it is equally important that he should
have a chance for full and wholesome life in the more probable
condition of clerk or mill hand. While we must admire the heroes of
Samuel Smiles, we may remember that they do and should
constitute only a small minority of the human race.
And the main guaranty for freedom of this latter sort is some kind
of class organization which shall resist the encroachment and
neglect of which the weaker parties in society are in constant
danger. Those who have wealth, position, knowledge, leisure, may
perhaps dispense with formal organization (though in fact it is those
who are strong already who most readily extend their strength in
this way), but the multitudes who have nothing but their human
nature to go upon must evidently stand together or go to the wall.

FOOTNOTES:
[113] I make frequent use of this word to mean an activity
which furthers some general interest of the social group. It differs
from “purpose” in not necessarily implying intention.
[114] Democracy and Social Ethics, 219.
CHAPTER XXII
HOW FAR WEALTH IS THE BASIS OF OPEN CLASSES

Impersonal Character of Open Classes—Various Classifications—Classes,


as Commonly Understood, Based on Obvious Distinctions—Wealth as
Generalized Power—Economic Betterment as an Ideal of the Ill-Paid
Classes—Conclusion.
Where classes do not mean separate currents of thought, as in the
case of caste, but are merely differentiations in a common mental
whole, there are likely to be several kinds of classes overlapping one
another, so that men who fall in the same class from one point of
view are separated in another. The groups are like circles which,
instead of standing apart, interlace with one another so that several
of them may pass through the same individual. Classes become
numerous and, so to speak, impersonal; that is, each one absorbs
only a part of the life of the individual and does not sufficiently
dominate him to mould him to a special type. This is one of the
things that distinguish our American order from that, say, of
Germany, where caste is still so dominant as to carry many other
differences with it and create unmistakable types of men. As a
newspaper writer puts it, “The one thing we may be sure of every
day is that not a man whom we shall meet in it will belong to his
type. The purse-proud aristocrat turns out to be a humble-minded
young fellow anxiously envious of our knowledge of golf; the comic
actor in private life is dull and shy, and reddens to the tips of his
ears when he speaks; the murderer taken out of the dock in a quiet
hob-and-nob turns out to be a likable young chap who reminds you
of your cousin Bob.”
And this independence of particular classes should give one the
more opportunity to achieve a truly personal individuality by
combining a variety of class affiliations, each one suited to a
particular phase of his character.
It is, then, easy to see why different classifiers discover different
class divisions in our society, according to their points of view;
namely, because there are in fact an indefinite number of possible
collocations. This would not have been the case anywhere in the
Middle Ages, nor is it nearly as much the case in England at the
present time as in the United States.
We might, to take three of the most conspicuous lines of division,
classify the people about us according to trade or profession,
according to income, and according to culture. The first gives us
lawyers, grocers, plumbers, bankers and the like, and also, more
generally, the hand-laboring class, skilled and unskilled, the
mercantile class, the professional class and the farming class. The
division by income is, of course, related to this, though by no means
identical. We might reckon paupers, the poor, the comfortable, the
well-to-do and the rich. Culture and refinement have with us no very
close or essential connection with occupation or wealth, and a
classification based upon the former would show a very general
rearrangement. There are many scholars and philosophers among us
who, like Thoreau, follow humble trades and live upon the income of
day labor.
And virtue, the most important distinction of all, is independent
alike of wealth, calling and culture. The real upper class, that which
is doing the most for the onward movement of human life, is not to
be discerned by any visible sign. The more inward or spiritual a trait
is, the less it is dependent upon what are ordinarily understood as
class distinctions.
It is, however, upon the grosser and more obvious differences of
wealth and rank, and not upon intellectual or moral traits, that
classes, in the ordinary meaning of the word, are based. The
reasons for this are, first, that something obvious and
unquestionable is requisite as a symbol and unfailing mark of class,
and, second, that the tangible distinctions alone are usual matters of
controversy. Culture and character have more intrinsic importance,
but are too uncertain to mark a class, and even if they were
stamped upon the forehead they are not matter to quarrel over like
wealth or titles; since those who have them not cannot hope to get
them by depriving those who have.
Income, for instance, classifies people through creating different
standards of living, those who fall into the same class in this respect
being likely to adopt about the same external mode of life. It usually
decides whether men live in one quarter of the city or another, what
sort of houses or apartments they inhabit, how they dress, whether
the wife “does all her own work” or employs household help (and, if
the latter, how much and of what sort), whether they keep a
carriage, whether they go into the country for the summer, whether
they travel abroad, whether they send their sons to college, and so
on. And such likeness leads to likeness of ideas, especially in that
commonplace sort of people—the most numerous of course—who
have not sufficient definiteness or energy of character to associate
on any other basis. Note how difficult it is for two people, congenial
in other respects, to converse freely when one has an income of
$5,000, the other of $500. Few topics can be touched upon without
accentuating the superficial but troublesome discrepancy.
Amusements, household and the like are hardly possible; the
weather may supply a remark or two, perhaps also politics, though
here the economic point of view is likely to appear. Religion or
philosophy, if the parties could soar so high, would be best of all. Of
course, serious discussion should be all the more practicable and
fruitful because of difference of viewpoint. What I mean, however, is
light, offhand, sociable talk that does not stir any depths. As
between their wives the situation would be harder still, and only an
unusual tact and magnanimity would make it tolerable.
The result is that we ordinarily find it most comfortable to
associate on a basis of income, combined with and modified by the
influence of occupation, culture and special tastes. And yet to do this
is perhaps a confession of failure, a confession that we do not know
how to cast off the adventitious and meet as men. The most
superficial differences, being the most apparent, impose themselves
upon our commonly indolent and sensuous states of mind.
In proportion to their energy men will always seek power. It is,
perhaps, the deepest of instincts, resting directly on the primary
need for self-expression. But the kind of power sought will take
many forms.
Wealth stands, in modern society, for nearly all the grosser and
more tangible forms; for power over material goods, primarily, and
secondarily over the more purchasable kinds of human activity—
hand labor, professional services, newspaper commendation, political
assiduity and so on. The class that has it is, in all such matters, the
strong class, and naturally our coarser thought concludes that this is
the kind of power most worth consideration. In all the obvious
details of life, in that seeking for petty advantages and immunities in
which most of our time is passed, at the store or the railway station,
we are measured by money and are apt to measure others so. The
ascendency of wealth is too natural to disappear. Children prize
possessions before they can talk, and readily learn that money is
possession generalized. Indeed, only the taste for finer possessions
can or should drive out that for lower.
And yet all clear minds, or rather all minds in their clearer
moments, may see that wealth is not the chief good that the
commonplace and superficial estimate makes it. It is simply a low
form of power, important in measure to the group and to the
individual, but easily preoccupying the mind beyond its just claim. If
society gets material prosperity too fast, its spiritual life suffers, as is
somewhat the case in our day: and the individual is in peril of moral
isolation and decay as soon as he seeks to get richer than his
fellows.
The finest and, in the long run, the most influential minds, have
for the most part not cared for riches, or not cared enough to go out
of their way to seek them, preferring to live on bare necessities if
they must rather than spend their lives in an uncongenial scramble.
And the distinctively spiritual leaders have always regarded them as
inconsistent with their aims. “Provide neither gold, nor silver, nor
brass in your purses, nor scrip for your journey, neither two coats,
neither shoes, nor yet staves.” Not that Christianity is opposed to
industrial prosperity—the contrary is the case—but that Christian
leadership required the explicit renunciation of prosperity’s besetting
sin. In our day the life of Thoreau, among others, illustrates how a
man may have the finer products of wealth—the culture of all times
—while preferring to remain individually poor. He held that for an
unmarried student, wishing first of all to preserve the independence
of his mind, occasional day labor, which one can do and have done
with, is the best way of getting a living. “A man is rich in proportion
to the number of things which he can afford to let alone.” “It makes
but little difference whether you are committed to a farm or the
county jail.”[115] The thoroughgoing way in which this doctrine is
developed in his Walden and other books makes them a vade
mecum for the impecunious idealist.
Professor William James asserts that the prevalent fear of poverty
among the educated classes is the worst moral disease from which
civilization suffers, paralyzing their ideal force. “Think of the strength
which personal indifference to poverty would give us if we were
devoted to unpopular causes. We need no longer hold our tongues
or fear to vote the revolutionary or reformatory ticket. Our stocks
might fall, our hopes of promotion vanish, our salaries stop, our club
doors close in our faces; yet, while we lived, we would imperturbably
bear witness to the spirit, and our example would help to set free
our generation.”[116]
If these considerations do not keep us from greed, it is because
most of us have only flashes of the higher ambition. We may believe
that we could reconcile ourselves to poverty if we had to—even that
it might be good for us—but we do our best to avoid it.
For the ill-paid classes, certainly, the desire for money does not
mean “materialism” in any reproachful sense, but is chiefly the
means by which they hope to realize, first, health and decency, and
then a better chance at the higher life—books, leisure, education
and refinement. They are necessarily materialized in a certain sense
by the fact that their most strenuous thought must be fixed upon
work and product in relation to material needs. It is in those who are
already well-to-do that the preoccupation with money is most
degrading—as not justified by primary wants. “Meat is sweetest
when it is nearest the bone,” and it is good to long and strive for
money when you have an urgent human need for it; but to do this
for accumulation, luxury, or a remote security is not wholesome. This
cold-blooded storing up in banks and tin boxes is perilous to the
soul, often becoming a kind of secret vice, a disease of narrow
minds, feeble imaginations and contracted living.[117]
In modern life, then, and in a country without formal privilege, the
question of classes is practically one of wealth, and of occupation
considered in relation to wealth; the reason being not that this
distinction really dominates life, but that it is the focus of the more
definite and urgent class controversies. Other aims are pursued in
peace; wealth, because it is material and appropriable, involves
conflict. We may then accept the economic standpoint for this
purpose without at all agreeing with those who regard it as more
fundamental than others.[118]

FOOTNOTES:
[115] Walden, 89, 91.
[116] The Varieties of Religious Experience, 368.
[117] I will not here discuss the question just how far it serves
a useful purpose in the economic system.
[118] If the reader cares to know my opinion of that doctrine—
sometimes called the economic interpretation of history—which
teaches that economic conditions are in a peculiar sense the
primary and determining factor in society, he will find it in the
following passages:
“The organic view of history [which I hold] denies that any
factor or factors are more ultimate than others. Indeed it denies
that the so-called factors—such as the mind, the various
institutions, the physical environment and so on—have any real
existence apart from a total life in which all share in the same
way that the members of the body share in the life of the animal
organism. It looks upon mind and matter, soil, climate, flora,
fauna, thought, language and institutions as aspects of a single
rounded whole, one total growth. We may concentrate attention
upon some one of these things, but this concentration should
never go so far as to overlook the subordination of each to the
whole, or to conceive one as precedent to others.”
“I cannot see that the getting of food, or whatever else the
economic activities may be defined to be, is any more the logical
basis of existence than the ideal activities. It is true that there
could be no ideas and institutions without a food supply; but no
more could we get food if we did not have ideas and institutions.
All work together, and each of the principal functions is essential
to every other.”
“History is not like a tangled skein which you may straighten
out by getting hold of the right end and following it with sufficient
persistence. It has no straightness, no merely lineal continuity, in
its nature. It is a living thing, to be known by sharing its life, very
much as you know a person. In the organic world—that is to say
in real life—each function is a centre from which causes radiate
and to which they converge; all is alike cause and effect; there is
no logical primacy, no independent variable, no place where the
thread begins. As in the fable of the belly and the members, each
is dependent upon all the others. You must see the whole or you
do not truly see anything.” (Publications of the American
Economic Association, Third Series, vol. v, 426 ff.)
CHAPTER XXIII
ON THE ASCENDENCY OF A CAPITALIST CLASS

The Capitalist Class—Its Lack of Caste Sentiment—In What Sense “the


Fittest”—Moral Traits—How Far Based on Service—Autocratic and
Democratic Principles in the Control of Industry—Reasons for
Expecting an Increase of the Democratic Principle—Social Power in
General—Organizing Capacity—Nature and Sources of Capitalist
Power—Power Over the Press and Over Public Sentiment—Upper-
class Atmosphere.

Since in our age commerce and industry absorb most of the


practical energy of the people, the men that are foremost in these
activities have a certain ascendency, similar to that of warriors in a
military age.
Although this sort of men is not sharply marked off, it is well
enough indicated by the term capitalist or capitalist-manager class;
the large owner of capital being usually more or less of a manager
also, while the large salaries and other gains of successful managers
soon make them capitalists.
It is not quite accurate to speak of the group in question as the
rich, because, at a given time, a large part of its most vigorous
membership is as yet without wealth—though in a way to get it—
and, on the other hand, many of the actual possessors of wealth are
personally idle or ineffective. The essential thing is a social tendency
or system of ideas generated in the accumulation of wealth and
having for its nucleus the more active and successful leaders of
commerce and industry.
That these are a very small class in proportion to their power is
apparent, but not, perhaps, in itself, so fatal a defect in the system
that permits it as many imagine. In so far as concentration of control
means that wealth is in the hands of those who understand how to
use it for the common good, and do in fact so use it, much may be
said in its favor. We are all eager to entrust our property to those
who will make it profitable to us; and society, under any system that
could be devised, must probably do the same. But we may well ask
whether there is not some more adequate means than we now have
of getting this trust faithfully executed.
For better or for worse, concentration is probably inevitable in any
society that has a vast, mobile wealth subject to competition; and
the actual inequality is perhaps not much greater than that of
political power, which is supposed to be equally distributed by
general suffrage. The truth is that equality of power or influence, in
any sphere of life, is inconsistent with the free working of human
forces, which is ever creating differences, some of which are useful
to society and some harmful. A true freedom, a reasonable equality,
aims to conserve the former and abolish or limit the latter.
The sentiment of the class is not aristocratic in the ordinary sense.
Although its members endeavor to secure their possessions to their
children, there is little of the spirit of hereditary caste, which, indeed,
is uncongenial to commerce. Freedom of opportunity is the ideal in
this as in other parts of American society, and educational or other
opportunities designed to maintain or increase it are sincerely
approved and supported. There is, in fact, an almost inevitable
dualism which makes it natural that a man should strive to
aggrandize himself, his family and his class even though he truly
wishes for greater equality of privilege. He floats on two currents,
and as a man and a brother may be glad of restraints upon his own
class which are in the interest of justice.
The ideal of freedom prevalent in the managing class is, however,
somewhat narrow and hardly hospitable to the group self-assertion
of the less privileged classes. The labor movement has made its way
by its energy and reasonableness in the face of a rather general
mistrust and opposition—sometimes justified by its aberrations—on
the part of the masters of industry. Yet even in this regard, as it
comes to be seen that organization is an element of fair play, and as
experience shows that union may become an instrument of stability,
a broader sentiment makes headway.
Like everything else that has power in human life, the money-
strong represent, in some sense, the survival of the fittest—not
necessarily of the best. That is, their success, certainly no guaranty
of righteousness, does prove a certain adaptation to conditions,
those who get rich being in general the ablest, for this purpose, of
the many who devote their energies to it with about the same
opportunities. They are not necessarily the ablest in other regards,
since only certain kinds of ability count in making money; other
kinds, and those often the highest, such as devotion to intellectual
or moral ideals, being even a hindrance. Men of genius will seldom
shine in this way, because, as a rule, only a somewhat commonplace
mind will give itself whole-heartedly to the commercial ideal.
There is much likeness in the persons and methods by which, in
all ages, the cruder sort of power is acquired. When the military
system is ascendent over the industrial it is acquired in one way,
when property is secure from force in another, but this makes less
difference than might be supposed. In either case it is not mere
personal prowess, with the sword or with the tool, that gains large
success, but power in organization. Aggressiveness, single-minded
devotion to the end and, above all, organizing faculty—these were
the methods of Clovis and Pepin and William of Normandy, as they
are of our rulers of finance. And now, as formerly, much of the
power that is alive in such men falls by inheritance into weaker
hands.
As to righteousness, in the sense of good intention, they probably
do not, on the whole, differ much from the average. Some may be
found of the highest character, some of gross unscrupulousness. The
majority are doubtless without moral distinction and take the color of
their associates. The view sometimes set forth on behalf of men of
wealth that riches go with virtue, and the view, more popular among
non-possessors, that it comes by wickedness, are equally
untrustworthy. The great mass of wealth is accumulated by solid
qualities—energy, tenacity, shrewdness and the like—which may
coexist with great moral refinement or with the opposite.
As a group, however, they are liable to moral deficiencies
analogous to those of the conquerors and organizers of states just
referred to. There is, especially, a certain moral irresponsibility which
is natural to those who have broken away from customary limitations
and restraints and are coursing almost at will over an unfenced
territory. I mean that business enterprise, like military enterprise,
deals largely with relations as to which there are no settled rules of
morality, no constraining law or public opinion. Such conditions
breed in the ordinary actor a Macchiavellian opportunism. Since it is
hard to say what is just and honest in the vast and abstract
operations of finance, human nature is apt to cease looking for a
standard and to seize booty wherever and however it safely can.
Hence the truly piratical character of many of our great transactions.
And in smaller matters also, as in escaping taxation, it is often fatally
easy for the rich to steal.
It must be allowed that such ascendency as the capitalist class has
rests, in part at least, upon service. That is to say, its members have
had an important function to perform, and in performing that
function have found themselves in a position to grasp wealth. The
great work of the time has been, or has seemed to be, the extension
and reconstruction of industry. In this work leadership and
organization have been needed on a great scale, and our captains of
industry have nobly met this demand. That their somewhat
autocratic control of production was called for by the situation seems
to be shown by the rather general failure of coöperative enterprises
intended to dispense with it. Why is it that America abounds in
opportunity, and that every sort of industrial capacity is eagerly
sought out and rewarded? Of course natural advantages play a great
part, but much must also be ascribed to the energy and imaginative
daring of our entrepreneurs, many of whom have spent great faculty
and tireless zeal upon business, in a spirit of adventure and
achievement rather than of gain. Where the general is aggressive
the soldier will be kept busy.
I have no sympathy with the general abuse of commercialism, but
hold with Montesquieu that “The spirit of commerce is naturally
attended with that of frugality, economy, moderation, labor,
prudence, tranquillity, order and rule. So long as this spirit subsists
the riches it produces have no ill effect. The mischief is when
excessive wealth destroys the spirit of commerce; then it is that the
inconveniences of inequality begin to be felt.”[119]
The conception of keen adaptation of means to ends, of exact
social workmanship, inculcated by “business” is of untold value to
our civilization and capable of very general application. It is a very
proper demand that government, education and philanthropy
should, in this sense, be conducted on business principles.
At the same time it is plain that a large part of the accumulation of
wealth—hard unfortunately to distinguish from other parts—is
accomplished not by social service but, as just intimated, by
something akin to piracy. This is not so much the peculiar
wickedness of a predatory class as a tendency in all of us to abuse
power when not under definite legal or moral control. The vast
transactions associated with modern industry have come very little
under such control, and offer a field for freebooting such as the
world has never seen.
Nor need we affirm that even the gains of the great organizers are
in the highest sense right, only that they are natural and do not
necessarily involve conscious wrong-doing.
The question of the rather arbitrary control of industry by the
capitalist-manager, which now prevails, and of the possibility of this
control being diminished or modified in the future, calls for some
analysis of underlying forces. Evidently there is a conflict of
principles here—the democratic or popular and the autocratic. The
latter, now ascendant, has the advantages of concentration, secrecy
and promptness—the same which give it superiority in war. On the
other hand, the democratic principle should have the same merit in
industry and commerce that it has in politics; namely that of
enlisting the pride and ambition of the individual and so getting him
to put himself into his work. Other things being equal, a free system
is a more vital and energetic organism than one in which the
initiative and choice come from a central authority.
And it is apparent that the working of the autocratic system in our
economic life shows just the strength and weakness that would
naturally be expected. The prompt undertaking and execution of
vast schemes at a favorable moment, and the equally prompt
recession when conditions alter; the investment of great resources in
enterprises which yield no immediate return; the decision and
secrecy important in overcoming competitors; the unhesitating
sacrifice of workmen and their families when the market calls for a
shut-down of production—such traits as these are of the utmost
importance to commercial success, and belong to arbitrary control
rather than to anything of a more popular sort. On the other hand, it
would be easy to show at any length desired that such control is
accompanied by a widespread disaffection of spirit on the part of the
working classes, which, expressed in unwilling labor, strikes and
agitation, is a commercial disadvantage, and a social problem so
urgent as to unsettle the whole economic system.
The autocratic system has evidently a special advantage in a time
of rapid and confused development, when conditions are little
understood or regulated, and the state of things is one of somewhat
blind and ruthless warfare; but it is quite possible that as the new
industries become established and comparatively stable, there will
be a commercial as well as a social demand for a system that shall
invite and utilize more of the good-will and self-activity of the
workman. “The system which comes nearest to calling out all the
self-interests and using all the faculties and sharing all the benefits
will outcompete any system that strikes a lower level of motive
faculty and profit.”[120] And the penetrating thinker who wrote this
sentence believed that the function of the autocratic “captain of
industry” was essentially that of an explorer and conqueror of new
domains destined to come later under the rule of a commonwealth.
Indeed the rise, on purely commercial grounds, of a more humane
and individualizing tendency, aiming in one way or another to
propitiate the self-feeling of the workman and get him to identify
himself with his work, is well ascertained. Among the familiar phases
of this are the notable growth of coöperative production and
exchange in Belgium, Russia and other European countries, the
increasing respect for labor unions and the development by large
concerns of devices for insurance, for pensions, for profit-sharing
and for the material and social comfort of their employees. “As a
better government has come up from the people than came down
from the kings, so a better industry appears to be coming up from
the people than came down from the capitalists.”[121]
In some form or other the democratic principle is sure to make its
way into the economic system. Coöperation, labor unions, public
regulation, public ownership and the informal control of opinion will
no doubt all have a part; the general outcome being that the citizen
becomes a more vital agent in the life of the whole.
Before discussing further the power of the capitalist-manager
class, we ought to think out clearly just what we mean by social
power, since nowhere are we more likely to go astray than in
vagueness regarding such notions.
Evidently the essence of it is control over the human spirit, and
the most direct phases of power are immediately spiritual, such as
one mind exercises over another by virtue of what it is, without any
means but the ordinary symbols of communication. This is live,
human power, and those who have it in great degree are the prime
movers of society, whether they gain any more formal or
conventional sort or not. Such, for instance, are the poets, prophets,
philosophers, inventors and men of science of all ages, the great
political, military and religious organizers, and even the real captains
of industry and commerce. All power involves in its origin mental or
spiritual force of some sort; and so far as it attaches to passive
attributes, like hereditary social position, offices, bank-accounts, and
the like, it does so through the aid of conventions and habits which
regard these things as repositories of spiritual force and allow them
to exercise its function.
In its immediate spiritual phase power is at a maximum of vitality
and a minimum of establishment. Only a few can recognize it. Its
possessors, then, strive to establish and organize it, to give it social
expression and efficacy, to gain position, reputation or wealth. Since
power is not apparent to the common mind until it takes on these
forms, they are, to superficial observation and in all the conventional
business of life, the only valid evidence of it. And yet by the time
these symbols appear, the spiritual basis has often passed away.
Primary power goes for the most part unseen, much of it taking on
no palpable form until late in life, much yielding only posthumous
reputation, and much, and that perhaps the finest sort, having never
any vulgar recognition whatever.
Regarding money-value we may say, in general, that it is one
expression of the conventional or institutional phase of society, and
exhibits all that mixture of grandeur and confusion with which nature
usually presents herself to our understanding. I mean that its
appraisal of men and things is partly expressive of great principles,
and partly, so far as we can see, unjust, trivial or accidental. Some
gains are vital or organic, springing from the very nature of life and
justified as we come to understand that life; some are fanciful,
springing from the tastes or whims of the rich, like the value of
diamonds or first editions, and some parasitical, like those of the
legally-protected swindler. In general the values of the market are
those of the habitual world in all its grossness; spiritual values,
except those that have become conventional, being little felt in it.
These appeal to the future. The detailed working of market value
has no ascertainable connection with moral worth, and we must not
expect it to have. If a man’s work is moral, in the higher sense, it is
in its nature an attack upon the habitual world which the latter is
more likely to resent than reward. One can only take up that useful
work that seems best suited to him, trying to be content if its value
is small, and, if large, to feel that the power over money it gives him
is rightly his only in so far as he uses it for the general good.
The more tangible kind of social power—so far as it is intrinsic to
the man and not adventitious like inherited wealth—depends chiefly
upon organizing capacity, which may be described as the ability to
build and operate human machinery. It has its roots in tact and skill
in dealing with men, in tenacity, and in a certain instinct for
construction. One who possesses it sees a new person as social
material, and is likely to know what can be made of him better than
he knows himself.[122]
Of all kinds of leadership this has the readiest recognition and the
highest market value; and naturally so, since it is essential to every
sort of coöperative achievement. Its possessors understand the
immediate control of the world, which they will exercise no matter
what the apparent forms of organization may be. In all ages they
have gained and held the grosser forms of power, whenever these
were at all open to competition. Thus, during the early Middle Age,
men of energy and management, more or less favored by situation,
built up for themselves local authority and estate, or perhaps
exploited the opportunities for still wider organization, like the
founders of Burgundy and Brittany and the early kings of France;
very much in the same manner as men of our own day build up
commercial and industrial systems and become senators and railway
presidents.
Indeed, this type of ability was never in such demand as it now is,
for the conduct of the vast and diverse social structures rising about
us—industrial enterprises, political parties, labor unions, newspapers,
universities and philanthropies.
It has its high money value partly because of its rarity and partly
because there is a regular market for it; the need being so urgent
and obvious as to create a steady and intelligent demand. In this
latter respect it contrasts with services, like moral leadership, which
people need but will seldom pay for. A third reason is that its
possessors are almost always clever enough to know their own value
and secure its recognition.
In discussing the power of the capitalist class there is no question
of the finer and higher forms of power. We shall rarely find among
the rich any pregnant spiritual leadership, theirs being a pedestrian
kind of authority which has a great deal to do with the every-day
comfort of their contemporaries but does not attempt to sway the
profounder destinies of the race. Nor does the world often accord
them enduring fame: lacking spiritual significance their names are
writ in water. Even in industry the creative thought, the inventions
which are the germs of a new era, seldom come from money-
winners, since they require a different kind of insight.
The capitalist represents power over those social values that are
tangible and obvious enough to have a definite standing in the
market. His money and prestige will command food, houses, clothes,
tools and all conventional and standard sorts of personal service,
from lawn-mowing to the administration of a railroad, not genius or
love or anything of that nature. That wealth means social power of
this coarser sort is apparent in a general way, and yet merits a
somewhat closer examination.
We have, first, its immediate power over goods and services: the
master of riches goes attended by an invisible army of potential
servitors, ready to do for him anything that the law allows, and often
more. He is in this way, as in so many others, the successor of the
nobleman of mediæval and early modern history, who went about
with a band of visible retainers eager to work his will upon all
opposers. He is the ruler of a social system wherever he may be.
The political power of wealth is due only in part to direct
corruption, vast as that is, but is even more an indirect and perfectly
legal pressure in the shape of inducements which its adroit use can
always bring to bear—trade to the business man, practice to the
lawyer and employment to the hand-worker: every one when he
thinks of his income wishes to conciliate the rich. Influence of this
sort makes almost every rich man a political power, even without his
especially wishing to be. But when wealth is united to a shrewd and
unscrupulous political ambition, when it sets out to control legislation
or the administration of the laws, it becomes truly perilous. We
cannot fail to see that a large part of our high offices are held by
men who have no marked qualification but wealth, and would be
insignificant without it; also that our legislation—municipal, state and
national—and most of our administrative machinery, feel constantly
the grasp of pecuniary power. Probably it is not too much to say that
except when public opinion is unusually aroused wealth can
generally have its way in our politics if it makes an effort to do so.
As to the influence of the rich over the professional classes—
lawyers, doctors, clergymen, teachers, civil and mechanical
engineers and the like—we may say in general that it is potent but
somewhat indirect, implying not conscious subservience but a moral
ascendency through habit and suggestion. The abler men of this sort
are generally educated and self-respecting, have a good deal of
professional spirit and are not wholly dependent upon any one
employer. At the same time, they get their living largely through the
rich, from whom the most lucrative employment comes, and who
have many indirect ways of making and marring careers. The ablest
men in the legal profession are in close relations with the rich and
commonly become capitalists themselves; physicians are more
independent, because their art is not directly concerned with
property, yet look to wealthy patients for their most profitable
practice; clergymen are under pressure to satisfy wealthy
parishioners, and teachers must win the good will of the opulent
citizens who control educational boards.
Now there is nothing in social psychology surer than that if there
is a man by whose good will we desire to profit, we are likely to
adapt our way of thinking to his. Impelled to imagine frequently his
state of mind, and to desire that it should be favorable to our aims,
we are unconsciously swayed by his thought, the more so if he
treats us with a courtesy which does not alarm our self-respect. It is
in this way that wealth imposes upon intellect. Who can deny it?
Newspapers are generally owned by men of wealth, which has no
doubt an important influence upon the sentiments expressed in
them; but a weightier consideration is the fact that they depend for
profit chiefly upon advertisements, the most lucrative of which come
from rich merchants who naturally resent doctrines that threaten
their interest. Of course the papers must reach the people, in order
to have a value for advertising or any other purpose, and this
requires adaptation to public opinion; but the public of what are
known as the better class of papers are chiefly the comparatively
well-to-do. And even that portion of the press which aims to please
the hand-working class is usually more willing to carry on a loud but
vague agitation, not intended to accomplish anything but increase
circulation, than to push real and definite reform.
All phases of opinion, including the most earnest and honest
inquiry into social questions, finds some voice in print, but—leaving
aside times when public opinion is greatly aroused—those phases
that are backed by wealthy interests have a great advantage in the
urgency, persistence and cleverness with which they are presented.
At least, this has been the case in the past. It is a general feeling of
thoughtful men among the hand-working class that it is hard to get
a really fair statement of their view of industrial questions from that
portion of the newspaper and magazine press that is read by well-
to-do people. The reason seems to be mainly that the writers live
unconsciously in an atmosphere of upper-class ideas from which
they do not free themselves by thorough inquiry. Besides this, there
is a sense of what their readers expect, and also, perhaps, a vague
feeling that the sentiments of the hand-working class may threaten
public order.
Since the public has supplanted the patron, a man of letters has
least of all to hope or fear from the rich—if he accepts the opinion of
Mr. Howells that the latter can do nothing toward making or marring
a new book.
The power of wealth over public sentiment is exercised partly
through sway over the educated classes and the press, but also by
the more direct channel of prestige. Minds of no great insight, that is
to say the majority, mould their ideals from the spectacle of visible
and tangible success. In a commercial epoch this pertains to the
rich; who consequently add to the other sources of their influence
power over the imagination. Millions accept the money-making ideal
who are unsuited to attain it, and run themselves out of breath and
courage in a race they should never have entered; it is as if the thin-
legged and flat-chested people of the land should seek glory in foot-
ball. The money-game is mere foolishness and mortification for most
of us, and there is a madness of the crowd in the way we enter into
it. Even those who most abuse the rich commonly show mental
subservience in that they assume that the rich have, in fact, gotten
what is best worth having.
As hinted above, there is such a thing as an upper-class
atmosphere, in the sense of a state of mind regarding social
questions, initiated by the more successful money-winners and
consciously or unconsciously imposed upon business and
professional people at large. Most of us exist in this atmosphere and
are so pervaded by it that it is not easy for us to understand or fairly
judge the sentiment of the hand-working classes. The spokesmen of
radical doctrines are, in this regard, doing good service to the public
mind by setting in motion counterbalancing, if not more trustworthy,
currents of opinion.
If any one of business or professional antecedents doubts that he
breathes a class atmosphere, let him live for a time at a social
settlement in the industrial part of one of our cities—not a real
escape but as near it as most of us have the resolution to achieve—
reading working-class literature (he will be surprised to find how well
worth reading it is), talking with hand-working people, attending
meetings, and in general opening his mind as wide as possible to the
influences about him. He will presently become aware of being in a
new medium of thought and feeling; which may or may not be
congenial but cannot fail to be instructive.
FOOTNOTES:
[119] The Spirit of Laws, book v, chap. 6.
[120] Henry D. Lloyd, Man the Social Creator, 255.
[121] Idem, 246. Lloyd was rather a prophet than a man of
science, but there is a shrewd sense of fact back of his visions.
[122] Such a one

“Lässt jeden ganz das bleiben was er ist;


Er wacht nur drüber das er’s immer sei
Am rechten Ort; so weiss er aller Menschen
Vermögen zu dem seinigen zu machen.”

“He lets every one remain just what he is, but takes care that
he shall always be it in the right place: thus he knows how to
make all men’s power his own.” Schiller, Wallenstein’s Lager, I, 4.
CHAPTER XXIV
ON THE ASCENDENCY OF A CAPITALIST CLASS—Continued

The Influence of Ambitious Young Men—Security of the Dominant Class in


an Open System—Is there Danger of Anarchy and Spoliation?—
Whether the Sway of Riches is Greater now than Formerly—Whether
Greater in America than in England.
In any society where there is some freedom of opportunity
ambitious young men are an element of extreme importance. Their
numbers are formidable and their intelligence and aggressiveness
much more so: in short, they want an opening and are bound to get
it.
As the members of this class are mainly impecunious, it might be
supposed that they would be a notable offset to the power of
wealth; and in a sense they are. It is their interest to keep open the
opportunity to rise, and they are accordingly inimical to caste and
everything which tends toward it. But it by no means follows that
they are opposed to the ascendency of an upper class based on
wealth and position. This becomes evident when one remembers
that their aim is not to raise the lower class, but to get out of it. The
rising young man does not identify himself with the lowly stratum of
society in which he is born, but, dissatisfied with his antecedents, he
strikes out for wealth, power or fame. In doing so he fixes his eyes
on those who have these things, and from whose example he may
learn how to gain them; thus tending to accept the ideals and
standards of the actual upper class. He gives a great deal of
attention to the points of view of A, a railroad president, B, a
senator, and even of C, head of a labor organization, but to a mere
farmer or laborer, whose hand is on no levers, he is indifferent.
The students of our universities are subject to a conflict between
the healthy idealism of youth, which prevails with the more
generous, and the influences just indicated, which become stronger
as education draws closer to practical affairs. On the whole,
possessed of one great privilege and eager to gain others, they are
not so close in spirit to the unprivileged classes as might be
imagined.
Thus the force of ambitious youth goes largely to support the
ascendency of the money-getting class; directly, in that it accepts
the ideals of this class and looks forward to sharing its power;
indirectly, in that it is withdrawn from the resources of the humbler
class. How long will the rising lawyer retain his college enthusiasm
for social reform if the powers that be welcome him and pay him
salaries?
We have then the fact, rather paradoxical at first sight, that the
dominant class in a competitive society, although unstable as to its
individual membership, may well be more secure as a whole than
the corresponding class under any other system—precisely because
it continually draws into itself most of the natural ability from the
other classes. Throughout English history, we are told, the salvation
of the aristocracy has been its comparative openness, the fact that
ability could percolate into it, instead of rising up behind it like water
behind a dam, as was the case in pre-revolutionary France. And the
same principle is working even more effectually in our own economic
order. A great weakness of the trades-union movement, as of all
attempts at self-assertion on the part of the less privileged classes, is
that it is constantly losing able leaders. As soon as a man shows that
marked capacity which would fit him to do something for his fellows,
it is ten to one that he accepts a remunerative position, and so
passes into the upper class. It is increasingly the practice—perhaps
in some degree the deliberate policy—of organized wealth to win
over in this way the more promising leaders from the side of labor;
and this is one respect in which a greater class-consciousness and
loyalty on the part of the latter would add to its strength.
Thus it is possible to have freedom to rise and yet have at the
same time a miserable and perhaps degraded lower class—degraded
because the social system is administered with little regard to its just
needs. This is more the case with our own industrial system, and
with modern society in general, than our self-satisfaction commonly
perceives. Our one-sided ideal of freedom, excellent so far as it
goes, has somewhat blinded us to the encroachments of slavery on
an unguarded flank. I mean such things as bad housing, insecurity,
excessive and deadening work, child labor and the lack of any
education suited to the industrial masses—the last likely to be
remedied now that it is seen to threaten industrial prosperity.
It is hard to say how much of the timidity noticeable in the
discussion of questions of this sort by the comfortable classes is due
to a vague dread of anarchy and spoliation by an organized and self-
conscious lower class; but probably a good deal. If power, under
democracy, goes with numbers, and the many are poor, it would
seem at first glance that they would despoil the few.
To conservative thinkers a hundred, or even fifty, years ago this
seemed almost an axiom, but a less superficial philosophy has
combined with experience to show that anarchy, in Mr. Bryce’s
words, “is of all dangers or bugbears the one which the modern
world has least cause to fear.”[123]
The most apparent reason for this is the one already discussed,
namely, that power does not go with mere numbers, under a
democracy more than under any other form of government; a
democratic aristocracy, that is, one whose members maintain their
position in an open struggle, being without doubt the strongest that
can exist. We shall never have a revolution until we have caste;
which, as I have tried to show, is but a remote possibility. And as an
ally of established power we have to reckon with the inertia of social
structure, something so massive and profound that the loudest
agitation is no more than a breeze ruffling the surface of deep
waters. Dominated by the habits which it has generated, we all of
us, even the agitators, uphold the existing order without knowing it.
There may, of course, be sudden changes due to the fall of what has
long been rotten, but I see little cause to suppose that the timbers
of our system are in this condition: they are rough and unlovely, but
far from weak.
Another conservative condition is that economic solidarity which
makes the welfare of all classes hang together, so that any general
disturbance causes suffering to all, and more to the weak than to
the strong. A sudden change, however reasonable its direction, must
in this way discredit its authors and bring about reaction. The hand-
working classes may get much less of the economic product than
they ought to; but they are not so badly off that they cannot be
worse, and, unless they lose their heads, will always unite with other
classes to preserve that state of order which is the guaranty of what
they have. Anarchy would benefit no one, unless criminals, and
anything resembling a general strike I take to be a childish expedient
not likely to be countenanced by the more sober and hard-headed
leaders of the labor movement. All solid betterment of the workers
must be based on and get its nourishment from the existing system
of production, which must only gradually be changed, however
defective it may be. The success of strikes, and of all similar tactics,
depends, in the nature of things, on their being partial, and drawing
support from the undisturbed remainder of the process. It is the
same principle of mingling stability with improvement which governs
progress everywhere.
And, finally, effective organization on the part of the less privileged
classes goes along with intelligence, with training in orderly methods
of self-assertion, and with education in the necessity of patience and
compromise. The more real power they get, the more conservatively,
as a rule, they use it. Where free speech exists there will always be
a noisy party advocating precipitate change (and a timid party who
are afraid of them), but the more the people are trained in real
democracy the less will be the influence of this element.
Whatever divisions there may be in our society, it is quite enough
an organic whole to unite in casting out tendencies that are clearly
anarchic. And it is also evident that such tendencies are to be looked
for at least as much among the rich as among the poor. If we have
at one extreme anarchists who would like to despoil other people,
we have, at the other, monopolists and financiers who actually do
so.
It is a common opinion that the sway of riches over the human
mind is greater in our time than previously, and greater in America
than elsewhere. How far is this really the case?
To understand this matter we must not forget that the ardor of the
chase—as in a fox hunt—may have little to do with the value of the
quarry. The former, certainly, was never so great in the pursuit of
wealth as here and now; chiefly because the commercial trend of
the times, due to a variety of causes, supplies unequalled
opportunities and incitements to engage in the money-game. In this,
therefore, the competitive zeal of an energetic people finds its main
expression. But to say that wealth stands for more in the inner
thought of men, that to have or not to have it makes a greater
intrinsic difference, is another and a questionable proposition, which
I am inclined to think opposite to the truth. Such spiritual value as
personal wealth has comes from its power over the means of
spiritual development. It is, therefore, diminished by everything
which tends to make those means common property: and the new
order has this tendency. When money was the only way to
education, to choice of occupation, to books, leisure and variety of
intercourse, it was essential to the intellectual life; there was no
belonging to the cultured class without it. But with free schools and
libraries, the diffusion of magazines and newspapers, cheap travel,
less stupefying labor and shorter hours, culture opportunity is more
and more extended, and the best goods of life are opened, if not to
all, yet to an ever-growing proportion. Men of the humblest
occupations can and do become gentlemen and scholars. Indeed,
people are coming more and more to think that exclusive
advantages are uncongenial to real culture, since the deepest insight
into humanity can belong only to those who share and reflect upon
the common life.
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!

ebooknice.com

You might also like