100% found this document useful (4 votes)
157 views

Download ebooks file Network Programming with Go Learn to Code Secure and Reliable Network Services from Scratch 1st Edition Adam Woodbeck all chapters

from

Uploaded by

sourobrafsun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
157 views

Download ebooks file Network Programming with Go Learn to Code Secure and Reliable Network Services from Scratch 1st Edition Adam Woodbeck all chapters

from

Uploaded by

sourobrafsun
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/ 40

Get ebook downloads in full at ebookmeta.

com

Network Programming with Go Learn to Code Secure


and Reliable Network Services from Scratch 1st
Edition Adam Woodbeck

https://ebookmeta.com/product/network-programming-with-go-
learn-to-code-secure-and-reliable-network-services-from-
scratch-1st-edition-adam-woodbeck/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Network Programming with Go Learn to Code Secure and


Reliable Network Services from Scratch 1st Edition Adam
Woodbeck
https://ebookmeta.com/product/network-programming-with-go-learn-to-
code-secure-and-reliable-network-services-from-scratch-1st-edition-
adam-woodbeck-2/
ebookmeta.com

Network Programming with Go Language 2nd Edition Ronald


Petty

https://ebookmeta.com/product/network-programming-with-go-
language-2nd-edition-ronald-petty/

ebookmeta.com

Multi-Site Network and Security Services with NSX-T:


Implement Network Security, Stateful Services, and
Operations 1st Edition Iwan Hoogendoorn
https://ebookmeta.com/product/multi-site-network-and-security-
services-with-nsx-t-implement-network-security-stateful-services-and-
operations-1st-edition-iwan-hoogendoorn/
ebookmeta.com

Harbor Lights 3rd Edition Theodore Weesner

https://ebookmeta.com/product/harbor-lights-3rd-edition-theodore-
weesner/

ebookmeta.com
The Smart Mission 1st Edition Edward J Hoffman Matthew
Kohut Laurence Prusak

https://ebookmeta.com/product/the-smart-mission-1st-edition-edward-j-
hoffman-matthew-kohut-laurence-prusak/

ebookmeta.com

New Uses of Bourdieu in Film and Media Studies 1st Edition


Guy Austin

https://ebookmeta.com/product/new-uses-of-bourdieu-in-film-and-media-
studies-1st-edition-guy-austin/

ebookmeta.com

Shipboard electrical power systems 2nd Edition Mukund R.


Patel

https://ebookmeta.com/product/shipboard-electrical-power-systems-2nd-
edition-mukund-r-patel/

ebookmeta.com

Generative AI for Data Analytics (MEAP) Artur Guja

https://ebookmeta.com/product/generative-ai-for-data-analytics-meap-
artur-guja/

ebookmeta.com

Leonard Bernstein and His Young People s Concerts Alicia


Kopfstein-Penk

https://ebookmeta.com/product/leonard-bernstein-and-his-young-people-
s-concerts-alicia-kopfstein-penk/

ebookmeta.com
Saturday Night Meals: Delicious Meals for the Weekend 2nd
Edition Booksumo Press

https://ebookmeta.com/product/saturday-night-meals-delicious-meals-
for-the-weekend-2nd-edition-booksumo-press/

ebookmeta.com
NETWORK PROGRAMMING
WITH GO

Code Secure and Reliable Network


Services from Scratch

Adam Woodbeck

San Francisco
CONTENTS IN DETAIL

ACKNOWLEDGMENTS

INTRODUCTION
Who This Book Is For
Installing Go
Recommended Development Environments
What’s in This Book

PART I: NETWORK ARCHITECTURE


CHAPTER 1: AN OVERVIEW OF NETWORKED SYSTEMS
Choosing a Network Topology
Bandwidth vs. Latency
The Open Systems Interconnection Reference Model
The Hierarchal Layers of the OSI Reference Model
Sending Traffic by Using Data Encapsulation
The TCP/IP Model
The Application Layer
The Transport Layer
The Internet Layer
The Link Layer
What You’ve Learned
CHAPTER 2: RESOURCE LOCATION AND TRAFFIC
ROUTING
The Internet Protocol
IPv4 Addressing
Network and Host IDs
Subdividing IPv4 Addresses into Subnets
Ports and Socket Addresses
Network Address Translation
Unicasting, Multicasting, and Broadcasting
Resolving the MAC Address to a Physical Network
Connection
IPv6 Addressing
Writing IPv6 Addresses
IPv6 Address Categories
Advantages of IPv6 over IPv4
The Internet Control Message Protocol
Internet Traffic Routing
Routing Protocols
The Border Gateway Protocol
Name and Address Resolution
Domain Name Resource Records
Multicast DNS
Privacy and Security Considerations of DNS Queries
What You’ve Learned

PART II: SOCKET-LEVEL PROGRAMMING


CHAPTER 3: RELIABLE TCP DATA STREAMS
What Makes TCP Reliable?
Working with TCP Sessions
Establishing a Session with the TCP Handshake
Acknowledging Receipt of Packets by Using Their
Sequence Numbers
Receive Buffers and Window Sizes
Gracefully Terminating TCP Sessions
Handling Less Graceful Terminations
Establishing a TCP Connection by Using Go’s Standard
Library
Binding, Listening for, and Accepting Connections
Establishing a Connection with a Server
Implementing Deadlines
What You’ve Learned

CHAPTER 4: SENDING TCP DATA


Using the net.Conn Interface
Sending and Receiving Data
Reading Data into a Fixed Buffer
Delimited Reading by Using a Scanner
Dynamically Allocating the Buffer Size
Handling Errors While Reading and Writing Data
Creating Robust Network Applications by Using the io
Package
Proxying Data Between Connections
Monitoring a Network Connection
Pinging a Host in ICMP-Filtered Environments
Exploring Go’s TCPConn Object
Controlling Keepalive Messages
Handling Pending Data on Close
Overriding Default Receive and Send Buffers
Solving Common Go TCP Network Problems
Zero Window Errors
Sockets Stuck in the CLOSE_WAIT State
What You’ve Learned

CHAPTER 5: UNRELIABLE UDP COMMUNICATION


Using UDP: Simple and Unreliable
Sending and Receiving UDP Data
Using a UDP Echo Server
Receiving Data from the Echo Server
Every UDP Connection Is a Listener
Using net.Conn in UDP
Avoiding Fragmentation
What You’ve Learned

CHAPTER 6: ENSURING UDP RELIABILITY


Reliable File Transfers Using TFTP
TFTP Types
Read Requests
Data Packets
Acknowledgments
Handling Errors
The TFTP Server
Writing the Server Code
Handling Read Requests
Starting the Server
Downloading Files over UDP
What You’ve Learned
CHAPTER 7: UNIX DOMAIN SOCKETS
What Are Unix Domain Sockets?
Binding to Unix Domain Socket Files
Changing a Socket File’s Ownership and Permissions
Understanding Unix Domain Socket Types
Writing a Service That Authenticates Clients
Requesting Peer Credentials
Writing the Service
Testing the Service with Netcat
What You’ve Learned

PART III: APPLICATION-LEVEL


PROGRAMMING
CHAPTER 8: WRITING HTTP CLIENTS
Understanding the Basics of HTTP
Uniform Resource Locators
Client Resource Requests
Server Responses
From Request to Rendered Page
Retrieving Web Resources in Go
Using Go’s Default HTTP Client
Closing the Response Body
Implementing Time-outs and Cancellations
Disabling Persistent TCP Connections
Posting Data over HTTP
Posting JSON to a Web Server
Posting a Multipart Form with Attached Files
What You’ve Learned
CHAPTER 9: BUILDING HTTP SERVICES
The Anatomy of a Go HTTP Server
Clients Don’t Respect Your Time
Adding TLS Support
Handlers
Test Your Handlers with httptest
How You Write the Response Matters
Any Type Can Be a Handler
Injecting Dependencies into Handlers
Middleware
Timing Out Slow Clients
Protecting Sensitive Files
Multiplexers
HTTP/2 Server Pushes
Pushing Resources to the Client
Don’t Be Too Pushy
What You’ve Learned

CHAPTER 10: CADDY: A CONTEMPORARY WEB


SERVER
What Is Caddy?
Let’s Encrypt Integration
How Does Caddy Fit into the Equation?
Retrieving Caddy
Downloading Caddy
Building Caddy from Source Code
Running and Configuring Caddy
Modifying Caddy’s Configuration in Real Time
Storing the Configuration in a File
Extending Caddy with Modules and Adapters
Writing a Configuration Adapter
Writing a Restrict Prefix Middleware Module
Injecting Your Module into Caddy
Reverse-Proxying Requests to a Backend Web Service
Creating a Simple Backend Web Service
Setting Up Caddy’s Configuration
Adding a Reverse-Proxy to Your Service
Serving Static Files
Checking Your Work
Adding Automatic HTTPS
What You’ve Learned

CHAPTER 11: SECURING COMMUNICATIONS WITH


TLS
A Closer Look at Transport Layer Security
Forward Secrecy
In Certificate Authorities We Trust
How to Compromise TLS
Protecting Data in Transit
Client-side TLS
TLS over TCP
Server-side TLS
Certificate Pinning
Mutual TLS Authentication
Generating Certificates for Authentication
Implementing Mutual TLS
What You’ve Learned
PART IV : SERVICE ARCHITECTURE
CHAPTER 12: DATA SERIALIZATION
Serializing Objects
JSON
Gob
Protocol Buffers
Transmitting Serialized Objects
Connecting Services with gRPC
Creating a TLS-Enabled gRPC Server
Creating a gRPC Client to Test the Server
What You’ve Learned

CHAPTER 13: LOGGING AND METRICS


Event Logging
The log Package
Leveled Log Entries
Structured Logging
Scaling Up with Wide Event Logging
Log Rotation with Lumberjack
Instrumenting Your Code
Setup
Counters
Gauges
Histograms and Summaries
Instrumenting a Basic HTTP Server
What You’ve Learned

CHAPTER 14: MOVING TO THE CLOUD


Laying Some Groundwork
AWS Lambda
Installing the AWS Command Line Interface
Configuring the CLI
Creating a Role
Defining an AWS Lambda Function
Compiling, Packaging, and Deploying Your Function
Testing Your AWS Lambda Function
Google Cloud Functions
Installing the Google Cloud Software Development Kit
Initializing the Google Cloud SDK
Enable Billing and Cloud Functions
Defining a Cloud Function
Deploying Your Cloud Function
Testing Your Google Cloud Function
Azure Functions
Installing the Azure Command Line Interface
Configuring the Azure CLI
Installing Azure Functions Core Tools
Creating a Custom Handler
Defining a Custom Handler
Locally Testing the Custom Handler
Deploying the Custom Handler
Testing the Custom Handler
What You’ve Learned

INDEX
NETWORK PROGRAMMING WITH GO. © 2021 by Adam Woodbeck
All rights reserved. No part of this work may be reproduced or transmitted in any
form or by any means, electronic or mechanical, including photocopying,
recording, or by any information storage or retrieval system, without the prior
written permission of the copyright owner and the publisher.
ISBN-13: 978-1-7185-0088-4 (print)
ISBN-13: 978-1-7185-0089-1 (ebook)
Publisher: William Pollock
Executive Editor: Barbara Yien
Production Editor: Kate Kaminski
Developmental Editor: Frances Saux
Cover Illustration: Gina Redman
Interior Design: Octopod Studios
Technical Reviewer: Jeremy Bowers
Copyeditor: Sharon Wilkey
Compositor: Jeff Lytle, Happenstance Type-O-Rama
Proofreader: Paula L. Fleming
For information on book distributors or translations, please contact No Starch
Press, Inc. directly:
No Starch Press, Inc.
245 8th Street, San Francisco, CA 94103
phone: 1-415-863-9900; [email protected]
www.nostarch.com
Library of Congress Control Number: 2020943331

No Starch Press and the No Starch Press logo are registered trademarks of No
Starch Press, Inc. Other product and company names mentioned herein may be
the trademarks of their respective owners. Rather than use a trademark symbol
with every occurrence of a trademarked name, we are using the names only in an
editorial fashion and to the benefit of the trademark owner, with no intention of
infringement of the trademark.
The information in this book is distributed on an “As Is” basis, without warranty.
While every precaution has been taken in the preparation of this work, neither the
author nor No Starch Press, Inc. shall have any liability to any person or entity
with respect to any loss or damage caused or alleged to be caused directly or
indirectly by the information contained in it.
For my wife,
Mandy, and
my children,
Benjamin and
Lilyanna
About the Author
Adam Woodbeck is a senior
software engineer at Barracuda
Networks, where he
implemented a distributed
cloud environment in Go to
supplant the previous cloud
infrastructure, profoundly
increasing its scalability and
performance. He’s since served
as the architect for many
network-based services in Go.

About the Technical


Reviewer
Jeremy Bowers is a
distinguished software
architect in the Office of CTO at
Barracuda Networks. Equipped
with many years of lead
developer experience at
Barracuda and security
startups, especially in network
engineering, Jeremy has
successfully designed and
implemented services that
efficiently serve hundreds of
thousands of customers
worldwide. He holds a
bachelor’s and a master’s
degree in computer science
from Michigan State
University.
Other documents randomly have
different content
BELIEF, WHETHER VOLUNTARY?

‘Thy wish was father, Harry, to that thought.’

It is an axiom in modern philosophy (among many other false


ones) that belief is absolutely involuntary, since we draw our
inferences from the premises laid before us and cannot possibly
receive any other impression of things than that which they naturally
make upon us. This theory, that the understanding is purely passive
in the reception of truth, and that our convictions are not in the
power of our will, was probably first invented or insisted upon as a
screen against religious persecution, and as an answer to those who
imputed bad motives to all who differed from the established faith,
and thought they could reform heresy and impiety by the application
of fire and the sword. No doubt, that is not the way: for the will in
that case irritates itself and grows refractory against the doctrines
thus absurdly forced upon it; and as it has been said, the blood of the
martyrs is the seed of the Church. But though force and terror may
not be always the surest way to make converts, it does not follow that
there may not be other means of influencing our opinions, besides
the naked and abstract evidence for any proposition: the sun melts
the resolution which the storm could not shake. In such points as,
whether less an object is black or white, or whether two and two
make four,[61] we may not be able to believe as we please or to deny
the evidence of our reason and senses: but in those points on which
mankind differ, or where we can be at all in suspense as to which
side we shall take, the truth is not quite so plain or palpable; it
admits of a variety of views and shades of colouring, and it should
appear that we can dwell upon whichever of these we choose, and
heighten or soften the circumstances adduced in proof, according as
passion and inclination throw their casting-weight into the scale. Let
any one, for instance, have been brought up in an opinion, let him
have remained in it all his life, let him have attached all his notions of
respectability, of the approbation of his fellow-citizens or his own
self-esteem to it, let him then first hear it called in question and a
strong and unforeseen objection stated to it, will not this startle and
shock him as if he had seen a spectre, and will he not struggle to
resist the arguments that would unsettle his habitual convictions, as
he would resist the divorcing of soul and body? Will he come to the
consideration of the question impartially, indifferently, and without
any wrong bias, or give the painful and revolting truth the same
cordial welcome as the long-cherished and favourite prejudice? To
say that the truth or falsehood of a proposition is the only
circumstance that gains it admittance into the mind, independently
of the pleasure or pain it affords us, is itself an assertion made in
pure caprice or desperation. A person may have a profession or
employment connected with a certain belief, it may be the means of
livelihood to him, and the changing it may require considerable
sacrifices or may leave him almost without resource (to say nothing
of mortified pride)—this will not mend the matter. The evidence
against his former opinion may be so strong (or may appear so to
him) that he may be obliged to give it up, but not without a pang and
after having tried every artifice and strained every nerve to give the
utmost weight to the arguments favouring his own side, and to make
light of and throw those against him into the back-ground. And nine
times in ten this bias of the will and tampering with the proofs will
prevail. It is only with very vigorous or very candid minds, that the
understanding exercises its just and boasted prerogative and induces
its votaries to relinquish a profitable delusion and embrace the
dowerless truth. Even then they have the sober and discreet part of
the world, all the bons pères de famille, who look principally to the
main-chance, against them, and they are regarded as little better
than lunatics or profligates to fling up a good salary and a provision
for themselves and families for the sake of that foolish thing, a
Conscience! With the herd, belief on all abstract and disputed topics
is voluntary, that is, is determined by considerations of personal ease
and convenience, in the teeth of logical analysis and demonstration,
which are set aside as mere waste of words. In short, generally
speaking, people stick to an opinion that they have long supported
and that supports them. How else shall we account for the regular
order and progression of society: for the maintenance of certain
opinions in particular professions and classes of men, as we keep
water in cisterns, till in fact they stagnate and corrupt: and that the
world and every individual in it is not ‘blown about with every wind
of doctrine’ and whisper of uncertainty? There is some more solid
ballast required to keep things in their established order than the
restless fluctuation of opinion and ‘infinite agitation of wit.’ We find
that people in Protestant countries continue Protestants and in
Catholic countries Papists. This, it may be answered, is owing to the
ignorance of the great mass of them; but is their faith less bigoted,
because it is not founded on a regular investigation of the proofs, and
is merely an obstinate determination to believe what they have been
told and accustomed to believe? Or is it not the same with the
doctors of the church and its most learned champions, who read the
same texts, turn over the same authorities, and discuss the same
knotty points through their whole lives, only to arrive at opposite
conclusions? How few are shaken in their opinions, or have the grace
to confess it! Shall we then suppose them all impostors, and that they
keep up the farce of a system, of which they do not believe a syllable?
Far from it: there may be individual instances, but the generality are
not only sincere but bigots. Those who are unbelievers and
hypocrites scarcely know it themselves, or if a man is not quite a
knave, what pains will he not take to make a fool of his reason, that
his opinions may tally with his professions? Is there then a Papist
and a Protestant understanding—one prepared to receive the
doctrine of transubstantiation and the other to reject it? No such
thing: but in either case the ground of reason is preoccupied by
passion, habit, example—the scales are falsified. Nothing can
therefore be more inconsequential than to bring the authority of
great names in favour of opinions long established and universally
received. Cicero’s being a Pagan was no proof in support of the
Heathen mythology, but simply of his being born at Rome before the
Christian era; though his lurking scepticism on the subject and
sneers at the augurs told against it, for this was an acknowledgment
drawn from him in spite of a prevailing prejudice. Sir Isaac Newton
and Napier of Marchiston both wrote on the Apocalypse; but this is
neither a ground for a speedy anticipation of the Millennium, nor
does it invalidate the doctrine of the gravitation of the planets or the
theory of logarithms. One party would borrow the sanction of these
great names in support of their wildest and most mystical opinions;
others would arraign them of folly and weakness for having attended
to such subjects at all. Neither inference is just. It is a simple
question of chronology, or of the time when these celebrated
mathematicians lived, and of the studies and pursuits which were
then chiefly in vogue. The wisest man is the slave of opinion, except
on one or two points on which he strikes out a light for himself and
holds a torch to the rest of the world. But we are disposed to make it
out that all opinions are the result of reason, because they profess to
be so; and when they are right, that is, when they agree with ours,
that there can be no alloy of human frailty or perversity in them; the
very strength of our prejudice making it pass for pure reason, and
leading us to attribute any deviation from it to bad faith or some
unaccountable singularity or infatuation. Alas, poor human nature!
Opinion is for the most part only a battle, in which we take part and
defend the side we have adopted, in the one case or the other, with a
view to share the honour or the spoil. Few will stand up for a losing
cause or have the fortitude to adhere to a proscribed opinion; and
when they do, it is not always from superior strength of
understanding or a disinterested love of truth, but from obstinacy
and sullenness of temper. To affirm that we do not cultivate an
acquaintance with truth as she presents herself to us in a more or
less pleasing shape, or is shabbily attired or well-dressed, is as much
as to say that we do not shut our eyes to the light when it dazzles us,
or withdraw our hands from the fire when it scorches us.
‘Masterless passion sways us to the mood
Of what it likes or loathes.’

Are we not averse to believe bad news relating to ourselves—forward


enough if it relates to others? If something is said reflecting on the
character of an intimate friend or near relative, how unwilling we are
to lend an ear to it, how we catch at every excuse or palliating
circumstance, and hold out against the clearest proof, while we
instantly believe any idle report against an enemy, magnify the
commonest trifles into crimes, and torture the evidence against him
to our heart’s content! Do not we change our opinion of the same
person, and make him out to be black or white according to the
terms we happen to be on? If we have a favourite author, do we not
exaggerate his beauties and pass over his defects, and vice versâ?
The human mind plays the interested advocate much oftener than
the upright and inflexible judge, in the colouring and relief it gives to
the facts brought before it. We believe things not more because they
are true or probable, than because we desire, or (if the imagination
once takes that turn) because we dread them. ‘Fear has more devils
than vast hell can hold.’ The sanguine always hope, the gloomy
always despond, from temperament and not from forethought. Do
we not disguise the plainest facts from ourselves if they are
disagreeable. Do we not flatter ourselves with impossibilities? What
girl does not look in the glass to persuade herself she is handsome?
What woman ever believes herself old, or does not hate to be called
so: though she knows the exact year and day of her age, the more she
tries to keep up the appearance of youth to herself and others? What
lover would ever acknowledge a flaw in the character of his mistress,
or would not construe her turning her back on him into a proof of
attachment? The story of January and May is pat to our purpose;
for the credulity of mankind as to what touches our inclinations has
been proverbial in all ages: yet we are told that the mind is passive in
making up these wilful accounts, and is guided by nothing but the
pros and cons of evidence. Even in action and where we still may
determine by proper precaution the event of things, instead of being
compelled to shut our eyes to what we cannot help, we still are the
dupes of the feeling of the moment, and prefer amusing ourselves
with fair appearances to securing more solid benefits by a sacrifice of
Imagination and stubborn Will to Truth. The blindness of passion to
the most obvious and well known consequences is deplorable. There
seems to be a particular fatality in this respect. Because a thing is in
our power till we have committed ourselves, we appear to dally, to
trifle with, to make light of it, and to think it will still be in our power
after we have committed ourselves. Strange perversion of the
reasoning faculties, which is little short of madness, and which yet is
one of the constant and practical sophisms of human life! It is as if
one should say—I am in no danger from a tremendous machine
unless I touch such a spring and therefore I will approach it, I will
play with the danger, I will laugh at it, and at last in pure sport and
wantonness of heart, from my sense of previous security, I will touch
it—and there’s an end. While the thing remains in contemplation, we
may be said to stand safe and smiling on the brink: as soon as we
proceed to action we are drawn into the vortex of passion and
hurried to our destruction. A person taken up with some one purpose
or passion is intent only upon that: he drives out the thought of every
thing but its gratification: in the pursuit of that he is blind to
consequences: his first object being attained, they all at once, and as
if by magic, rush upon his mind. The engine recoils, he is caught in
his own snare. A servant-girl, for some pique, or for an angry word,
determines to poison her mistress. She knows before hand (just as
well as she does afterwards) that it is at least a hundred chances to
one she will be hanged if she succeeds, yet this has no more effect
upon her than if she had never heard of any such matter. The only
idea that occupies her mind and hardens it against every other, is
that of the affront she has received, and the desire of revenge; she
broods over it; she meditates the mode, she is haunted with her
scheme night and day; it works like poison; it grows into a madness,
and she can have no peace till it is accomplished and off her mind;
but the moment this is the case, and her passion is assuaged, fear
takes place of hatred, the slightest suspicion alarms her with the
certainty of her fate from which she before wilfully averted her
thoughts; she runs wildly from the officers before they know any
thing of the matter; the gallows stares her in the face, and if none
else accuses her, so full is she of her danger and her guilt, that she
probably betrays herself. She at first would see no consequences to
result from her crime but the getting rid of a present uneasiness; she
now sees the very worst. The whole seems to depend on the turn
given to the imagination, on our immediate disposition to attend to
this or that view of the subject, the evil or the good. As long as our
intention is unknown to the world, before it breaks out into action, it
seems to be deposited in our own bosoms, to be a mere feverish
dream, and to be left with all its consequences under our imaginary
control: but no sooner is it realised and known to others, than it
appears to have escaped from our reach, we fancy the whole world
are up in arms against us, and vengeance is ready to pursue and
overtake us. So in the pursuit of pleasure, we see only that side of the
question which we approve: the disagreeable consequences (which
may take place) make no part of our intention or concern, or of the
wayward exercise of our will: if they should happen we cannot help
it; they form an ugly and unwished-for contrast to our favourite
speculation: we turn our thoughts another way, repeating the adage
quod sic mihi ostendis incredulus odi. It is a good remark in ‘Vivian
Grey,’ that a bankrupt walks the streets the day before his name is in
the Gazette with the same erect and confident brow as ever, and only
feels the mortification of his situation after it becomes known to
others. Such is the force of sympathy, and its power to take off the
edge of internal conviction! As long as we can impose upon the
world, we can impose upon ourselves, and trust to the flattering
appearances, though we know them to be false. We put off the evil
day as long as we can, make a jest of it as the certainty becomes more
painful, and refuse to acknowledge the secret to ourselves till it can
no longer be kept from all the world. In short, we believe just as little
or as much as we please of those things in which our will can be
supposed to interfere; and it is only by setting aside our own
interests and inclinations on more general questions that we stand
any chance of arriving at a fair and rational judgment. Those who
have the largest hearts have the soundest understandings; and he is
the truest philosopher who can forget himself. This is the reason why
philosophers are often said to be mad, for thinking only of the
abstract truth and of none of its worldly adjuncts,—it seems like an
absence of mind, or as if the devil had got into them! If belief were
not in some degree voluntary, or were grounded entirely on strict
evidence and absolute proof, every one would be a martyr to his
opinions, and we should have no power of evading or glossing over
those matter-of-fact conclusions for which positive vouchers could be
produced, however painful these conclusions might be to our own
feelings, or offensive to the prejudices of others.
DEFINITION OF WIT

Wit is the putting together in jest, i.e. in fancy, or in bare


supposition, ideas between which there is a serious, i.e. a customary
incompatibility, and by this pretended union, or juxtaposition, to
point out more strongly some lurking incongruity. Or, wit is the
dividing a sentence or an object into a number of constituent parts,
as suddenly and with the same vivacity of apprehension to
compound them again with other objects, ‘wherein the most distant
resemblance or the most partial coincidence may be found.’ It is the
polypus power of the mind, by which a distinct life and meaning is
imparted to the different parts of a sentence or object after they are
severed from each other; or it is the prism dividing the simplicity and
candour of our ideas into a parcel of motley and variegated hues; or
it is the mirror broken into pieces, each fragment of which reflects a
new light from surrounding objects; or it is the untwisting the chain
of our ideas, whereby each link is made to hook on more readily to
others than when they were all bound up together by habit, and with
a view to a set purpose. Ideas exist as a sort of fixtures in the
understanding; they are like moveables (that will also unscrew and
take to pieces) in the wit or fancy. If our grave notions were always
well founded; if there were no aggregates of power, of prejudice, and
absurdity; if the value and importance of an object went on
increasing with the opinion entertained of it, and with the surrender
of our faith, freedom, and every thing else to aggrandise it, then ‘the
squandering glances’ of the wit, ‘whereby the wise man’s folly is
anatomised,’ would be as impertinent as they would be useless. But
while gravity and imposture not only exist, but reign triumphant;
while the proud, obstinate, sacred tumours rear their heads on high,
and are trying to get a new lease of for ever and a day; then oh! for
the Frenchman’s art (‘Voltaire’s?—the same’) to break the torpid
spell, and reduce the bloated mass to its native insignificance! When
a Ferdinand still rules, seated on his throne of darkness and blood,
by English bayonets and by English gold (that have no mind to
remove him thence) who is not glad that an Englishman has the wit
and spirit to translate the title of King Ferdinand into Thing
Ferdinand; and does not regret that, instead of pointing the public
scorn and exciting an indignant smile, the stroke of wit has not the
power to shatter, to wither, and annihilate in its lightning blaze the
monstrous assumption, with all its open or covert abettors? This
would be a set-off, indeed, to the joint efforts of pride, ignorance, and
hypocrisy: as it is, wit plays its part, and does not play it ill, though it
is too apt to cut both ways. It may be said that what I have just
quoted is not an instance of the decomposition of an idea or word
into its elements, and finding a solid sense hid in the unnoticed
particles of wit, but is the addition of another element or letter. But it
was the same lively perception of individual and salient points, that
saw the word King stuck up in capital letters, as it were, and like a
transparency in the Illuminated Missal of the Fancy, that enabled
the satirist to conjure up the letter T before it, and made the
transition (urged by contempt) easy. For myself, with all my blind,
rooted prejudices against the name, it would be long enough before I
should hit upon so happy a mode of expressing them. My mind is not
sufficiently alert and disengaged. I cannot run along the letters
composing it like the spider along its web, to see what they are or
how to combine them anew; I am crushed like the worm, and
writhing beneath the load. I can give no reasons for the faith that is
in me, unless I read a novel of Sir Walter’s, but there I find plenty of
examples to justify my hatred of kings in former times, and to
prevent my wishing to ‘revive the ancient spirit of loyalty’ in this!
Wit, then, according to this account of it, depends on the rapid
analysis or solution of continuity in our ideas, which, by detaching,
puts them into a condition to coalesce more readily with others, and
form new and unexpected combinations: but does all analysis imply
wit, or where is the difference? Does the examining the flowers and
leaves in the cover of a chair-bottom, or the several squares in a
marble pavement, constitute wit? Does looking through a microscope
amount to it? The painter analyses the face into features—nose, eyes,
and mouth—the features into their component parts: but this process
of observation and attention to details only leads him to discriminate
more nicely, and not to confound objects. The mathematician
abstracts in his reasonings, and considers the same line, now as
forming the side of a triangle, now of a square figure; but does he
laugh at the discovery, or tell it to any one else as a monstrous good
jest? These questions require an answer; and an evasive one will not
do. With respect to the wit of words, the explanation is not difficult;
and if all wit were verbal, my task would be soon ended. For
language, being in its own nature arbitrary and ambiguous; or
consisting of ‘sounds significant,’ which are now applied to one thing,
now to something wholly different and unconnected, the most
opposite and jarring mixtures may be introduced into our ideas by
making use of this medium which looks two ways at once, either by
applying the same word to two different meanings, or by dividing it
into several parts, each probably the sign of a different thing, and
which may serve as the starting-post of a different set of associations.
The very circumstance which at first one might suppose would
convert all the world into punsters and word-catchers, and make a
Babel and chaos of language, viz. the arbitrary and capricious nature
of the symbols it uses, is that which prevents them from becoming
so; for words not being substantive things in themselves, and utterly
valueless and unimportant except as the index of thought, the mind
takes no notice of or lays no kind of stress upon them, passes on to
what is to follow, uses them mechanically and almost unconsciously;
and thus the syllables of which a word may be composed, are lost in
its known import, and the word itself in the general context. We may
be said neither to hear nor see the words themselves; we attend only
to the inference, the intention they are meant to communicate. This
merging of the sound in the sense, of the means in the end, both
common sense, the business of life, and the limitation of the human
faculties dictate. But men of wit and leisure are not contented with
this; in the discursiveness of their imaginations and with their
mercurial spirits, they find it an amusement to attend not only to the
conclusion or the meaning of words, but to criticise and have an eye
to the words themselves. Dull, plodding people go no farther than the
literal, or more properly, the practical sense; the parts of a word or
phrase are massed together in their habitual conceptions; their rigid
understandings are confined to the one meaning of any word
predetermined by its place in the sentence, and they are propelled
forward to the end without looking to the right or the left. The
others, who are less the creatures of habit and have a greater
quantity of disposable activity, take the same words out of harness,
as it were, lend them wings, and flutter round them in all sorts of
fantastic combinations, and in every direction that they choose to
take. For instance: the word elder signifies in the dictionary either
age or a certain sort of tree or berry; but if you mention elder wine
all the other senses sink into the dictionary as superfluous and
nonsensical, and you think only of the wine which happens to bear
this name. It required, therefore, a man of Mr. Lamb’s wit and
disdain of the ordinary trammels of thought, to cut short a family
dispute over some very excellent wine of this description, by saying,
‘I wonder what it is that makes elder wine so very pleasant, when
elder brothers are so extremely disagreeable?’ Compagnons du lys,
may mean either the companions of the order of the flower-de-luce,
or the companions of Ulysses—who were transformed into swine—
according as you lay the emphasis. The French wits, at the
restoration of Louis XVIII., with admirable point and truth, applied it
in this latter sense. Two things may thus meet, in the casual
construction and artful encounters of language, wide as the poles
asunder and yet perfectly alike; and this is the perfection of wit,
when the physical sound is the same, the physical sense totally
unlike, and the moral sense absolutely identical. What is it that in
things supplies the want of the double entendre of language?—
Absurdity. And this is the very signification of the term. For it is
only when the two contradictory natures are found in the same
object that the verbal wit holds good, and the real wit or jeu d’esprit
exists and may be brought out wherever this contradiction is obvious
with or without the jeu-de-mots to assist it. We can comprehend how
the evolving or disentangling an unexpected coincidence, hid under
the same name, is full of ambiguity and surprise; but an absurdity
may be written on the face of a thing without the help of language;
and it is in detecting and embodying this that the finest wit lies.
Language is merely one instrument or handle that forwards the
operation: Fancy is the midwife of wit. But how?—If we look
narrowly and attentively, we shall find that there is a language of
things as well as words, and the same variety of meaning, a hidden
and an obvious, a partial and a general one, in both the one and the
other. For things, any more than words, are not detached,
independent existences, but are connected and cohere together by
habit and circumstances in certain sets of association, and consist of
an alphabet, which is thus formed into words and regular
propositions, which being once done and established as the
understood order of the world, the particular ideas are either not
noticed, or determined to a set purpose and ‘foregone conclusion,’
just as the letters of a word are sunk in the word, or the different
possible meanings of a word adjusted by the context. One part of an
object being habitually associated with others, or one object with a
set of other objects, we lump the whole together, take the general
rule for granted, and merge the details in a blind and confused idea
of the aggregate result. This, then, is the province of wit; to penetrate
through the disguise or crust with which indolence and custom ‘skin
and slur over’ our ideas, to move this slough of prejudice, and to
resolve these aggregates or bundles of things into their component
parts by a more lively and unshackled conception of their
distinctions, and the possible combinations of these, so as to throw a
glancing and fortuitous light upon the whole. There is then, it is
obvious, a double meaning in things or ideas as well as in words
(each being ordinarily regarded by the mind merely as the
mechanical signs or links to hold together other ideas connected with
them)—and it is in detecting this double meaning that wit in either
case is shown. Having no books at hand to refer to for examples, and
in the dearth of imagination which I naturally labour under, I must
look round the room in search of illustrations. I see a number of stars
or diamond figures in the carpet, with the violent contrast of red and
yellow and fantastic wreaths of flowers twined round them, without
being able to extract either edification or a particle of amusement
from them: a joint-stool and a fire-screen in a corner are equally
silent on the subject—the first hint I receive (or glimmering of light)
is from a pair of tongs which, placed formally astride on the fender,
bear a sort of resemblance to the human figure called long legs and
no body. The absurdity is not in the tongs (for that is their usual
shape) but in the human figure which has borrowed a likeness
foreign to itself. With this contre-sens, and the uneasiness and
confusion in our habitual ideas which it excites, and the effort to
clear up this by throwing it from us into a totally distinct class of
objects, where by being made plain and palpable, it is proved to have
nothing to do with that into which it has obtruded itself, and to
which it makes pretensions, commences the operation of wit and the
satisfaction it yields to the mind. This I think is the cause of the
delightful nature of wit, and of its relieving, instead of aggravating,
the pains of defect or deformity, by pointing it out in the most glaring
colours, inasmuch as by so doing, we, as it were, completely detach
the peccant part and restore the sense of propriety which, in its
undetected and unprobed state, it was beginning to disturb. It is like
taking a grain of sand out of the eye, a thorn out of the foot. We have
discharged our mental reckoning, and had our revenge. Thus, when
we say of a snub-nose, that it is like an ace of clubs, it is less out of
spite to the individual than to vindicate and place beyond a doubt the
propriety of our notions of form in general. Butler compares the
knight’s red, formal-set beard to a tile:—
‘In cut and die so like a tile,
A sudden view it would beguile;’

we laugh in reading this, but the triumph is less over the wretched
precisian than it is the triumph of common sense. So Swift exclaims:

‘The house of brother Van I spy,
In shape resembling a goose-pie.’

Here, if the satire was just, the characteristics of want of solidity, of


incongruity, and fantastical arrangement were inherent in the
building, and written on its front to the discerning eye, and only
required to be brought out by the simile of the goose-pie, which is an
immediate test and illustration (being an extreme case) of those
qualities. The absurdity, which before was either admired, or only
suspected, now stands revealed, and is turned into a laughing stock,
by the new version of the building into a goose-pie (as much as if the
metamorphosis had been effected by a play of words, combining the
most opposite things), for the mind in this case having narrowly
escaped being imposed upon by taking a trumpery edifice for a
stately pile, and perceiving the cheat, naturally wishes to cut short
the dispute by finding out the most discordant object possible, and
nicknames the building after it. There can be no farther question
whether a goose-pie is a fine building. Butler compares the sun rising
after the dark night to a lobster boiled, and ‘turned from black to
red.’ This is equally mock-wit and mock-poetry, as the sun can
neither be exalted nor degraded by the comparison. It is a play upon
the ideas, like what we see in a play upon words, without meaning. In
a pantomime at Sadler’s Wells, some years ago, they improved upon
this hint, and threw a young chimney-sweeper into a cauldron of
boiling water, who came out a smart, dapper volunteer. This was
practical wit; so that wit may exist not only without the play upon
words, but even without the use of them. Hogarth may be cited as an
instance, who abounds in wit almost as much as he does in humour,
considering the inaptitude of the language he used, or in those
double allusions which throw a reflected light upon the same object,
according to Collins’s description of wit,
‘Like jewels in his crisped hair.’

Mark Supple’s calling out from the Gallery of the House of Commons
—‘A song from Mr. Speaker!’ when Addington was in the chair and
there was a pause in the debate, was undoubtedly wit, though the
relation of any such absurd circumstance actually taking place,
would only have been humour. A gallant calling on a courtesan (for it
is fair to illustrate these intricacies how we can) observed, ‘he should
only make her a present every other time.’ She answered, ‘Then come
only every other time.’ This appears to me to offer a sort of
touchstone to the question. The sense here is, ‘Don’t come unless you
pay.’ There is no wit in this: the wit then consists in the mode of
conveying the hint: let us see into what this resolves itself. The object
is to point out as strongly as can be, the absurdity of not paying; and
in order to do this, an impossibility is assumed by running a parallel
on the phrases, ‘paying every other time,’ and ‘coming every other
time,’ as if the coming went for nothing without paying, and thus, by
the very contrast and contradiction in the terms, showing the most
perfect contempt for the literal coming, of which the essence, viz.
paying, was left out. It is, in short, throwing the most killing scorn
upon, and fairly annihilating the coming without paying, as if it were
possible to come and not to come at the same time, by virtue of an
identical proposition or form of speech applied to contrary things.
The wit so far, then, consists in suggesting, or insinuating indirectly,
an apparent coincidence between two things, to make the real
incongruity, by the recoil of the imagination, more palpable than it
could have been without this feigned and artificial approximation to
an union between them. This makes the difference between jest and
earnest, which is essential to all wit. It is only make-believe. It is a
false pretence set up, or the making one thing pass in supposition for
another, as a foil to the truth when the mask is removed. There need
not be laughter, but there must be deception and surprise: otherwise,
there can be no wit. When Archer, in order to bind the robbers,
suddenly makes an excuse to call out to Dorinda, ‘Pray lend me your
garter, Madam,’ this is both witty and laughable. Had there been any
propriety in the proposal or chance of compliance with it, it would no
longer have been a joke: had the question been quite absurd and
uncalled-for, it would have been mere impudence and folly; but it is
the mixture of sense and nonsense, that is, the pretext for the request
in the fitness of a garter to answer the purpose in question, and the
totally opposite train of associations between a lady’s garter
(particularly in the circumstances which had just happened in the
play) and tying a rascally robber’s hands behind his back, that
produces the delightful equivoque and unction of the passage in
Farquhar. It is laughable, because the train of inquiry it sets in
motion is at once on pleasant and on forbidden ground. We did not
laugh in the former case—‘Then only come every other time’—
because it was a mere ill-natured exposure of an absurdity, and there
was an end of it: but here, the imagination courses up and down
along a train of ideas, by which it is alternately repelled and
attracted, and this produces the natural drollery or inherent
ludicrousness. It is the difference between the wit of humour and the
wit of sense. Once more, suppose you take a stupid, unmeaning
likeness of a face, and throwing a wig over it, stick it on a peg, to
make it look like a barber’s block—this is wit without words. You give
that which is stupid in itself the additional accompaniments of what
is still more stupid, to enhance and verify the idea by a falsehood. We
know the head so placed is not a barber’s block; but it might, we see,
very well pass for one. This is caricature or the grotesque. The face
itself might be made infinitely laughable, and great humour be
shown in the delineation of character: it is in combining this with
other artificial and aggravating circumstances, or in the setting of
this piece of lead that the wit appears.[62] Recapitulation. It is time
to stop short in this list of digressions, and try to join the scattered
threads together. We are too apt, both from the nature of language
and the turn of modern philosophy, which reduces every thing to
simple sensations, to consider whatever bears one name as one thing
in itself, which prevents our ever properly understanding those
mixed modes and various clusters of ideas, to which almost all
language has a reference. Thus if we regard wit as something
resembling a drop of quicksilver, or a spangle from off a cloak, a little
nimble substance, that is pointed and glitters (we do not know how)
we shall make no progress in analysing its varieties or its essence; it
is a mere word or an atom: but if we suppose it to consist in, or be
the result of, several sets and sorts of ideas combined together or
acting upon each other (like the tunes and machinery of a barrel-
organ) we may stand some chance of explaining and getting an
insight into the process. Wit is not, then, a single idea or object, but it
is one mode of viewing and representing nature, or the differences
and similitudes, harmonies and discords in the links and chains of
our ideas of things at large. If all our ideas were literal, physical,
confined to a single impression of the object, there could be no
faculty for, or possibility of, the existence of wit, for its first principle
is mocking or making a jest of anything, and its first condition or
postulate, therefore, is the distinction between jest and earnest. First
of all, wit implies a jest, that is, the bringing forward a pretended or
counterfeit illustration of a thing; which, being presently withdrawn,
makes the naked truth more apparent by contrast. It is lessening and
undermining our faith in any thing (in which the serious consists) by
heightening or exaggerating the vividness of our idea of it, so as by
carrying it to extremes to show the error in the first concoction, and
from a received practical truth and object of grave assent, to turn it
into a laughing stock to the fancy. This will apply to Archer and the
lady’s garter, which is ironical: but how does it connect with the
comparison of Hudibras’s beard to a tile, which is only an
exaggeration; or the Compagnons d’Ulysse, which is meant for a
literal and severe truth, as well as a play upon words? More generally
then, wit is the conjuring up in the fancy any illustration of an idea
by likeness, combination of other images, or by a form of words, that
being intended to point out the eccentricity or departure of the
original idea from the class to which it belongs does so by referring it
contingently and obliquely to a totally opposite class, where the
surprise and mere possibility of finding it, proves the inherent want
of congruity. Hudibras’s beard is transformed (by wit) into a tile: a
strong man is transformed (by imagination) into a tower. The
objects, you will say, are unlike in both cases; yet the comparison in
one case is meant seriously, in the other it is merely to tantalize. The
imagination is serious, even to passion, and exceeds truth by laying a
greater stress on the object; wit has no feeling but contempt, and
exceeds truth to make light of it. In a poetical comparison there
cannot be a sense of incongruity or surprise; in a witty one there
must. The reason is this: It is granted stone is not flesh, a tile is not
hair, but the associated feelings are alike, and naturally coalesce in
one instance, and are discordant and only forced together by a trick
of style in the other. But how can that be, if the objects occasioning
these feelings are equally dissimilar?—Because the qualities of
stiffness or squareness and colour, objected to in Hudibras’s beard,
are themselves peculiarities and oddities in a beard, or contrary to
the nature or to our habitual notion of that class of objects; and
consequently (not being natural or rightful properties of a beard)
must be found in the highest degree in, and admit of, a grotesque
and irregular comparison with a class of objects, of which squareness
and redness[63] are the essential characteristics (as of a tile), and
which can have, accordingly, no common point of union in general
qualities or feeling with the first class, but where the ridicule must be
just and pointed from this very circumstance, that is, from the
coincidence in that one particular only, which is the flaw and
singularity of the first object. On the other hand, size and strength,
which are the qualities on which the comparison of a man to a tower
hinges, are not repugnant to the general constitution of man, but
familiarly associated with our ideas of him: so that there is here no
sense of impropriety in the object, nor of incongruity or surprise in
the comparison: all is grave and decorous, and instead of burlesque,
bears the aspect of a loftier truth. But if strength and magnitude fall
within our ordinary contemplations of man as things not out of the
course of nature, whereby he is enabled, with the help of
imagination, to rival a tower of brass or stone, are not littleness and
weakness the counterpart of these, and subject to the same rule?
What shall we say, then, to the comparison of a dwarf to a pigmy, or
to Falstaff’s comparison of Silence to ‘a forked radish, or a man made
after supper of a cheese-paring?’ Once more then, strength and
magnitude are qualities which impress the imagination in a powerful
and substantive manner; if they are an excess above the ordinary or
average standard, it is an excess to which we lend a ready and
admiring belief, that is, we will them to be if they are not, because
they ought to be—whereas, in the other case of peculiarity and defect,
the mind is constantly at war with the impression before it; our
affections do not tend that way; we will it not to be; reject, detach,
and discard it from the object as much and as far as possible; and
therefore it is, that there being no voluntary coherence but a constant
repugnance between the peculiarity (as of squareness) and the object
(as a beard), the idea of a beard as being both naturally and properly
of a certain form and texture remains as remote as ever from that of
a tile; and hence the double problem is solved, why the mind is at
once surprised and not shocked by the allusion; for first, the mind
being made to see a beard so unlike a beard, is glad to have the
discordance increased and put beyond controversy, by comparing it
to something still more unlike one, viz., a tile; and secondly,
squareness never having been admitted as a desirable and accredited
property of a beard as it is of a tile, by which the two classes of ideas
might have been reconciled and compromised (like those of a man
and a tower) through a feeling or quality common (in will) to both,
the transition from one to the other continues as new and startling,
that is, as witty as ever;—which was to be demonstrated. I think I see
my way clearly so far. Wit consists in two things, the perceiving the
incongruity between an object and the class to which it generally
belongs, and secondly, the pointing out or making this incongruity
more manifest, by transposing it to a totally different class of objects
in which it is prescriptively found in perfection. The medium or link
of connexion between the opposite classes of ideas is in the
unlikeness of one of the things in question to itself, i.e. the class it
belongs to: this peculiarity is the narrow bridge or line along which
the fancy runs to link it to a set of objects in all other respects
different from the first, and having no sort of communication, either
in fact or inclination, with it, and in which the pointedness and
brilliancy, or the surprise and contrast of wit consists. The faculty by
which this is done is the rapid, careless decomposition and
recomposition of our ideas, by means of which we easily and clearly
detach certain links in the chain of our associations from the place
where they stand, and where they have an infirm footing, and join
them on to others, to show how little intimacy they had with the
former set.
The motto of wit seems to be, Light come, light go. A touch is
sufficient to dissever what already hangs so loose as folly, like froth
on the surface of the wave; and an hyperbole, an impossibility, a pun
or a nickname will push an absurdity, which is close upon the verge
of it, over the precipice. It is astonishing how much wit or laughter
there is in the world—it is one of the staple commodities of daily life
—and yet, being excited by what is out of the way and singular, it
ought to be rare, and gravity should be the order of the day. Its
constant recurrence from the most trifling and trivial causes, shows
that the contradiction is less to what we find things than to what we
wish them to be. A circle of milliner’s-girls laugh all day long at
nothing, or day after day at the same things—the same cant phrase
supplies the wags of the town with wit for a month—the same set of
nicknames has served the John Bull and Blackwood’s Magazine ever
since they started. It would appear by this that its essence consisted
in monotony, rather than variety. Some kind of incongruity however
seems inseparable from it, either in the object or language. For
instance, admiration and flattery become wit by being expressed in a
quaint and abrupt way. Thus, when the dustman complimented the
Duchess of Devonshire by saying, as she passed, ‘I wish that lady
would let me light my pipe at her eyes,’ nothing was meant less than
to ridicule or throw contempt, yet the speech was wit and not serious
flattery. The putting a wig on a stupid face and setting it on a barber’s
pole is wit or humour:—the fixing a pair of wings on a beautiful
figure to make it look more like an angel is poetry; so that the
grotesque is either serious or ludicrous, as it professes to exalt or
degrade. Whenever any thing is proposed to be done in the way of
wit, it must be in mockery or jest; since if it were a probable or
becoming action, there would be no drollery in suggesting it; but this
does not apply to illustrations by comparison, there is here no line
drawn between what is to take place and what is not to take place—
they must only be extreme and unexpected. Mere nonsense,
however, is not wit. For however slight the connexion, it will never
do to have none at all; and the more fine and fragile it is in some
respects, the more close and deceitful it should be in the particular
one insisted on. Farther, mere sense is not wit. Logical subtilty or
ingenuity does not amount to wit (although it may mimic it) without
an immediate play of fancy, which is a totally different thing. The
comparing the phrenologist’s division of the same portion of the
brain into the organs of form and colour to the cutting a Yorkshire
pudding into two parts, and calling the one custard and the other
plum-cake may pass for wit with some, but not with me. I protest (if
required) against having a grain of wit.[64]

You might also like