0% found this document useful (0 votes)
62 views63 pages

PHP and MySQL Web Development 5th Edition Developer S Library Luke Welling - The Ebook Is Available For Online Reading or Easy Download

The document promotes a collection of eBooks focused on PHP and MySQL web development, providing links to various titles available for instant download at textbookfull.com. It includes notable works such as 'PHP and MySQL Web Development' by Luke Welling and Laura Thomson, and 'Learning PHP, MySQL & JavaScript' by Robin Nixon, among others. The eBooks are available in multiple formats, ensuring accessibility on various devices for readers interested in web development.

Uploaded by

eggerejoke
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views63 pages

PHP and MySQL Web Development 5th Edition Developer S Library Luke Welling - The Ebook Is Available For Online Reading or Easy Download

The document promotes a collection of eBooks focused on PHP and MySQL web development, providing links to various titles available for instant download at textbookfull.com. It includes notable works such as 'PHP and MySQL Web Development' by Luke Welling and Laura Thomson, and 'Learning PHP, MySQL & JavaScript' by Robin Nixon, among others. The eBooks are available in multiple formats, ensuring accessibility on various devices for readers interested in web development.

Uploaded by

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

Explore the full ebook collection and download it now at textbookfull.

com

PHP and MySQL Web Development 5th Edition


Developer s Library Luke Welling

https://textbookfull.com/product/php-and-mysql-web-
development-5th-edition-developer-s-library-luke-welling/

OR CLICK HERE

DOWLOAD EBOOK

Browse and Get More Ebook Downloads Instantly at https://textbookfull.com


Click here to visit textbookfull.com and download textbook now
Your digital treasures (PDF, ePub, MOBI) await
Download instantly and pick your perfect format...

Read anywhere, anytime, on any device!

PHP and MySQL for Dynamic Web Sites Fifth Edition Ullman

https://textbookfull.com/product/php-and-mysql-for-dynamic-web-sites-
fifth-edition-ullman/

textbookfull.com

The Object Oriented Thought Process Developer s Library


5th Edition Weisfeld

https://textbookfull.com/product/the-object-oriented-thought-process-
developer-s-library-5th-edition-weisfeld/

textbookfull.com

Beginning PHP and MySQL: From Novice to Professional 5th


Edition Frank M. Kromann

https://textbookfull.com/product/beginning-php-and-mysql-from-novice-
to-professional-5th-edition-frank-m-kromann/

textbookfull.com

Learning PHP MySQL JavaScript With jQuery CSS HTML5 5th


Edition Robin Nixon

https://textbookfull.com/product/learning-php-mysql-javascript-with-
jquery-css-html5-5th-edition-robin-nixon/

textbookfull.com
Web App Development Made Simple with Streamlit A web
developer s guide to effortless web app development
deployment 1 / converted Edition Rosario Moscato
https://textbookfull.com/product/web-app-development-made-simple-with-
streamlit-a-web-developer-s-guide-to-effortless-web-app-development-
deployment-1-converted-edition-rosario-moscato/
textbookfull.com

Node js MongoDB and Angular Web Development The definitive


guide to using the MEAN stack to build web applications
Developer s Library 2nd Edition Brad Dayley & Brendan
Dayley & Caleb Dayley
https://textbookfull.com/product/node-js-mongodb-and-angular-web-
development-the-definitive-guide-to-using-the-mean-stack-to-build-web-
applications-developer-s-library-2nd-edition-brad-dayley-brendan-
dayley-caleb-dayley/
textbookfull.com

PHP for the Web Visual QuickStart Guide 5th Edition Larry
Ullman

https://textbookfull.com/product/php-for-the-web-visual-quickstart-
guide-5th-edition-larry-ullman/

textbookfull.com

Learning PHP, MySQL & JavaScript, 6th Edition Robin Nixon

https://textbookfull.com/product/learning-php-mysql-javascript-6th-
edition-robin-nixon/

textbookfull.com

A Web Based Introduction to Programming Essential


Algorithms Syntax and Control Structures Using Php Html
and Mariadb MySQL Mike O’Kane
https://textbookfull.com/product/a-web-based-introduction-to-
programming-essential-algorithms-syntax-and-control-structures-using-
php-html-and-mariadb-mysql-mike-okane/
textbookfull.com
About This E-Book
EPUB is an open, industry-standard format for e-books. However,
support for EPUB and its many features varies across reading
devices and applications. Use your device or app settings to
customize the presentation to your liking. Settings that you can
customize often include font, font size, single or double column,
landscape or portrait mode, and figures that you can click or tap to
enlarge. For additional information about the settings and features
on your reading device or app, visit the device manufacturer’s Web
site.
Many titles include programming code or configuration examples.
To optimize the presentation of these elements, view the e-book in
single-column, landscape mode and adjust the font size to the
smallest setting. In addition to presenting code and configurations in
the reflowable text format, we have included images of the code
that mimic the presentation found in the print book; therefore,
where the reflowable format may compromise the presentation of
the code listing, you will see a “Click here to view code image” link.
Click the link to view the print-fidelity code image. To return to the
previous page viewed, click the Back button on your device or app.
PHP and MySQL® Web
Development
Fifth Edition

Luke Welling
Laura Thomson

Hoboken, NJ • Boston • Indianapolis • San Francisco


New York • Toronto • Montreal • London • Munich • Paris • Madrid
Cape Town • Sydney • Tokyo • Singapore • Mexico City
PHP and MySQL® Web Development
Copyright © 2017 by Pearson Education, Inc.
All rights reserved. No part of this book shall be reproduced, stored
in a retrieval system, or transmitted by any means, electronic,
mechanical, photocopying, recording, or otherwise, without written
permission from the publisher. No patent liability is assumed with
respect to the use of the information contained herein. Although
every precaution has been taken in the preparation of this book, the
publisher and authors assume no responsibility for errors or
omissions. Nor is any liability assumed for damages resulting from
the use of the information contained herein.
ISBN-13: 978-0-321-83389-1
ISBN-10: 0-321-83389-9
Library of Congress Control Number: 2016934688
Printed in the United States of America
First Printing: September 2016

Trademarks
All terms mentioned in this book that are known to be trademarks or
service marks have been appropriately capitalized. Pearson cannot
attest to the accuracy of this information. Use of a term in this book
should not be regarded as affecting the validity of any trademark or
service mark.

Warning and Disclaimer


Every effort has been made to make this book as complete and as
accurate as possible, but no warranty or fitness is implied. The
information provided is on an “as is” basis. The authors and the
publisher shall have neither liability nor responsibility to any person
or entity with respect to any loss or damages arising from the
information contained in this book.
Special Sales
For information about buying this title in bulk quantities, or for
special sales opportunities (which may include electronic versions;
custom cover designs; and content particular to your business,
training goals, marketing focus, or branding interests), please
contact our corporate sales department at
[email protected] or (800) 382-3419.
For government sales inquiries, please contact
[email protected].
For questions about sales outside the U.S., please contact
[email protected].
Editor
Mark Taber
Project Editor
Lori Lyons
Project Manager
Dhayanidhi
Copy Editor
Lori Eby
Indexer
Tim Wright
Technical Editor
Julie Meloni
“I’ve never purchased a better programming book... This
book proved to be the most informative, easiest to follow,
and had the best examples of any other computer-related
book I have ever purchased. The text is very easy to follow!”
—Nick Landman
“This book by Welling & Thomson is the only one which I
have found to be indispensable. The writing is clear and
straightforward but never wastes my time. The book is
extremely well laid out. The chapters are the right length and
chapter titles quickly take you where you want to go.”
—Wright Sullivan, President, A&E Engineering, Inc., Greer
South Carolina
“I just wanted to tell you that I think the book PHP and
MySQL Web Development rocks! It’s logically structured, just
the right difficulty level for me (intermediate), interesting and
easy to read, and, of course, full of valuable information!”
—CodE-E, Austria
“There are several good introductory books on PHP, but
Welling & Thomson is an excellent handbook for those who
wish to build up complex and reliable systems. It’s obvious
that the authors have a strong background in the
development of professional applications and they teach not
only the language itself, but also how to use it with good
software engineering practices.”
—Javier Garcia, senior telecom engineer, Telefonica R&D
Labs, Madrid
“I picked up this book two days ago and I am half way
finished. I just can’t put it down. The layout and flow is
perfect. Everything is presented in such a way so that the
information is very palatable. I am able to immediately grasp
all the concepts. The examples have also been wonderful. I
just had to take some time out to express to you how
pleased I have been with this book.”
—Jason B. Lancaster
“This book has proven a trusty companion, with an excellent
crash course in PHP and superb coverage of MySQL as used
for Web applications. It also features several complete
applications that are great examples of how to construct
modular, scalable applications with PHP. Whether you are a
PHP newbie or a veteran in search of a better desk-side
reference, this one is sure to please!”
—WebDynamic
“The true PHP/MySQL bible, PHP and MySQL Web
Development by Luke Welling and Laura Thomson, made me
realize that programming and databases are now available to
the commoners. Again, I know 1/10000th of what there is to
know, and already I’m enthralled.”
—Tim Luoma, TnTLuoma.com
“Welling and Thomson’s book is a good reference for those
who want to get to grips with practical projects straight off
the bat. It includes webmail, shopping cart, session control,
and web-forum/weblog applications as a matter of course,
and begins with a sturdy look at PHP first, moving to MySQL
once the basics are covered.”
—twilight30 on Slashdot
“This book is absolutely excellent, to say the least.... Luke
Welling and Laura Thomson give the best in-depth
explanations I’ve come across on such things as regular
expressions, classes and objects, sessions etc. I really feel
this book filled in a lot of gaps for me with things I didn’t
quite understand.... This book jumps right into the functions
and features most commonly used with PHP, and from there
it continues in describing real-world projects, MySQL
integration, and security issues from a project manager’s
point of view. I found every bit of this book to be well
organized and easy to understand.”
—notepad on codewalkers.com
“A top-notch reference for programmers using PHP and
MySQL. Highly recommended.”
—The Internet Writing Journal
“This book rocks! I am an experienced programmer, so I
didn’t need a lot of help with PHP syntax; after all, it’s very
close to C/C++. I don’t know a thing about databases,
though, so when I wanted to develop a book review engine
(among other projects) I wanted a solid reference to using
MySQL with PHP. I have O’Reilly’s mSQL and MySQL book,
and it’s probably a better pure-SQL reference, but this book
has earned a place on my reference shelf...Highly
recommended.”
—Paul Robichaux
“One of the best programming guides I’ve ever read.”
—jackofsometrades from Lahti, Finland
“This is a well-written book for learning how to build Internet
applications with two of the most popular open-source Web
development technologies.... The projects are the real jewel
of the book. Not only are the projects described and
constructed in a logical, component-based manner, but the
selection of projects represents an excellent cross-section of
common components that are built into many web sites.”
—Craig Cecil
“The book takes an easy, step-by-step approach to introduce
even the clueless programmer to the language of PHP. On
top of that, I often find myself referring back to it in my Web
design efforts. I’m still learning new things about PHP, but
this book gave me a solid foundation from which to start and
continues to help me to this day.”
—Stephen Ward
“This book is one of few that really touched me and made
me ‘love’ it. I can’t put it in my bookshelf; I must put it in a
touchable place on my working bench as I always like to
refer from it. Its structure is good, wordings are simple and
straight forward, and examples are clear and step by step.
Before I read it, I knew nothing of PHP and MySQL. After
reading it, I have the confidence and skill to develop any
complicated Web application.”
—Power Wong
“This book is God.... I highly recommend this book to anyone
who wants to jump in the deep end with database driven
Web application programming. I wish more computer books
were organized this way.”
—Sean C Schertell
Developer’s Library
ESSENTIAL REFERENCES FOR PROGRAMMING
PROFESSIONALS

Developer’s Library books are designed to provide practicing


programmers with unique, high-quality references and tutorials on
the programming languages and technologies they use in their daily
work.
All books in the Developer’s Library are written by expert technology
practitioners who are especially skilled at organizing and presenting
information in a way that’s useful for other programmers.

Key titles include some of the best, most widely acclaimed books
within their topic areas:

PHP & MySQL


Web Development
Luke Welling & Laura Thomson
MySQL
Paul DuBois
Programming in C
Stephen Kochan
Python Essential Reference
David Beazley
Node.js, MongoDB and Angular Web Development
Brad Dayley
C++ Primer Plus
Stephen Prata

Developer’s Library books are available in print and in electronic


formats at most retail and online bookstores, as well as by
subscription from Safari Books Online at safari.informit.com

Developer’s Library
informit.com/devlibrary
Contents at a Glance
Introduction
I: Using PHP
1 PHP Crash Course
2 Storing and Retrieving Data
3 Using Arrays
4 String Manipulation and Regular Expressions
5 Reusing Code and Writing Functions
6 Object-Oriented PHP
7 Error and Exception Handling
II: Using MySQL
8 Designing Your Web Database
9 Creating Your Web Database
10 Working with Your MySQL Database
11 Accessing Your MySQL Database from the Web with PHP
12 Advanced MySQL Administration
13 Advanced MySQL Programming
III: Web Application Security
14 Web Application Security Risks
15 Building a Secure Web Application
16 Implementing Authentication Methods with PHP
IV: Advanced PHP Techniques
17 Interacting with the File System and the Server
18 Using Network and Protocol Functions
19 Managing the Date and Time
20 Internationalization and Localization
21 Generating Images
22 Using Session Control in PHP
23 Integrating JavaScript and PHP
24 Other Useful Features
V: Building Practical PHP and MySQL Projects
25 Using PHP and MySQL for Large Projects
26 Debugging and Logging
27 Building User Authentication and Personalization
28 Building a Web-Based Email Service with Laravel Part I Web
Edition
29 Building a Web-Based Email Service with Laravel Part II Web
Edition
30 Social Media Integration Sharing and Authentication Web Edition
31 Building a Shopping Cart Web Edition
VI: Appendix
A Installing Apache, PHP, and MySQL
Index
Table of Contents
Introduction
I: Using PHP
1 PHP Crash Course
Before You Begin: Accessing PHP
Creating a Sample Application: Bob’s Auto Parts
Creating the Order Form
Processing the Form
Embedding PHP in HTML
PHP Tags
PHP Statements
Whitespace
Comments
Adding Dynamic Content
Calling Functions
Using the date() Function
Accessing Form Variables
Form Variables
String Concatenation
Variables and Literals
Understanding Identifiers
Examining Variable Types
PHP’s Data Types
Type Strength
Type Casting
Variable Variables
Declaring and Using Constants
Understanding Variable Scope
Using Operators
Arithmetic Operators
String Operators
Assignment Operators
Comparison Operators
Logical Operators
Bitwise Operators
Other Operators
Working Out the Form Totals
Understanding Precedence and Associativity
Using Variable Handling Functions
Testing and Setting Variable Types
Testing Variable Status
Reinterpreting Variables
Making Decisions with Conditionals
if Statements
Code Blocks
else Statements
elseif Statements
switch Statements
Comparing the Different Conditionals
Repeating Actions Through Iteration
while Loops
for and foreach Loops
do...while Loops
Breaking Out of a Control Structure or Script
Employing Alternative Control Structure Syntax
Using declare
Next
2 Storing and Retrieving Data
Saving Data for Later
Storing and Retrieving Bob’s Orders
Processing Files
Opening a File
Choosing File Modes
Using fopen() to Open a File
Opening Files Through FTP or HTTP
Addressing Problems Opening Files
Writing to a File
Parameters for fwrite()
File Formats
Closing a File
Reading from a File
Opening a File for Reading: fopen()
Knowing When to Stop: feof()
Reading a Line at a Time: fgets(), fgetss(), and
fgetcsv()
Reading the Whole File: readfile(), fpassthru(),
file(), and file_get_contents()
Reading a Character: fgetc()
Reading an Arbitrary Length: fread()
Using Other File Functions
Checking Whether a File Is There: file_exists()
Determining How Big a File Is: filesize()
Deleting a File: unlink()
Navigating Inside a File: rewind(), fseek(), and ftell()
Locking Files
A Better Way: Databases
Problems with Using Flat Files
How RDBMSs Solve These Problems
Further Reading
Next
3 Using Arrays
What Is an Array?
Numerically Indexed Arrays
Initializing Numerically Indexed Arrays
Accessing Array Contents
Using Loops to Access the Array
Arrays with Different Indices
Initializing an Array
Accessing the Array Elements
Using Loops
Array Operators
Multidimensional Arrays
Sorting Arrays
Using sort()
Using asort() and ksort() to Sort Arrays
Sorting in Reverse
Sorting Multidimensional Arrays
Using the array_multisort() function
User-Defined Sorts
Reverse User Sorts
Reordering Arrays
Using shuffle()
Reversing an Array
Loading Arrays from Files
Performing Other Array Manipulations
Navigating Within an Array: each(), current(), reset(),
end(), next(), pos(), and prev()
Applying Any Function to Each Element in an Array:
array_walk()
Counting Elements in an Array: count(), sizeof(), and
array_count_values()
Converting Arrays to Scalar Variables: extract()
Further Reading
Next
4 String Manipulation and Regular Expressions
Creating a Sample Application: Smart Form Mail
Formatting Strings
Trimming Strings: chop(), ltrim(), and trim()
Formatting Strings for Output
Joining and Splitting Strings with String Functions
Using explode(), implode(), and join()
Using strtok()
Using substr()
Comparing Strings
Performing String Ordering: strcmp(), strcasecmp(), and
strnatcmp()
Testing String Length with strlen()
Matching and Replacing Substrings with String Functions
Finding Strings in Strings: strstr(), strchr(),
strrchr(), and stristr()
Finding the Position of a Substring: strpos() and
strrpos()
Replacing Substrings: str_replace() and
substr_replace()
Introducing Regular Expressions
The Basics
Delimiters
Character Classes and Types
Repetition
Subexpressions
Counted Subexpressions
Anchoring to the Beginning or End of a String
Branching
Matching Literal Special Characters
Reviewing Meta Characters
Escape Sequences
Backreferences
Assertions
Putting It All Together for the Smart Form
Finding Substrings with Regular Expressions
Replacing Substrings with Regular Expressions
Splitting Strings with Regular Expressions
Further Reading
Next
5 Reusing Code and Writing Functions
The Advantages of Reusing Code
Cost
Reliability
Consistency
Using require() and include()
Using require() to Include Code
Using require() for Website Templates
Using auto_prepend_file and auto_append_file
Using Functions in PHP
Calling Functions
Calling an Undefined Function
Understanding Case and Function Names
Defining Your Own Functions
Examining Basic Function Structure
Naming Your Function
Using Parameters
Understanding Scope
Passing by Reference Versus Passing by Value
Using the return Keyword
Returning Values from Functions
Implementing Recursion
Implementing Anonymous Functions (or Closures)
Further Reading
Next
6 Object-Oriented PHP
Understanding Object-Oriented Concepts
Classes and Objects
Polymorphism
Inheritance
Creating Classes, Attributes, and Operations in PHP
Structure of a Class
Constructors
Destructors
Instantiating Classes
Using Class Attributes
Calling Class Operations
Controlling Access with private and public
Writing Accessor Functions
Implementing Inheritance in PHP
Controlling Visibility Through Inheritance with private and
protected
Overriding
Preventing Inheritance and Overriding with final
Understanding Multiple Inheritance
Implementing Interfaces
Using Traits
Designing Classes
Writing the Code for Your Class
Understanding Advanced Object-Oriented Functionality in PHP
Using Per-Class Constants
Implementing Static Methods
Checking Class Type and Type Hinting
Late Static Bindings
Cloning Objects
Using Abstract Classes
Overloading Methods with __call()
Using __autoload()
Implementing Iterators and Iteration
Generators
Converting Your Classes to Strings
Using the Reflection API
Namespaces
Using Subnamespaces
Understanding the Global Namespace
Importing and Aliasing Namespaces
Next
7 Error and Exception Handling
Exception Handling Concepts
The Exception Class
User-Defined Exceptions
Exceptions in Bob’s Auto Parts
Exceptions and PHP’s Other Error Handling Mechanisms
Further Reading
Next
II: Using MySQL
8 Designing Your Web Database
Relational Database Concepts
Tables
Columns
Rows
Values
Keys
Schemas
Relationships
Designing Your Web Database
Think About the Real-World Objects You Are Modeling
Avoid Storing Redundant Data
Use Atomic Column Values
Choose Sensible Keys
Think About What You Want to Ask the Database
Avoid Designs with Many Empty Attributes
Summary of Table Types
Web Database Architecture
Further Reading
Next
9 Creating Your Web Database
Using the MySQL Monitor
Logging In to MySQL
Creating Databases and Users
Setting Up Users and Privileges
Introducing MySQL’s Privilege System
Principle of Least Privilege
User Setup: The CREATE USER and GRANT Commands
Types and Levels of Privileges
The REVOKE Command
Examples Using GRANT and REVOKE
Setting Up a User for the Web
Using the Right Database
Creating Database Tables
Understanding What the Other Keywords Mean
Understanding the Column Types
Looking at the Database with SHOW and DESCRIBE
Creating Indexes
Understanding MySQL Identifiers
Choosing Column Data Types
Numeric Types
Date and Time Types
String Types
Further Reading
Next
10 Working with Your MySQL Database
What Is SQL?
Inserting Data into the Database
Retrieving Data from the Database
Retrieving Data with Specific Criteria
Retrieving Data from Multiple Tables
Retrieving Data in a Particular Order
Grouping and Aggregating Data
Choosing Which Rows to Return
Using Subqueries
Updating Records in the Database
Altering Tables After Creation
Deleting Records from the Database
Dropping Tables
Dropping a Whole Database
Further Reading
Next
11 Accessing Your MySQL Database from the Web with PHP
How Web Database Architectures Work
Querying a Database from the Web
Checking and Filtering Input Data
Setting Up a Connection
Choosing a Database to Use
Querying the Database
Using Prepared Statements
Retrieving the Query Results
Disconnecting from the Database
Putting New Information in the Database
Using Other PHP-Database Interfaces
Using a Generic Database Interface: PDO
Further Reading
Next
12 Advanced MySQL Administration
Understanding the Privilege System in Detail
The user Table
The db Table
The tables_priv, columns_priv, and procs priv
Tables
Access Control: How MySQL Uses the Grant Tables
Updating Privileges: When Do Changes Take Effect?
Making Your MySQL Database Secure
MySQL from the Operating System’s Point of View
Passwords
User Privileges
Web Issues
Getting More Information About Databases
Getting Information with SHOW
Getting Information About Columns with DESCRIBE
Understanding How Queries Work with EXPLAIN
Optimizing Your Database
Design Optimization
Permissions
Table Optimization
Using Indexes
Using Default Values
Other Tips
Backing Up Your MySQL Database
Restoring Your MySQL Database
Implementing Replication
Setting Up the Master
Performing the Initial Data Transfer
Setting Up the Slave or Slaves
Further Reading
Next
13 Advanced MySQL Programming
The LOAD DATA INFILE Statement
Storage Engines
Transactions
Understanding Transaction Definitions
Using Transactions with InnoDB
Foreign Keys
Stored Procedures
Basic Example
Local Variables
Cursors and Control Structures
Triggers
Further Reading
Next
III: Web Application Security
14 Web Application Security Risks
Identifying the Threats We Face
Access to Sensitive Data
Modification of Data
Loss or Destruction of Data
Denial of Service
Malicious Code Injection
Compromised Server
Repudiation
Understanding Who We’re Dealing With
Attackers and Crackers
Unwitting Users of Infected Machines
Disgruntled Employees
Hardware Thieves
Ourselves
Next
15 Building a Secure Web Application
Strategies for Dealing with Security
Start with the Right Mindset
Balancing Security and Usability
Monitoring Security
Our Basic Approach
Securing Your Code
Filtering User Input
Escaping Output
Code Organization
What Goes in Your Code
File System Considerations
Code Stability and Bugs
Executing Commands
Securing Your Web Server and PHP
Keep Software Up-to-Date
Browse the php.ini file
Web Server Configuration
Shared Hosting of Web Applications
Database Server Security
Users and the Permissions System
Sending Data to the Server
Connecting to the Server
Running the Server
Protecting the Network
Firewalls
Use a DMZ
Prepare for DoS and DDoS Attacks
Computer and Operating System Security
Keep the Operating System Up to Date
Run Only What Is Necessary
Physically Secure the Server
Disaster Planning
Next
16 Implementing Authentication Methods with PHP
Identifying Visitors
Implementing Access Control
Storing Passwords
Securing Passwords
Another Random Document on
Scribd Without Any Related Topics
The Project Gutenberg eBook of The Scientific
Basis of Morals, and Other Essays
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

Title: The Scientific Basis of Morals, and Other Essays

Author: William Kingdon Clifford

Release date: October 12, 2015 [eBook #50189]


Most recently updated: October 22, 2024

Language: English

Credits: Produced by Jeroen Hellingman and the Online


Distributed
Proofreading Team at http://www.pgdp.net/ for Project
Gutenberg (This file was produced from images
generously
made available by The Internet Archive/American
Libraries.)

*** START OF THE PROJECT GUTENBERG EBOOK THE SCIENTIFIC


BASIS OF MORALS, AND OTHER ESSAYS ***
Price, 15 Cents.
HUMBOLDT [No.
LIBRARY. 55.
☞ Supplied to the Trade, Returnable, by the News Companies.

THE SCIENTIFIC BASIS


OF

MORALS,

AND OTHER ESSAYS.


BY

William Kingdon Clifford, F.R.S.

CATALOGUE OF THE LIBRARY.

(Continued from last page of cover.)

Nos. 50, Money and the Mechanism of Exchange. By W. Stanley


51. Jevons, F.R.S.
52. The Diseases of the Will. By Th. Ribot. Translated from the
French by J. Fitzgerald, A.M.
53. Animal Automatism, and Other Essays. By Prof. T. H.
Huxley, F.R.S.
54. The Birth and Growth of Myth. By Edward Clodd, F.R.A.S.

Covers for the Library, to hold firmly any number of copies from one to
twelve, Price, 60 cents; to Subscribers, 35 cents.

J. FITZGERALD, PUBLISHER,
20 LAFAYETTE PLACE,
NEW YORK.

HUMBOLDT LIBRARY

OF

Popular Science Literature.

No. 55.] NEW YORK: J. FITZGERALD. [Fifteen


Cents.

April, 1884. Entered at the New York Post-Office as $1.50 per


Second-Class Matter. Year.
(12
Numbers.)
THE SCIENTIFIC BASIS
OF

MORALS,

AND OTHER ESSAYS;

Viz.: Right and Wrong; The Ethics of Belief; The Ethics of Religion.

By WILLIAM KINGDON CLIFFORD, F.R.S.


I. ON THE SCIENTIFIC BASIS OF MORALS.

By Morals or Ethic I mean the doctrine of a special kind of pleasure or


displeasure which is felt by the human mind in contemplating certain
courses of conduct, whereby they are felt to be right or wrong, and of a
special desire to do the right things and avoid the wrong ones. The pleasure
or displeasure is commonly called the moral sense; the corresponding desire
might be called the moral appetite. These are facts, existing in the
consciousness of every man who need be considered in this discussion, and
sufficiently marked out by these names; they need no further definition. In
the same way the sense of taste is a feeling of pleasure or displeasure in
things savory or unsavory, and is associated with a desire for the one and a
repulsion from the other. We must assume that everybody knows what these
words mean; the feelings they describe may be analyzed or accounted for,
but they cannot be more exactly defined as feelings.

The maxims of ethic are recommendations or commands of the form, ‘Do


this particular thing because it is right,’ or ‘Avoid this particular thing
because it is wrong.’ They express the immediate desire to do the right thing
for itself, not for the sake of anything else: on this account the mood of
them is called the categorical imperative. The particular things commanded
or forbidden by such maxims depend upon the character of the individual in
whose mind they arise. There is a certain general agreement in the ethical
code of persons belonging to the same race at a given time, but considerable
variations in different races and times. To the question ‘What is right?’ can
therefore only be answered in the first instance, ‘That which pleases your
moral sense.’ But it may be further asked ‘What is generally thought right?’
and the reply will specify the ethic of a particular race and period. But the
ethical code of an individual, like the standard of taste, may be modified by
habit and education; and accordingly the question may be asked, ‘How shall
I order my moral desires so as to be able to satisfy them most completely
and continuously? What ought I to feel to be right?’ The answer to this
question must be sought in the study of the conditions under which the
moral sense was produced and is preserved; in other words, in the study of
its functions as a property of the human organism. The maxims derived
from this study may be called maxims of abstract or absolute right; they are
not absolutely universal, ‘eternal and immutable,’ but they are independent
of the individual, and practically universal for the present condition of the
human species.

I mean by Science the application of experience to new circumstances, by


the aid of an order of nature which has been observed in the past, and on the
assumption that such order will continue in the future. The simplest use of
experience as a guide to action is probably not even conscious; it is the
association by continually-repeated selection of certain actions with certain
circumstances, as in the unconsciously-acquired craft of the maker of flint
implements. I still call this science, although it is only a beginning; because
the physiological process is a type of what takes place in all later stages.
The next step may be expressed in the form of a hypothetical maxim,—‘If
you want to make brass, melt your copper along with this blue stone.’ To a
maxim of this sort it may always be replied, ‘I do not want to make brass,
and so I shall not do as you tell me.’ This reply is anticipated in the final
form of science, when it is expressed as a statement or proposition: brass is
an alloy of copper and zinc, and calamine is zinc carbonate. Belief in a
general statement is an artifice of our mental constitution, whereby
infinitely various sensations and groups of sensations are brought into
connection with infinitely various actions and groups of actions. On the
phenomenal side there corresponds a certain cerebral structure by which
various combinations of disturbances in the sensor tract are made to lead to
the appropriate combinations of disturbances in the motor tract. The
important point is that science, though apparently transformed into pure
knowledge, has yet never lost its character of being a craft; and that it is not
the knowledge itself which can rightly be called science, but a special way
of getting and of using knowledge. Namely, science is the getting of
knowledge from experience on the assumption of uniformity in nature, and
the use of such knowledge to guide the actions of men. And the most
abstract statements or propositions in science are to be regarded as bundles
of hypothetical maxims packed into a portable shape and size. Every
scientific fact is a shorthand expression for a vast number of practical
directions: if you want so-and-so, do so-and-so.

If with this meaning of the word ‘Science,’ there is such a thing as a


scientific basis of Morals, it must be true that,—

1. The maxims of Ethic are hypothetical maxims.


2. Derived from experience.
3. On the assumption of uniformity in nature.

These propositions I shall now endeavor to prove; and in conclusion, I shall


indicate the direction in which we may look for those general statements of
fact whose organization will complete the likeness of ethical and physical
science.

The Tribal Self.—In the metaphysical sense, the word ‘self’ is taken to
mean the conscious subject, das Ich, the whole stream of feelings which
make up a consciousness regarded as bound together by association and
memory. But, in the more common and more restricted ethical sense, what
we call self is a selected aggregate of feelings and of objects related to
them, which hangs together as a conception by virtue of long and repeated
association. My self does not include all my feelings, because habitually
separate off some of them, say they do not properly belong to me, and treat
them as my enemies. On the other hand, it does in general include my body
regarded as an object, because of the feelings which occur simultaneously
with events which affect it. My foot is certainly part of myself, because I
get hurt when anybody treads on it. When we desire anything for its
somewhat remote consequences, it is not common for these to be
represented to the mind in the form of the actual feelings of pleasure which
are ultimately to flow from the satisfaction of the desire; instead of this,
they are replaced by a symbolic conception which represents the thing
desired as doing good to the complex abstraction self. This abstraction
serves thus to support and hold together those complex and remote motives
which make up by far the greater part of the life of the intelligent races.
When a thing is desired for no immediate pleasure that it can bring, it is
generally desired on account of a certain symbolic substitute for pleasure,
the feeling that this thing is suitable to the self. And, as in many like cases,
this feeling, which at first derived its pleasurable nature from the faintly
represented simple pleasures of which it was a symbol, ceases after a time
to recall them and becomes a simple pleasure itself. In this way the self
becomes a sort of center about which our remoter motives revolve, and to
which they always have regard; in virtue of which, moreover, they become
immediate and simple, from having been complex and remote.

If we consider now the simpler races of mankind, we shall find not only that
immediate desires play a far larger part in their lives, and so that the
conception of self is less used and less developed, but also that it is less
definite and more wide. The savage is not only hurt when anybody treads
on his foot, but when anybody treads on his tribe. He may lose his hut, and
his wife, and his opportunities of getting food. In this way the tribe becomes
naturally included in that conception of self which renders remote desires
possible by making them immediate. The actual pains or pleasures which
come from the woe or weal of the tribe, and which were the source of this
conception, drop out of consciousness and are remembered no more; the
symbol which has replaced them becomes a center and goal of immediate
desires, powerful enough in many cases to override the strongest
suggestions of individual pleasure or pain.

Here a helping cause comes in. The tribe, quâ tribe, has to exist, and it can
only exist by aid of such an organic artifice as the conception of the tribal
self in the minds of its members. Hence the natural selection of those races
in which this conception is the most powerful and most habitually
predominant as a motive over immediate desires. To such an extent has this
proceeded that we may fairly doubt whether the selfhood of the tribe is not
earlier in point of development than that of the individual. In the process of
time it becomes a matter of hereditary transmission, and is thus fixed as a
specific character in the constitution of social man. With the settlement of
countries, and the aggregation of tribes into nations, it takes a wider and
more abstract form; and in the highest natures the tribal self is incarnate in
nothing less than humanity. Short of these heights, it places itself in the
family and in the city. I shall call that quality or disposition of man which
consists in the supremacy of the family or tribal self as a mark of reference
for motives by its old name Piety. And I have now to consider certain
feelings and conceptions to which the existence of piety must necessarily
give rise.

Before going further, however, it will be advisable to fix as precisely as


may be the sense of the words just used. Self, then, in the ethical sense, is a
conception in the mind of the individual which serves as a peg on which
remote desires are hung and by which they are rendered immediate. The
individual self is such a peg for the hanging of remote desires which affect
the individual only. The tribal self is a conception in the mind of the
individual which serves as a peg on which those remote desires are hung
which were implanted in him by the need of the tribe as a tribe. We must
carefully distinguish the tribal self from society, or the ‘common
consciousness;’ it is something in the mind of each individual man which
binds together his gregarious instincts.

The word tribe is here used to mean a group of that size which in the
circumstances considered is selected for survival or destruction as a group.
Self-regarding excellences are brought out by the natural selection of
individuals; the tribal self is developed by the natural selection of groups.
The size of the groups must vary at different times; and the extent of the
tribal self must vary accordingly.

Approbation and Conscience.—The tribe has to exist. Such tribes as saw no


necessity for it have ceased to live. To exist, it must encourage piety; and
there is a method which lies ready to hand.

We do not like a man whose character is such that we may reasonably


expect injuries from him. This dislike of a man on account of his character
is a more complex feeling than the mere dislike of separate injuries. A cat
likes your hand and your lap, and the food you give her; but I do not think
she has any conception of you. A dog, however, may like you even when
you thrash him, though he does not like the thrashing. Now such likes and
dislikes may be felt by the tribal self. If a man does anything generally
regarded as good for the tribe, my tribal self may say, in the first place, ‘I
like that thing that you have done.’ By such common approbation of
individual acts the influence of piety as a motive becomes defined; and
natural selection will in the long run preserve those tribes which have
approved the right things; namely, those things which at that time gave the
tribe an advantage in the struggle for existence. But in the second place, a
man may as a rule and constantly, being actuated by piety, do good things
for the tribe; and in that case the tribal self will say, I like you. The feeling
expressed by this statement on the part of any individual, ‘In the name of
the tribe, I like you,’ is what I call approbation. It is the feeling produced in
pious individuals by that sort of character which seems to them beneficial to
the community.

Now suppose that a man has done something obviously harmful to the
community. Either some immediate desire, or his individual self, has for
once proved stronger than the tribal self. When the tribal self wakes up, the
man says, ‘In the name of the tribe, I do not like this thing that I, as an
individual, have done.’ This Self-judgment in the name of the tribe is called
Conscience. If the man goes further and draws from this act and others an
inference about his own character, he may say, ‘In the name of the tribe, I
do not like my individual self.’ This is remorse. Mr. Darwin has well
pointed out that immediate desires are in general strong but of short
duration, and cannot be adequately represented to the mind after they have
passed; while the social forces, though less violent, have a steady and
continuous action.

In a mind sufficiently developed to distinguish the individual from the tribal


self, conscience is thus a necessary result of the existence of piety; it is
ready to hand as a means for its increase. But to account for the existence of
piety and conscience in the elemental form which we have hitherto
considered is by no means to account for the present moral nature of man.
We shall be led many steps in that direction if we consider the way in which
society has used these feelings of the individual as a means for its own
preservation.

Right and Responsibility.—A like or a dislike is one thing; the expression of


it is another. It is attached to the feeling by links of association; and when
this association has been selectively modified by experience, whether
consciously or unconsciously, the expression serves a purpose of retaining
or repeating the thing liked, and of removing the thing disliked. Such a
purpose is served by the expression of tribal approbation or disapprobation,
however little it may be the conscious end of such expression to any
individual. It is necessary to the tribe that the pious character should be
encouraged and preserved, the impious character discouraged and removed.
The process is of two kinds; direct and reflex. In the direct process the tribal
dislike of the offender is precisely similar to the dislike of a noxious beast;
and it expresses itself in his speedy removal. But in the reflex process we
find the first trace of that singular and wonderful judgment by analogy
which ascribes to other men a consciousness similar to our own. If the
process were a conscious one, it might perhaps be described in this way: the
tribal self says, ‘Put yourself in this man’s place; he also is pious, but he has
offended, and that proves that he is not pious enough. Still, he has some
conscience, and the expression of your tribal dislike to his character,
awakening his conscience, will tend to change him and make him more
pious.’ But the process is not a conscious one: the social craft or art of
living together is learned by the tribe and not by the individual, and the
purpose of improving men’s characters is provided for by complex social
arrangements long before it has been conceived by any conscious mind. The
tribal self learns to approve certain expressions of tribal liking or disliking;
the actions whose open approval is liked by the tribal self are called right
actions, and those whose open disapproval is liked are called wrong actions.
The corresponding characters are called good or bad, virtuous or vicious.

This introduces a further complication into the conscience. Self-judgment in


the name of the tribe becomes associated with very definite and material
judgment by the tribe itself. On the one hand, this undoubtedly strengthens
the motive-power of conscience in an enormous degree. On the other hand,
it tends to guide the decisions of conscience; and since the expression of
public approval or disapproval is made in general by means of some
organized machinery of government, it becomes possible for conscience to
be knowingly directed by the wise or misdirected by the wicked, instead of
being driven along the right path by the slow selective process of
experience. Now right actions are not those which are publicly approved,
but those whose public approbation a well-instructed tribal self would like.
Still, it is impossible to avoid the guiding influence of expressed
approbation on the great mass of the people; and in those cases where the
machinery of government is approximately a means of expressing the true
public conscience, that influence becomes a most powerful help to
improvement.

Let us note now the very important difference between the direct and the
reflex process. To clear a man away as a noxious beast, and to punish him
for doing wrong, these are two very different things. The purpose in the first
case is merely to get rid of a nuisance; the purpose in the second case is to
improve the character either of the man himself or of those who will
observe this public expression of disapprobation. The offense of which the
man has been guilty leads to an inference about his character, and it is
supposed that the community may contain other persons whose characters
are similar to his, or tend to become so. It has been found that the
expression of public disapprobation tends to awake the conscience of such
people and to improve their characters. If the improvement of the man
himself is aimed at, it is assumed that he has a conscience which can be
worked upon and made to deter him from similar offenses in future.

The word purpose has here been used in a sense to which it is perhaps
worth while to call attention. Adaptation of means to an end may be
produced in two ways that we at present know of; by processes of natural
selection, and by the agency of an intelligence in which an image or idea of
the end preceded the use of the means. In both cases the existence of the
adaptation is accounted for by the necessity or utility of the end. It seems to
me convenient to use the word purpose as meaning generally the end to
which certain means are adapted, both in these two cases, and in any other
that may hereafter become known, provided only that the adaptation is
accounted for by the necessity or utility of the end. And there seems no
objection to the use of the phrase ‘final cause’ in this wider sense, if it is to
be kept at all. The word ‘design’ might then be kept for the special case of
adaptation by an intelligence. And we may then say that since the process of
natural selection has been understood, purpose has ceased to suggest design
to instructed people, except in cases where the agency of man is
independently probable.
When a man can be punished for doing wrong with approval of the tribal
self, he is said to be responsible. Responsibility implies two things:—(1)
The act was a product of the man’s character and of the circumstances, and
his character may to a certain extent be inferred from the act; (2) The man
had a conscience which might have been so worked upon as to prevent his
doing the act. Unless the first condition be fulfilled, we cannot reasonably
take any action at all in regard to the man, but only in regard to the offense.
In the case of crimes of violence, for example, we might carry a six-shooter
to protect ourselves against similar possibilities, but unless the fact of a
man’s having once committed a murder made it probable that he would do
the like again, it would clearly be absurd and unreasonable to lynch the
man. That is to say, we assume an uniformity of connection between
character and actions, infer a man’s character from his past actions, and
endeavor to provide against his future actions either by destroying him or
by changing his character. I think it will be found that in all those cases
where we not only deal with the offense but treat it with moral reprobation,
we imply the existence of a conscience which might have been worked
upon to improve the character. Why, for example, do we not regard a lunatic
as responsible? Because we are in possession of information about his
character derived not only from his one offense but from other facts,
whereby we know that even if he had a conscience left, his mind is so
diseased that it is impossible by moral reprobation alone to change his
character so that it may be subsequently relied upon. With his cure from
disease and the restored validity of this condition, responsibility returns.
There are, of course, cases in which an irresponsible person is punished as
if he were responsible, pour encourager les autres who are responsible. The
question of the right or wrong of this procedure is the question of its
average effect on the character of men at any particular time.

The Categorical Imperative.—May we now say that the maxims of Ethic


are hypothetical maxims? I think we may, and that in showing why we shall
explain the apparent difference between them and other maxims belonging
to an early stage of science. In the first place ethical maxims are learned by
the tribe and not by the individual. Those tribes have on the whole survived
in which conscience approved such actions as tended to the improvement of
men’s characters as citizens and therefore to the survival of the tribe. Hence
it is that the moral sense of the individual, though founded on the
experience of the tribe, is purely intuitive; conscience gives no reasons.
Notwithstanding this, the ethical maxims are presented to us as conditional;
if you want to live together in this complicated way, your ways must be
straight and not crooked, you must seek the truth and love no lie. Suppose
we answer, ‘I don’t want to live together with other men in this complicated
way; and so I shall not do as you tell me.’ That is not the end of the matter,
as it might be with other scientific precepts. For obvious reasons it is right
in this case to reply, ‘Then in the name of my people I do not like you,’ and
to express this dislike by appropriate methods. And the offender, being
descended from a social race, is unable to escape his conscience, the voice
of his tribal self which says, ‘In the name of the tribe, I hate myself for this
treason that I have done.’

There are two reasons, then, why ethical maxims appear to be


unconditional. First, they are acquired from experience not directly but by
tribal selection, and therefore in the mind of the individual they do not rest
upon the true reasons for them. Secondly, although they are conditional, the
absence of the condition in one born of a social race is rightly visited by
moral reprobation.

Ethics are based on Uniformity.—I have already observed that to deal with
men as a means of influencing their actions implies that these actions are a
product of character and circumstances; and that moral reprobation and
responsibility cannot exist unless we assume the efficacy of certain special
means of influencing character. It is not necessary to point out that such
considerations involve that uniformity of nature which underlies the
possibility of even unconscious adaptations to experience, of language, and
of general conceptions and statements. It may be asked, ‘Are you quite sure
that these observed uniformities between motive and action, between
character and motive, between social influence and change of character, are
absolutely exact in the form in which you state them, or indeed that they are
exact laws of any form? May there not be very slight divergences from
exact laws, which will allow of the action of an “uncaused will,” or of the
interference of some “extra-mundane force”?’ I am sure I do not know. But
this I do know: that our sense of right and wrong is derived from such order
as we can observe, and not from such caprice of disorder as we may
fancifully conjecture; and that to whatever extent a divergence from
exactness became sensible, to that extent it would destroy the most
widespread and worthy of the acquisitions of mankind.

The Final Standard.—By these views we are led to conclusions partly


negative, partly positive; of which, as might be expected, the negative are
the most definite.

First, then, Ethic is a matter of the tribe or community, and therefore there
are no ‘self-regarding virtues.’ The qualities of courage, prudence, etc., can
only be rightly encouraged in so far as they are shown to conduce to the
efficiency of a citizen; that is, in so far as they cease to be self-regarding.
The duty of private judgment, of searching after truth, the sacredness of
belief which ought not to be misused on unproved statements, follow only
on showing of the enormous importance to society of a true knowledge of
things. And any diversion of conscience from its sole allegiance to the
community is condemned à priori in the very nature of right and wrong.

Next, the end of Ethic is not the greatest happiness of the greatest number.
Your happiness is of no use to the community, except in so far as it tends to
make you a more efficient citizen—that is to say, happiness is not to be
desired for its own sake, but for the sake of something else. If any end is
pointed to, it is the end of increased efficiency in each man’s special work,
as well as in the social functions which are common to all. A man must
strive to be a better citizen, a better workman, a better son, husband, or
father.

Again, Piety is not Altruism. It is not the doing good to others as others, but
the service of the community by a member of it, who loses in that service
the consciousness that he is anything different from the community.

The social organism, like the individual, may be healthy or diseased. Health
and disease are very difficult things to define accurately: but for practical
purposes, there are certain states about which no mistake can be made.
When we have even a very imperfect catalogue and description of states
that are clearly and certainly diseases, we may form a rough preliminary
definition of health by saying that it means the absence of all these states.
Now the health of society involves among other things, that right is done by
the individuals composing it. And certain social diseases consist in a wrong
direction of the conscience. Hence the determination of abstract right
depends on the study of healthy and diseased states of society. How much
light can be got for this end from the historical records we possess? A very
great deal, if, as I believe, for ethical purposes the nature of man and of
society may be taken as approximately constant during the few thousand
years of which we have distinct records.

The matters of fact on which rational ethic must be founded are the laws of
modification of character, and the evidence of history as to those kinds of
character which have most aided the improvement of the race. For although
the moral sense is intuitive, it must for the future be directed by our
conscious discovery of the tribal purpose which it serves.
II. RIGHT AND WRONG:
THE SCIENTIFIC GROUND OF THEIR
DISTINCTION.1
The questions which are here to be considered are especially and peculiarly
everybody’s questions. It is not everybody’s business to be an engineer, or a
doctor, or a carpenter, or a soldier; but it is everybody’s business to be a
citizen. The doctrines and precepts which guide the practice of the good
engineer are of interest to him who uses them and to those whose business
it is to investigate them by mechanical science; the rest of us neither obey
nor disobey them. But the doctrines and precepts of morality, which guide
the practice of the good citizen, are of interest to all; they must be either
obeyed or disobeyed by every human being who is not hopelessly and
forever separated from the rest of mankind. No one can say, therefore, that
in this inquiry we are not minding our own business, that we are meddling
with other men’s affairs. We are in fact studying the principles of our
profession, so far as we are able; a necessary thing for every man who
wishes to do good work in it.

Along with the character of universal interest which belongs to our subject
there goes another. What is everybody’s practical business is also to a large
extent what everybody knows; and it may be reasonably expected that a
discourse about Right and Wrong will be full of platitudes and truisms. The
expectation is a just one. The considerations I have to offer are of the very
oldest and the very simplest commonplace and common sense; and no one
can be more astonished than I am that there should be any reason to speak
of them at all. But there is reason to speak of them, because platitudes are
not all of one kind. Some platitudes have a definite meaning and a practical
application, and are established by the uniform and long-continued
experience of all people. Other platitudes, having no definite meaning and
no practical application, seem not to be worth anybody’s while to test; and
these are quite sufficiently established by mere assertion, if it is audacious
enough to begin with and persistent enough afterward. It is in order to
distinguish these two kinds of platitude from one another, and to make sure
that those which we retain form a body of doctrine consistent with itself and
with the rest of our beliefs, that we undertake this examination of obvious
and widespread principles.

First of all, then, what are the facts?

We say that it is wrong to murder, to steal, to tell lies, and that it is right to
take care of our families. When we say in this sense that one action is right
and another wrong, we have a certain feeling toward the action which is
peculiar and not quite like any other feeling. It is clearly a feeling toward
the action and not toward the man who does it; because we speak of hating
the sin and loving the sinner. We might reasonably dislike a man whom we
knew or suspected to be a murderer, because of the natural fear that he
might murder us; and we might like our own parents for taking care of us.
But everybody knows that these feelings are something quite different from
the feeling which condemns murder as a wrong thing, and approves
parental care as a right thing. I say nothing here about the possibility of
analyzing this feeling, or proving that it arises by combination of other
feelings; all I want to notice is that it is as distinct and recognizable as the
feeling of pleasure in a sweet taste or of displeasure at a toothache. In
speaking of right and wrong, we speak of qualities of action which arouse
definite feelings that everybody knows and recognizes. It is not necessary,
then, to give a definition at the outset; we are going to use familiar terms
which have a definite meaning in the same sense in which everybody uses
them. We may ultimately come to something like a definition; but what we
have to do first is to collect the facts and see what can be made of them, just
as if we were going to talk about limestone, or parents and children, or fuel.

It is easy to conceive that murder and theft and neglect of the young might
be considered wrong in a very simple state of society. But we find at present
that the condemnation of these actions does not stand alone; it goes with the
condemnation of a great number of other actions which seem to be included
with the obviously criminal action, in a sort of general rule. The wrongness
of murder, for example, belongs in a less degree to any form of bodily
injury that one man may inflict on another; and it is even extended so as to
include injuries to his reputation or his feelings. I make these more refined
precepts follow in the train of the more obvious and rough ones, because
this appears to have been the traditional order of their establishment. ‘He
that makes his neighbor blush in public,’ says the Mishna, ‘is as if he had
shed his blood.’ In the same way the rough condemnation of stealing carries
with it a condemnation of more refined forms of dishonesty: we do not
hesitate to say that it is wrong for a tradesman to adulterate his goods, or for
a laborer to scamp his work. We not only say that it is wrong to tell lies, but
that it is wrong to deceive in other more ingenious ways; wrong to use
words so that they shall have one sense to some people and another sense to
other people; wrong to suppress the truth when that suppression leads to
false belief in others. And again, the duty of parents toward their children is
seen to be a special case of a very large and varied class of duties toward
that great family to which we belong—to the fatherland and them that dwell
therein. The word duty which I have here used, has as definite a sense to the
general mind as the words right and wrong; we say that it is right to do our
duty, and wrong to neglect it. These duties to the community serve in our
minds to explain and define our duties to individuals. It is wrong to kill any
one; unless we are an executioner, when it may be our duty to kill a
criminal; or a soldier, when it may be our duty to kill the enemy of our
country; and in general it is wrong to injure any man in any way in our
private capacity and for our own sakes. Thus if a man injures us, it is only
right to retaliate on behalf of other men. Of two men in a desert island, if
one takes away the other’s cloak, it may or may not be right for the other to
let him have his coat also; but if a man takes away my cloak while we both
live in society, it is my duty to use such means as I can to prevent him from
taking away other people’s cloaks. Observe that I am endeavoring to
describe the facts of the moral feelings of Englishmen, such as they are
now.

The last remark leads us to another platitude of exceedingly ancient date.


We said that it was wrong to injure any man in our private capacity and for
our own sakes. A rule like this differs from all the others that we have
considered, because it not only deals with physical acts, words and deeds
which can be observed and known by others, but also with thoughts which
are known only to the man himself. Who can tell whether a given act of
punishment was done from a private or from a public motive? Only the
agent himself. And yet if the punishment was just and within the law, we
should condemn the man in the one case and approve him in the other. This
pursuit of the actions of men to their very sources, in the feelings which
they only can know, is as ancient as any morality we know of, and extends
to the whole range of it. Injury to another man arises from anger, malice,
hatred, revenge; these feelings are condemned as wrong. But feelings are
not immediately under our control, in the same way that overt actions are: I
can shake anybody by the hand if I like, but I cannot always feel friendly to
him. Nevertheless we can pay attention to such aspects of the
circumstances, and we can put ourselves into such conditions, that our
feelings get gradually modified in one way or the other; we form a habit of
checking our anger by calling up certain images and considerations,
whereby in time the offending passion is brought into subjection and
control. Accordingly we say that it is right to acquire and to exercise this
control; and the control is supposed to exist whenever we say that one
feeling or disposition of mind is right and another wrong. Thus, in
connection with the precept against stealing, we condemn envy and
covetousness; we applaud a sensitive honesty which shudders at anything
underhand or dishonorable. In connection with the rough precept against
lying, we have built up and are still building a great fabric of intellectual
morality, whereby a man is forbidden to tell lies to himself, and is
commanded to practice candor and fairness and open-mindedness in his
judgments, and to labor zealously in pursuit of the truth. In connection with
the duty to our families, we say that it is right to cultivate public spirit, a
quick sense of sympathy, and all that belongs to a social disposition.

Two other words are used in this connection which it seems necessary to
mention. When we regard an action as right or wrong for ourselves, this
feeling about the action impels us to do it or not to do it, as the case may be.
We may say that the moral sense acts in this case as a motive; meaning by
moral sense only the feeling in regard to an action which is considered as
right or wrong, and by motive something which impels us to act. Of course
there may be other motives at work at the same time, and it does not at all
follow that we shall do the right action or abstain from the wrong one. This
we all know to our cost. But still our feeling about the rightness or
wrongness of an action does operate as a motive when we think of the
action as being done by us; and when so operating it is called conscience. I
have nothing to do at present with the questions about conscience, whether
it is a result of education, whether it can be explained by self-love, and so
forth; I am only concerned in describing well-known facts, and in getting as
clear as I can about the meaning of well-known words. Conscience, then, is
the whole aggregate of our feelings about actions as being right or wrong,
regarded as tending to make us do the right actions and avoid the wrong
ones. We also say sometimes, in answer to the question, ‘How do you know
that this is right or wrong?’ ‘My conscience tells me so.’ And this way of
speaking is quite analogous to other expressions of the same form; thus if I
put my hand into water, and you ask me how I know that it is hot, I might
say, ‘My feeling of warmth tells me so.’

When we consider a right or a wrong action as done by another person, we


think of that person as worthy of moral approbation or reprobation. He may
be punished or not; but in any case this feeling toward him is quite different
from the feeling of dislike toward a person injurious to us, or of
disappointment at a machine which will not go.

Whenever we can morally approve or disapprove a man for his action, we


say that he is morally responsible for it, and vice versâ. To say that a man is
not morally responsible for his actions is the same thing as to say that it
would be unreasonable to praise or blame him for them.

The statement that we ourselves are morally responsible is somewhat more


complicated, but the meaning is very easily made out; namely, that another
person may reasonably regard our actions as right or wrong, and may praise
or blame us for them.

We can now, I suppose, understand one another pretty clearly in using the
words right and wrong, conscience, responsibility; and we have made a
rapid survey of the facts of the case in our own country at the present time.
Of course I do not pretend that this survey in any way approaches to
completeness; but it will supply us at least with enough facts to enable us to
deal always with concrete examples instead of remaining in generalities;
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like