Full download Grokking Simplicity Taming complex software with functional thinking 1st Edition Eric Normand pdf docx
Full download Grokking Simplicity Taming complex software with functional thinking 1st Edition Eric Normand pdf docx
https://ebookgate.com
https://ebookgate.com/product/grokking-simplicity-
taming-complex-software-with-functional-
thinking-1st-edition-eric-normand/
https://ebookgate.com/product/complex-vector-functional-equations-1st-
edition-ice-risteski/
ebookgate.com
https://ebookgate.com/product/social-thinking-software-practice-1st-
edition-yvonne-dittrich/
ebookgate.com
https://ebookgate.com/product/grokking-bitcoin-1st-edition-kalle-
rosenbaum/
ebookgate.com
https://ebookgate.com/product/software-engineering-modern-
approaches-2nd-edition-eric-j-braude/
ebookgate.com
Grokking Algorithms 1st Edition Aditya Y. Bhargava
https://ebookgate.com/product/grokking-algorithms-1st-edition-aditya-
y-bhargava/
ebookgate.com
https://ebookgate.com/product/functional-analytic-and-complex-methods-
proceedings-of-the-international-graz-workshop-1st-edition-wolfgang-
tutschke/
ebookgate.com
https://ebookgate.com/product/working-with-static-sites-bringing-the-
power-of-simplicity-to-modern-sites-1st-edition-raymond-camden/
ebookgate.com
https://ebookgate.com/product/thinking-with-water-1st-edition-cecilia-
chen-ed/
ebookgate.com
https://ebookgate.com/product/simplicity-complexity-and-modelling-1st-
edition-mike-christie/
ebookgate.com
Eric Normand
Forewords by Guy Steele and Jessica Kerr
grokking
Simplicity
taming complex software with
functional thinking
Eric Normand
Foreword by Guy Steele and Jessica Kerr
MANNING
S helter I Sl and
For online information and ordering of this and other Manning books, please visit
www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more
information, please contact
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form
or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the
publisher.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed
as trademarks. Where those designations appear in the book, and Manning Publications was aware of a
trademark claim, the designations have been printed in initial caps or all caps.
Recognizing the importance of preserving what has been written, it is Manning’s policy to have the
books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also
our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at
least 15 percent recycled and processed without the use of elemental chlorine.
ISBN: 9781617296208
Printed in the United States of America
contents
foreword xv
preface xix
acknowledgments xxi
about this book xxiii
about the author xxvii
iii
iv contents
Welcome to MegaMart.com! 62
Calculating free shipping 63
Calculating tax 64
We need to make it more testable 65
We need to make it more reusable 66
Distinguishing actions, calculations, and data 67
Functions have inputs and outputs 68
contents v
index 557
foreword
Guy Steele
I’ve been writing programs for over 52 years now. I still find it exciting, because there are
always new problems to tackle and new things to learn. My programming style has
changed quite a bit over the decades, as I learn new algorithms, new programming lan-
guages, and new techniques for organizing my code.
When I first learned to program, in the 1960s, a well-accepted methodology was to
draw a flowchart for the program before writing actual code. Every computation was
represented by a rectangular box, every decision by a diamond, and every input/output
operation by some other shape. The boxes were connected by arrows representing the
flow of control from one box to another. Then writing the program was just a matter of
writing code for the contents of each box in some order, and whenever an arrow pointed
anywhere but the next box you were about to code, you would write a goto statement to
indicate the necessary transfer of control. The problem was that flowcharts were two-
dimensional but code was one-dimensional, so even if the structure of a flowchart looked
nice and neat on paper, it could be hard to understand when written out as code. If you
drew arrows on your code from each goto statement to its destination, the result often
resembled a mound of spaghetti, and in those days we indeed talked about the difficulties
of understanding and maintaining “spaghetti code.”
The first big influence on my programming style was the “structured programming”
movement of the early 1970s. Looking back, I see two big ideas that came out of that
community-wide discussion. Both of them are techniques for organizing control flow.
The idea, which became famous, was that most control flow could be expressed in terms
of a few simple patterns: sequential execution, multiway decisions such as if-then
else and switch statements, and repetitive execution such as while loops and for
loops. This was sometimes oversimplified into the slogan “No goto statements!”—but
the important thing was the patterns, and if you used the patterns consistently you found
xv
xvi foreword
that you rarely needed to use an actual goto statement. The second idea, less famous but no
less important, was that sequential statements could be grouped into blocks that should be
properly nested, and that a non-local transfer of control may jump to the end of a block or
out of a block (think of break and continue) but should not jump into a block from
outside.
When I first learned the ideas of structured programming, I did not have access to a struc-
tured programming language. But I found myself writing my Fortran code a little more care-
fully, organizing it according to the principles of structured programming. I even found
myself writing low-level assembly language code as if I were a compiler translating from a
structured programming language into machine instructions. I found that this discipline
made my programs easier to write and to maintain. Yes, I was still writing goto statements
or branch instructions, but almost always according to one of the standard patterns, and that
made it much easier to see what was going on.
In the bad old days when I wrote Fortran code, all the variables needed in a program
were declared right up front, all together in one place, followed by the executable code. (The
COBOL language rigidly formalized this specific organization; variables were declared in the
“data division” of a program, which began with the actual words “DATA DIVISION.” This
was then followed by the code, which always began with the actual words “PROCEDURE
DIVISION.”) Every variable could be referred to from any point in the code. That made it
hard to figure out, for any specific variable, exactly how it might be accessed and modified.
The second big influence that changed my programming style was “object-oriented pro-
gramming,” which for me encompasses a combination and culmination of early ideas about
objects, classes, “information hiding,” and “abstract data types.” Again, looking back I see two
big ideas that came out of this grand synthesis, and both have to do with organizing access to
data. The first idea is that variables should be “encapsulated” or “contained” in some way, to
make it easier to see that only certain parts of the code can read or write them. This can be
as simple as declaring local variables within a block rather than at the top of the program, or as
elaborate as declaring variables within a class (or module) so that only methods of that class
(or procedures within the module) can access them. Classes or modules can be used to guar-
antee that sets of variables obey certain consistency properties, because methods or procedures
can be coded to ensure that if one variable is updated, then related variables are also appropri-
ately updated. The second idea is inheritance, meaning that one can define a more complicated
object by extending simpler ones, adding new variables and methods, and perhaps overriding
existing methods. This second idea is made possible because of the first one.
At the time that I learned about objects and abstract data types, I was writing a lot of Lisp
code, and while Lisp itself is not a purely object-oriented language, it is pretty easy to use
Lisp to implement data structures and to access those data structures only through approved
methods (implemented as Lisp functions). If I paid attention to organizing my data, I got
many of the benefits of object-oriented programming, even though I was coding in a lan-
guage that did not enforce that discipline.
foreword xvii
The third big influence on my programming style was “functional programming,” which
is sometimes oversimplified into the slogan “No side effects!” But this is not realistic.
Understood properly, functional programming provides techniques for organizing side
effects so that they don’t occur just anywhere—and that is the subject of this book.
Once again, there are actually two big ideas that work together. The first big idea is to dis-
tinguish computations, which have no effect on the outside world and produce the same result
even when executed multiple times, from actions, which may produce different results each
time they are executed and may have some side effect on the outside world, such as displaying
text on a screen, or launching a rocket. A program is easier to understand if organized into
standard patterns that make it easier to figure out which parts might have side effects and
which parts are “merely computations.” The standard patterns may be divided into two sub-
categories: those typically used in single-threaded programs (sequential execution) and those
typically used in multi-threaded programs (parallel execution).
The second big idea is a set of techniques for processing collections of data—arrays, lists,
databases—“all at once” rather than item by item. These techniques are most effective when
the items can be processed independently, free of side effects and their influence, so once
again the second idea works better thanks to the first idea.
In 1995 I helped to write the first full specification for the Java programming language; the
next year I helped to write the first standard for JavaScript (the ECMAScript standard). Both
these languages were clearly object-oriented; indeed, in Java there is no such thing as a global
variable—every variable must be declared within some class or method. And both those lan-
guages have no goto statement; the language designers concluded that the structured pro-
gramming movement had succeeded, and goto was no longer needed. Nowadays millions
of programmers get along just fine without goto statements and global variables.
But what about functional programming? There are some purely functional languages
such as Haskell that are widely used. You can use Haskell to display text on a screen, or to
launch a rocket, but the use of side effects within Haskell is subject to a very strict discipline.
One consequence is that you can’t just drop a print statement anywhere you want in the mid-
dle of a Haskell program to see what’s going on.
On the other hand, Java, JavaScript, C++, Python, and so many others are not purely func-
tional languages, but have adopted ideas from functional programming that make them
much easier to use. And this is the punchline: once you understand the key principles for
organizing side effects, these simple ideas can be used in any programming language. This
book, Grokking Simplicity, shows you how to do that. It may seem long, but it’s an easy read,
filled with practical examples and sidebars that explain the technical terms. I was drawn in,
really enjoyed it, and learned a couple of new ideas that I am eager to apply in my own code.
I hope you enjoy it, too!
xviii foreword
Jessica Kerr
Jessitron, LLC
When I first learned programming, I loved it for its predictability. Each of my programs was
simple: it was small, it ran on one machine, and it was easy for one person (me) to use. Loving
software development is something different. Software is not small. It is not written by one
person. It runs on many machines, in many processes. It accommodates different people,
including people who don’t care how the software works.
Useful software doesn’t get to be simple.
What’s a programmer to do?
For sixty years, the techniques of functional programming have grown in the minds of
computer scientists. Researchers like to make positive statements about what can never
happen.
This last decade or two, developers have been adopting these techniques in business soft-
ware. This is good timing, because it corresponds with the dominance of web applications:
every app is a distributed system, downloaded to unknown computers, clicked on by unknown
people. Functional programming is well suited. Whole categories of hard-to-find bugs can
never happen.
But functional programming does not transfer peacefully from academia to business soft-
ware. We are not using Haskell. We aren’t starting from scratch. We depend on runtimes and
libraries outside our control. Our software interacts with many other systems; it is not enough
to output an answer. It is a long way from FP-land to legacy business software.
Eric has undertaken this journey for us. He delved into functional programming, found its
most helpful essences, and brought them to us where we are.
Gone are the strict typing, the “pure” languages, the category theory. Here instead we
notice the code that interacts with the world, choose to leave data unchanged, and break code
apart for better clarity. Instead of high-minded abstractions, here are degrees and levels of
abstraction. Instead of eschewing state, here are ways to safely keep state.
Eric offers new ways to perceive our existing code. New diagrams, new smells, new heuris-
tics. Yes, this came out of a journey into functional programming—yet, when he makes his
ways of thinking explicit so that we can use them too, he creates something new. Something
that will help all of us with our creations.
My simple programs were not useful to the world. Our useful software will never be sim-
ple. But we can make more of our code simpler than it was. And we can manage those crucial
bits that interact with the world. Eric unwinds these contradictions for us.
This book will make you better at programming—and more, at software development.
Another random document with
no related content on Scribd:
O Thou! th’ unseen, th’ all-seeing!—Thou whose ways,
Mantled with darkness, mock all finite gaze,
Before whose eyes the creatures of Thy hand,
Seraph and man alike, in weakness stand,
And countless ages, trampling into clay
Earth’s empires on their march, are but a day;
Father of worlds unknown, unnumber’d!—Thou,
With whom all time is one eternal now,
Who know’st no past nor future—Thou whose breath
Goes forth, and bears to myriads life or death!
Look on us! guide us!—wanderers of a sea
Wild and obscure, what are we, reft of Thee?
A thousand rocks, deep-hid, elude our sight,
A star may set—and we are lost in night;
A breeze may waft us to the whirlpool’s brink,
A treacherous song allure us—and we sink!
[What follows is worthy of being here recorded. Thirteen years after the
publication of the Sceptic, and when the author, towards the termination of her
earthly career, was residing with her family in Dublin, a circumstance occurred by
which Mrs Hemans was greatly affected and impressed. A stranger one day called
at her house, and begged earnestly to see her. She was then just recovering from
one of her frequent illnesses, and was obliged to decline the visits of all but her
immediate friends. The applicant was therefore told that she was unable to receive
him; but he persisted in entreating for a few minutes’ audience, with such urgent
importunity that at last the point was conceded. The moment he was admitted,
the gentleman (for such his manner and appearance declared him to be)
explained, in words and tones of the deepest feeling, that the object of his visit
was to acknowledge a debt of obligation which he could not rest satisfied without
avowing—that to her he owed, in the first instance, that faith and those hopes
which were now more precious to him than life itself; for that it was by reading
her poem of The Sceptic he had been first awakened from the miserable delusions
of infidelity, and induced to “search the Scriptures.” Having poured forth his thanks
and benedictions in an uncontrollable gush of emotion, this strange but interesting
visitant took his departure, leaving her overwhelmed with a mingled sense of
joyful gratitude and wondering humility.—Memoir, p. 255-6.]
North American Review.—“In 1820 Mrs Hemans published The Sceptic, a poem of
great merit for its style and its sentiments, of which we shall give a rapid sketch.
She considers the influence of unbelief on the affections and gentler part of our
nature, and, after pursuing the picture of the misery consequent on doubt, shows
the relief that may be found in the thoughts that have their source in immortality.
Glancing at pleasure as the only resort of the sceptic, she turns to the sterner
tasks of life:—
But then the sceptic has no relief in memory; for memory recalls no joys but such
as were transitory, and known to be such; and as for hope—
“The poet then asks, if an infidel dare love; and, having no home for his thoughts
in a better world, nurse such feelings as delight to enshrine themselves in the
breast of a parent. She addresses him on the insecurity of an attachment to a vain
idol, from which death may at any time divide him ‘for ever.’... For relief the infidel
is referred to the Christian religion, in a strain which unites the fervour of devotion
with poetic sensibility.... The poem proceeds to depict, in a forcible manner, the
unfortunate state of a mind which acquires every kind of knowledge but that
which gives salvation; and, having gained possession of the secrets of all ages,
and communed with the majestic minds that shine along the pathway of time,
neglects nothing but eternity. Such a one, in the season of suffering, finds relief in
suicide, and escapes to death as to an eternal rest. The thought of death recurs to
the mind of the poet, and calls forth a fervent prayer for the divine presence and
support in the hour of dissolution; for the hour, when the soul is brought to the
mysterious verge of another life, is an ‘awful one.’... This is followed by an allusion
to the strong love of life which belongs to human nature, and the instinctive
apprehension with which the parting mind muses on its future condition, and asks
of itself mystic questions, that it cannot solve. But through the influence of religion
—
“After some lines expressing the spirit of English patriotism, in a manner with
which foreigners can only be pleased, the poem closes with the picture of a
mother teaching her child the first lessons of religion, by holding up the divine
example of the Saviour.
“We have been led into a longer notice of this poem, for it illustrates the character
of Mrs Hemans’s manner. We perceive in it a loftiness of purpose, an earnestness
of thought, sometimes made more interesting by a tinge of melancholy, a depth of
religious feeling, a mind alive to all the interests, gratifications, and sorrows of
social life.”—Professor Norton.
Edinburgh Monthly Review.—“We have on more than one occasion expressed the
very high opinion which we entertain of the talents of this lady; and it is gratifying
to find that she gives us no reason to retract or modify in any degree the applause
already bestowed, and that every fresh exhibition of her powers enhances and
confirms her claims upon our admiration. Mrs Hemans is indeed but in the infancy
of her poetical career; but it is an infancy of unrivalled beauty, and of very high
promise. Not but that she has already performed more than has often been
sufficient to win for other candidates no mean place in the roll of fame, but
because what she has already done shrinks, when compared with what we
consider to be her own great capacity, to mere incipient excellence—the intimation
rather than the fulfilment of the high destiny of her genius.
... “The verses of Mrs Hemans appear the spontaneous offspring of intense and
noble feeling, governed by a clear understanding, and fashioned into elegance by
an exquisite delicacy and precision of taste. With more than the force of many of
her masculine competitors, she never ceases to be strictly feminine in the whole
current of her thought and feeling, nor approaches by any chance the verge of
that free and intrepid course of speculation, of which the boldness is more
conspicuous than the wisdom, but into which some of the most remarkable among
the female literati of our times have freely and fearlessly plunged. She has, in the
poem before us, made choice of a subject of which it would have been very
difficult to have reconciled the treatment, in the hands of some female authors, to
the delicacy which belongs to the sex, and the tenderness and enthusiasm which
form its finest characteristics. A coarse and chilling cento of the exploded fancies
of modern scepticism, done into rhyme by the hand of a woman, would have been
doubly disgusting, by the revival of absurdities long consigned to oblivion, and by
the revolting exhibition of a female mind shorn of all its attractions, and wrapt in
darkness and defiance. But Mrs Hemans has chosen the better and the nobler
cause, and, while she has left in the poem before us every trace of vigorous
intellect of which the subject admitted, and has far transcended in energy of
thought the prosing pioneers of unbelief, she has sustained throughout a tone of
warm and confiding piety, and has thus proved that the humility of hope and of
faith has in it none of the weakness with which it has been charged by the
arrogance of impiety, but owns a divine and mysterious vigour residing under the
very aspect of gentleness and devotion.”
Quarterly Review.—“Her last two publications are works of a higher stamp; works,
indeed, of which no living poet need to be ashamed. The first of them is entitled
The Sceptic, and is devoted, as our readers will easily anticipate, to advocating the
cause of religion. Undoubtedly the poem must have owed its being to the
circumstances of the times—to a laudable indignation at the course which
literature in many departments seemed lately to be taking in this country, and at
the doctrines disseminated with industry, principally (but by no means exclusively,
as has been falsely supposed) among the lower orders. Mrs Hemans, however,
does not attempt to reason learnedly or laboriously in verse; few poems,
ostensibly philosophical or didactic, have ever been of use, except to display the
ingenuity and talent of the writers. People are not often taught a science or an art
in poetry, and much less will an infidel be converted by a theological treatise in
verse. But the argument of The Sceptic is one of irresistible force to confirm a
wavering mind; it is simply resting the truth of religion on the necessity of it—on
the utter misery and helplessness of man without it. This argument is in itself
available for all the purposes of poetry: it appeals to the imagination and passions
of man; it is capable of interesting all our affectionate hopes and charities, of
acting upon all our natural fears. Mrs Hemans has gone through this range with
great feeling and ability; and when she comes to the mind which has clothed itself
in its own strength, and relying proudly on that alone in the hour of affliction, has
sunk into distraction in the contest, she rises into a strain of moral poetry not
often surpassed:—
I.
II.
But Earth hath seen the days, ere yet the flowers
Of Eden wither’d, when reveal’d ye shone
In all your brightness midst those holy bowers—
Holy, but not unfading, as your own!
While He, the child of that primeval soil,
With you its paths in high communion trode,
His glory yet undimm’d by guilt or toil,
And beaming in the image of his God,
And his pure spirit glowing from the sky,
Exulting in its light, a spark of Deity.
III.
IV.
V.
VII.
VIII.
IX.
X.
XI.
XII.
XIII.
XIV.
Was not wild Nature, in that elder-time,
Clothed with a deeper power?—earth’s wandering race,
Exploring realms of solitude sublime,
Not as we see, beheld her awful face!
Art had not tamed the mighty scenes which met
Their searching eyes; unpeopled kingdoms lay
In savage pomp before them—all was yet
Silent and vast, but not as in decay;
And the bright daystar, from his burning throne,
Look’d o’er a thousand shores, untrodden, voiceless, lone.
XV.
XVI.
XVII.
XVIII.
XIX.
XX.
XXI.
XXII.
Yet not with Saba’s fragrant wealth alone,
Balsam and myrrh, the votive pile was strew’d;
For the dark children of the burning zone
Drew frenzy from thy fervours, and bedew’d
With their own blood thy shrine; while that wild scene,
Haply with pitying eye, thine angel view’d,
And though with glory mantled, and severe
In his own fulness of beatitude,
Yet mourn’d for those whose spirits from thy ray
Caught not one transient spark of intellectual day.
XXIII.
XXIV.
XXV.
XXVI.
XXVII.
XXVIII.
[In the spring of 1820, Mrs Hemans first made the acquaintance of one who
became afterwards a zealous and valuable friend, revered in life, and sincerely
mourned in death—Bishop Heber, then Rector of Hodnet, and a frequent visitor at
Bodryddan, the residence of his father-in-law, the late Dean of St Asaph, from
whom also, during an intercourse of many years, Mrs Hemans at all times received
much kindness and courtesy. Mr Reginald Heber was the first eminent literary
character with whom she had ever familiarly associated; and she therefore entered
with a peculiar freshness of feeling in to the delight inspired by his conversational
powers, enhanced as they were by that gentle benignity of manner, so often the
characteristic of minds of the very highest order. In a letter to a friend on this
occasion, she thus describes her enjoyment:—“I am more delighted with Mr Heber
than I can possibly tell you; his conversation is quite rich with anecdote, and every
subject on which he speaks had been, you would imagine, the whole study of his
life. In short, his society has made much the same sort of impression on my mind
that the first perusal of Ivanhoe did; and was something so perfectly new to me,
that I can hardly talk of any thing else. I had a very long conversation with him on
the subject of the poem, which he read aloud, and commented upon as he
proceeded. His manner was so entirely that of a friend, that I felt perfectly at
ease, and did not hesitate to express all my own ideas and opinions on the
subject, even where they did not exactly coincide with his own.”
The poem here alluded to was the one entitled Superstition and Revelation, which
Mrs Hemans had commenced some time before, and which was intended to
embrace a very extensive range of subject. Her original design will be best given
in her own words, from a letter to her friend Miss Park:—“I have been thinking a
good deal of the plan we discussed together, of a poem on national superstitions.
‘Our thoughts are linked by many a hidden chain,’ and in the course of my
lucubrations on this subject, an idea occurred to me, which I hope you will not
think me too presumptuous in wishing to realise. Might not a poem of some extent
and importance, if the execution were at all equal to the design, be produced,
from contrasting the spirit and tenets of Paganism with those of Christianity? It
would contain, of course, much classical allusion; and all the graceful and sportive
fictions of ancient Greece and Italy, as well as the superstitions of more barbarous
climes, might be introduced to prove how little consolation they could convey in
the hour of affliction—or hope, in that of death. Many scenes from history might
be portrayed in illustration of this idea; and the certainty of a future state, and of
the immortality of the soul, which we derive from revelation, are surely subjects
for poetry of the highest class. Descriptions of those regions which are still
strangers to the blessings of our religion, such as the greatest part of Africa, India,
&c., might contain much that is poetical; but the subject is almost boundless, and
I think of it till I am startled by its magnitude.”
Mr Heber approved highly of the plan of the work, and gave her every
encouragement to proceed in it; supplying her with many admirable suggestions,
both as to the illustrations which might be introduced with the happiest effect, and
the sources from whence the requisite information would best be derived. But the
great labour and research necessary to the development of a plan which included
the superstitions of every age and country, from the earliest of all idolatries—the
adoration of the sun, moon, and host of heaven, alluded to in the book of Job—to
the still existing rites of the Hindoos—would have demanded a course of study too
engrossing to be compatible with the many other claims, both domestic and
literary, which daily pressed more and more upon the author’s time. The work
was, therefore, laid aside; and the fragment now first published is all that remains
of it, though the project was never distinctly abandoned.]
ITALIAN LITERATURE.[147]
THE BASVIGLIANA OF MONTI.
FROM SISMONDI’s “LITTERATURE DU MIDI.”
[147] “About this time (1820) Mrs Hemans was an occasional
contributor to the Edinburgh Monthly Magazine, then conducted
by the Rev. Robert Morehead, whose liberal courtesy in the
discharge of his editorial office associated many agreeable
recollections with the period of this literary intercourse. Several of
her poems appeared in the above-mentioned periodical, as also a
series of papers on foreign literature, which, with very few
exceptions, were the only prose compositions she ever gave to
the world; and indeed to these papers such a distinctive
appellation is perhaps scarcely applicable, as the prose writing
may be considered subordinate to the poetical translations, which
it is used to introduce.”—Memoir, p. 41.
Vincenzo Monti, a native of Ferrara, is acknowledged, by the
unanimous consent of the Italians, as the greatest of their living
poets. Irritable, impassioned, variable to excess, he is always
actuated by the impulse of the moment. Whatever he feels is felt
with the most enthusiastic vehemence. He sees the objects of his
thoughts—they are present, and clothed with life—before him, and a
flexible and harmonious language is always at his command to paint
them with the richest colouring. Persuaded that poetry is only
another species of painting, he makes the art of the poet consist in
rendering apparent, to the eyes of all, the pictures created by his
imagination for himself; and he permits not a verse to escape him
which does not contain an image. Deeply impressed by the study of
Dante, he has restored to the character of Italian poetry those
severe and exalted beauties by which it was distinguished at its
birth; and he proceeds from one picture to another with a grandeur
and dignity peculiar to himself. It is extraordinary that, with
something so lofty in his manner and style of writing, the heart of so
impassioned a character should not be regulated by principles of
greater consistency. In many other poets, this defect might pass
unobserved: but circumstances have thrown the fullest light upon
the versatility of Monti, and his glory as a poet is attached to works
which display him in continual opposition to himself. Writing in the
midst of the various Italian revolutions, he has constantly chosen
political subjects for his compositions, and he has successively
celebrated opposite parties in proportion to their success. Let us
suppose, in his justification, that he composes as an improvisatore,
and that his feelings, becoming highly excited by the given theme,
he seizes the political ideas it suggests, however foreign they may
be to his individual sentiments.[148] In these political poems—the
object and purport of which are so different—the invention and
manner are, perhaps, but too similar. The Basvigliana, or poem on
the death of Basville, is the most celebrated; but, since its
appearance, it has been discovered that Monti, who always imitated
Dante, has now also very frequently imitated himself.
Hugh Basville was the French Envoy who was put to death at Rome
by the people, for attempting, at the beginning of the Revolution, to
excite a sedition against the Pontifical government. Monti, who was
then the poet of the Pope, as he has since been of the Republic,
supposes that, at the moment of Basville’s death, he is saved by a
sudden repentance, from the condemnation which his philosophical
principles had merited. But, as a punishment for his guilt, and a
substitute for the pains of purgatory, he is condemned by Divine
Justice to traverse France until the crimes of that country have
received their due chastisement, and doomed to contemplate the
misfortunes and reverses to which he has contributed by assisting to
extend the progress of the Revolution.
An angel of heaven conducts Basville from province to province, that
he may behold the desolation of his lovely country. He then conveys
him to Paris, and makes him witness the sufferings and death of
Louis XVI., and afterwards shows him the Allied armies prepared to
burst upon France, and avenge the blood of her king. The poem
concludes before the issue of the contest is known. It is divided into
four cantos of three hundred lines each, and written in terza rima,
like the poem of Dante. Not only many expressions, epithets, and
lines are borrowed from the Divine Comedy, but the invention itself
is similar. An angel conducts Basville through the suffering world;
and this faithful guide, who consoles and supports the spectator-
hero of the poem, acts precisely the same part which is performed
by Virgil in Dante. Basville himself thinks, feels, and suffers, exactly
as Dante would have done. Monti has not preserved any traces of
his revolutionary character—he describes him as feeling more pity
than remorse—and he seems to forget, in thus identifying himself
with his hero, that he has at first represented Basville, and perhaps
without foundation, as an infidel and a ferocious revolutionist. The
Basvigliana is, perhaps, more remarkable than any other poem for
the majesty of its verse, the sublimity of its expression, and the
richness of its colouring. In the first canto the spirit of Basville thus
takes leave of the body:—