Download ebooks file Reactive Programming with Kotlin First Edition Learn Rx with RxJava RxKotlin and RXAndroid Alex Sullivan all chapters
Download ebooks file Reactive Programming with Kotlin First Edition Learn Rx with RxJava RxKotlin and RXAndroid Alex Sullivan all chapters
com
https://textbookfull.com/product/reactive-programming-with-
kotlin-first-edition-learn-rx-with-rxjava-rxkotlin-and-
rxandroid-alex-sullivan/
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/kotlin-apprentice-second-edition-
beginning-programming-with-kotlin-irina-galata/
textboxfull.com
https://textbookfull.com/product/reactive-programming-with-
javascript-1st-edition-hayward-jonathan/
textboxfull.com
Programming Kotlin Applications Building Mobile and Server
Side Applications with Kotlin 1st Edition Brett Mclaughlin
https://textbookfull.com/product/programming-kotlin-applications-
building-mobile-and-server-side-applications-with-kotlin-1st-edition-
brett-mclaughlin/
textboxfull.com
https://textbookfull.com/product/programming-android-with-kotlin-
achieving-structured-concurrency-with-coroutines-pierre-olivier-
laurence/
textboxfull.com
https://textbookfull.com/product/rxswift-reactive-programming-with-
swift-1st-edition-florent-pillet/
textboxfull.com
https://textbookfull.com/product/rxswift-reactive-programming-with-
swift-third-edition-raywenderlich-tutorial-team/
textboxfull.com
Notice of Rights
All rights reserved. No part of this book or corresponding materials (such as text,
images, or source code) may be reproduced or distributed by any means without prior
written permission of the copyright owner.
Notice of Liability
This book and all corresponding materials (such as source code) are provided on an “as
is” basis, without warranty of any kind, express of implied, including but not limited to
the warranties of merchantability, fitness for a particular purpose, and
noninfringement. In no event shall the authors or copyright holders be liable for any
claim, damages or other liability, whether in action of contract, tort or otherwise,
arising from, out of or in connection with the software or the use of other dealing in the
software.
Trademarks
All trademarks and registered trademarks appearing in this book are the property of
their own respective owners.
raywenderlich.com 2
Reactive Programming with Kotlin
Dedications
"To my wonderful partner Pallavi, without whom I would have never
been able to start this undertaking. Your support and encouragement
mean the world to me."
— Alex Sullivan
raywenderlich.com 3
Reactive Programming with Kotlin
Vijay Sharma is the final pass editor of this book. Vijay is a husband,
a father and a senior mobile engineer. Based out of Canada's capital,
Vijay has worked on dozens of apps for both Android and iOS. When
not in front of his laptop, you can find him in front of a TV, behind a
book, or chasing after his kids. You can reach out to him on Twitter
@vijaysharm or on LinkedIn @vijaysharm
Manda Frederick is the editor of this book. She has been involved in
publishing for over ten years through various creative, educational,
medical and technical print and digital publications, and is thrilled to
bring her experience to the raywenderlich.com family as Managing
Editor. In her free time, you can find her at the climbing gym,
backpacking in the backcountry, hanging with her dog, working on
poems, playing guitar and exploring breweries.
raywenderlich.com 4
Reactive Programming with Kotlin
Ellen Shapiro is a tech editor for this book. Ellen is an iOS developer
for Bakken & Bæck's Amsterdam office who also occasionally writes
Android apps. She has worked in her spare time to help bring iOS
songwriting app Hum to life. She’s also developed several
independent applications through her personal company, Designated
Nerd Software. When she's not writing code, she's usually tweeting
about it at @DesignatedNerd.
raywenderlich.com 5
Reactive Programming with Kotlin
raywenderlich.com 6
Reactive Programming with Kotlin
Acknowldegments
We'd also like to thank the RxSwift: Reactive Programming with Swift authors, whose
work served as the basis for parts of this book:
• Scott Gardner has been developing iOS apps since 2010, Swift since the day it was
announced, and RxSwift since before version 1. He's authored several video courses,
tutorials, and articles on iOS app development, presented at numerous conferences,
meetups, and online events, and this is his second book. Say hello to Scott on Twitter
at @scotteg.
• Junior Bontognali has been developing on iOS since the first iPhone and joined the
RxSwift team in the early development stage. Based in Switzerland, when he's not
eating cheese or chocolate, he's doing some cool stuff in the mobile space, without
denying to work on other technologies. Other than that he organizes tech events,
speaks and blogs. Say hello to Junior on Twitter at @bontoJR.
• Florent Pillet has been developing for mobile platforms since the last century and
moved to iOS on day 1. He adopted reactive programming before Swift was
announced and has been using RxSwift in production since 2015. A freelance
developer, Florent also uses Rx on Android and likes working on tools for developers
like the popular NSLogger when he's not contracting for clients worldwide. Say hello
to Florent on Twitter at @fpillet.
• Marin Todorov is one of the founding members of the raywenderlich.com team and
has worked on seven of the team's books. Besides crafting code, Marin also enjoys
blogging, teaching, and speaking at conferences. He happily open-sources code. You
can find out more about Marin at www.underplot.com.
raywenderlich.com 7
Reactive Programming with Kotlin
raywenderlich.com 8
Reactive Programming with Kotlin
raywenderlich.com 9
Reactive Programming with Kotlin
Chapter 2: Observables . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
What is an observable? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Lifecycle of an observable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Creating observables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Subscribing to observables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Disposing and terminating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
The create operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Creating observable factories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Using other observable types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
raywenderlich.com 10
Reactive Programming with Kotlin
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Chapter 3: Subjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
What are subjects? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Working with publish subjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Working with behavior subjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Working with replay subjects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Working with async subjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Working with the RxRelay library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
raywenderlich.com 11
Reactive Programming with Kotlin
raywenderlich.com 12
Reactive Programming with Kotlin
raywenderlich.com 13
Reactive Programming with Kotlin
raywenderlich.com 14
Reactive Programming with Kotlin
raywenderlich.com 15
Reactive Programming with Kotlin
raywenderlich.com 16
Reactive Programming with Kotlin
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
raywenderlich.com 17
L Book License
By purchasing Reactive Programming with Kotlin, you have the following license:
• You are allowed to use and/or modify the source code in Reactive Programming with
Kotlin in as many apps as you want, with no attribution required.
• You are allowed to use and/or modify all art, images and designs that are included in
Reactive Programming with Kotlin in as many apps as you want, but must include this
attribution line somewhere inside your app: “Artwork/images/designs: from Reactive
Programming with Kotlin, available at www.raywenderlich.com”.
• The source code included in Reactive Programming with Kotlin is for your personal use
only. You are NOT allowed to distribute or sell the source code in Reactive
Programming with Kotlin without prior authorization.
• This book is for your personal use only. You are NOT allowed to sell this book
without prior authorization, or distribute it to friends, coworkers or students; they
would need to purchase their own copies.
All materials provided with this book are provided on an “as is” basis, without warranty
of any kind, express or implied, including but not limited to the warranties of
merchantability, fitness for a particular purpose and noninfringement. In no event shall
the authors or copyright holders be liable for any claim, damages or other liability,
whether in an action or contract, tort or otherwise, arising from, out of or in connection
with the software or the use or other dealings in the software.
All trademarks and registered trademarks appearing in this guide are the properties of
their respective owners.
raywenderlich.com 18
B Book Source Code &
Forums
This book comes with the source code for the starter and completed projects for each
chapter. These resources are shipped with the digital edition you downloaded from
https://store.raywenderlich.com/products/reactive-programming-with-kotlin.
We’ve also set up an official forum for the book at forums.raywenderlich.com. This is a
great place to ask questions about the book or to submit any errors you may find.
raywenderlich.com 19
W What You Need
To follow along with the tutorials in this book, you’ll need the following:
• IntelliJ IDEA Community 2019.1 or later: IntelliJ IDEA is the IDE upon which
Android Studio is based, and it's used in the book to look at pure Kotlin projects that
demonstrate techniques in RxJava. You can download the latest version of IntelliJ
IDEA Community for free here: https://www.jetbrains.com/idea/
• JDK 8 or later: You'll need a Java Development Kit installed for use with IntelliJ
IDEA projects (Android Studio will use its own version of the JDK). You can download
the Oracle JDK from here: https://www.oracle.com/technetwork/java/javase/
downloads/index.html
• Android Studio 3.3.2 or later: Android Studio is the main development tool for
Android. You can download the latest version of Android Studio for free here:
https://developer.android.com/studio
All the Android sample projects in this book will work just fine in an Android emulator
bundled with Android Studio, or you can also use a physical Android device.
raywenderlich.com 20
B Book Updates
Since you’ve purchased the digital edition version of this book, you get free access to
any updates we may make to the book!
The best way to get update notifications is to sign up for our monthly newsletter. This
includes a list of the tutorials that came out on raywenderlich.com that month, any
important news like book updates or new books, and a list of our favorite iOS
development links for that month. You can sign up here:
• www.raywenderlich.com/newsletter
raywenderlich.com 21
A About the Cover
The common starling, pictured on the cover of this book, seems just that: common. It
isn't particularly large — roughly only 8 inches long. It isn't particularly musical and is
considered noisy in flocks and communal roosts. It's also not particularly beautiful,
with dark glossy feathers and a subtle metallic sheen.
And, yet, this simple bird continues to hold our attention, even being referenced in
literature as early as Shakespeare. Why?
First, it has a talent for mimicry and, like the reactive sensibilities explored in this book,
is highly responsive to its environment. It has up to 20 distinct imitations of other
birds, and it is even known to mimic ringing phones and car alarms.
While we can't know how these birds evolved to this level of cooperation and
responsiveness, we hope to draw some inspiration from them in this book as we guide
you through developing your own reactive programming.
raywenderlich.com 22
Section I: Getting Started with
RxJava
In this part of the book, you’re going to learn about the basics of RxJava. You are going
to have a look at what kinds of asynchronous programming problems RxJava addresses,
and what kind of solutions it offers.
Further, you will learn about the few basic classes that allow you to create and observe
event sequences, which are the foundation of the Rx framework.
You are going to start slow by learning about the basics and a little bit of theory. Please
don't skip these chapters! This will allow you to make good progress in the following
sections when things get more complex.
Chapter 2: Observables
Chapter 3: Subjects
raywenderlich.com 23
1 Chapter 1: Hello, RxJava!
By Alex Sullivan & Marin Todorov
This book aims to introduce you, the reader, to the RxJava, RxKotlin and RxAndroid
libraries and to writing reactive Android apps with Kotlin.
However, just because RxJava doesn't need to be completely rewritten to work in Kotlin
doesn't mean that it couldn't benefit from all of the great features in the Kotlin
programming language.
That's where RxKotlin comes into play. RxKotlin is a library that expands RxJava by
adding a ton of utilities and extension methods that make working with RxJava much
more pleasant in Kotlin. However, you absolutely do not need RxKotlin to use the
RxJava library in a Kotlin-based Android app.
raywenderlich.com 24
Reactive Programming with Kotlin Chapter 1: Hello, RxJava!
That’s the goal of this book: to gradually introduce you to the various RxJava APIs and
Rx concepts by explaining how to use each of the APIs, and then covering their
practical usage in Android apps.
You’ll start with the basic features of RxJava, and then gradually work through
intermediate and advanced topics. Taking the time to exercise new concepts
extensively as you progress will make it easier to master RxJava by the end of the book.
Rx is too broad of a topic to cover completely in a single book; instead, we aim to give
you a solid understanding of the library so that you can continue developing Rx skills
on your own.
We still haven’t quite established what RxJava is though, have we? Start with a simple,
understandable definition and progress to a better, more expressive one as we waltz
through the topic of reactive programming later in this chapter.
As an Android app developer, this should be much more clear and tell you more about
what RxJava is, compared to the first definition you read earlier in this chapter.
Even if you’re still fuzzy on the details, it should be clear that RxJava helps you write
asynchronous code. And you know that developing good, deterministic, asynchronous
code is hard, so any help is quite welcome!
raywenderlich.com 25
Reactive Programming with Kotlin Chapter 1: Hello, RxJava!
Introduction to asynchronous
programming
If you tried to explain asynchronous programming in a simple, down-to-earth
language, you might come up with something along the lines of the following:
An Android app, at any moment, might be doing any of the following things and more:
• Playing audio
All of these things seemingly happen at the same time. Whenever the keyboard
animates out of the screen, the audio in your app doesn’t pause until the animation has
finished, right?
All the different bits of your program don’t block each other’s execution. Android offers
you several different APIs that allow you to perform different pieces of work on
different threads and perform them across the different cores of the device’s CPU.
Writing code that truly runs in parallel, however, is rather complex, especially when
different bits of code need to work with the same pieces of data. It’s hard to determine
which piece of code updates the data first or which code has read the latest value.
• AsyncTask: To do some work on the background and then update elements in your UI
with the result of that background work. You have to make sure to properly handle
cancelling a running AsyncTask when your Activity or Fragment shuts down, since
you could otherwise get a NullPointerException when the AsyncTask tries to update
UI elements that don't exist anymore.
raywenderlich.com 26
Reactive Programming with Kotlin Chapter 1: Hello, RxJava!
• Thread: To start background work in a purely Java way without interacting with any
Android APIs. Threads come with the downside of being expensive and not bound to
any sort of ThreadPool.
• Future: To clearly chain work which will complete at some undetermined point in
the future. Futures are considerably clearer to use than AsyncTasks, but run into
some of the same problems around null pointers when a Fragment or Activity has
been destroyed.
The above isn't an exhaustive list — there's also Handler, JobScheduler, WorkManager,
HandlerThread and Kotlin coroutines.
Many comparisons have been made between using RxJava and using coroutines for
Android development. Each review will give you a different answer about which tool
you should use.
If you're simply looking for an easy way to replace AsyncTask, then coroutines may
make more sense than pulling RxJava into your application. However, if you do want to
move towards a reactive, event-driven architecture, then RxJava is your best bet!
raywenderlich.com 27
Reactive Programming with Kotlin Chapter 1: Hello, RxJava!
After all, your app’s code runs differently depending on various external factors, such as
user input, network activity, or other OS events. Each time the user fires up your app,
the code may run in a completely different order depending on those external factors.
(Well, except for the case when you have an army of robots testing your app, then you
can expect all events to happen with precise, kill-bot synchronization.)
We’re definitely not saying that writing good asynchronous code is impossible. After all,
there's a litany of tools — like the ones listed above — that Android developers have
been using to write asynchronous apps since well before RxJava hit the scene.
The issue is that complex asynchronous code becomes very difficult to write in part
because of the variety of APIs that you as an Android developer will end up using:
You may be using an AsyncTask to update your UI, an IntentService to save something
to a database, a WorkManager task to sync your app to a server, and other various
asynchronous APIs. Since there is no universal language across all the asynchronous
APIs, reading and understanding the code, and reasoning about its execution, becomes
difficult.
To wrap up this section and put the discussion into a bit more context, you’ll compare
two pieces of code: one synchronous and one asynchronous.
Synchronous code
Performing an operation for each element of a list is something you’ve done plenty of
times. It’s a very simple yet solid building block of app logic because it guarantees two
things: It executes synchronously, and the collection is immutable from the outside
world while you iterate over it.
raywenderlich.com 28
Reactive Programming with Kotlin Chapter 1: Hello, RxJava!
Take a moment to think about what this implies. When you iterate over a collection,
you don’t need to check that all elements are still there, and you don’t need to rewind
back in case another thread inserts an element at the start of the collection. You
assume you always iterate over the collection in its entirety at the beginning of the loop.
If you want to play a bit more with these aspects of the for loop, try this in an app or
IntelliJ IDEA project:
Is list mutable inside the for body? Does the collection that the loop iterates over ever
change? What’s the sequence of execution of all commands? Can you modify number if
you need to? You may be surprised by what you see if you run this code.
Asynchronous code
Consider similar code, but assume each iteration happens as a reaction to a click on a
button. As the user repeatedly clicks on the button, the app prints out the next element
in a list:
if (currentIndex != list.lastIndex) {
currentIndex++
}
}
Think about this code in the same context as you did for the previous one. As the user
clicks the button, will that print all of the list's elements? You really can’t say. Another
piece of asynchronous code might remove the last element, before it’s been printed.
Or another piece of code might insert a new element at the start of the collection after
you’ve moved on.
Also, you assume only that the click listener will ever change currentIndex, but another
piece of code might modify currentIndex as well — perhaps some clever code you
added at some point after crafting the above function.
You’ve likely realized that some of the core issues with writing asynchronous code are:
a) the order in which pieces of work are performed and b) shared mutable data.
raywenderlich.com 29
Exploring the Variety of Random
Documents with Different Content
“It is small, as you see,” remarked Mrs. Colonel Norcott deprecatingly;
“but I hope you’ll be comfortable. House-rent is uncommonly dear in
London in the season—and the Colonel likes to have everything
comfortable—and so much expense coming on, you know.”
She spoke the last words in a kind of confidential whisper, throwing a
degree of playful significance over the implied suggestion. Honor, who did
not know, but who felt that there was a dessus les cartes, could only look
with a slightly puzzled air at her mysterious hostess; whereupon that lady,
with what was intended for a pretty air of confusion, said:
“Another time, when we know each other better, being both matrons—
there need be no secrets between us. Ah, I see, there is hot water—the girl
of the house is generally so careless—you will come down when you are
ready. The Colonel is particular about his hours: so don’t be long, there’s a
dear. The Colonel always goes to his club after dinner, and you wouldn’t
like to keep him waiting. Can I do anything for you? No. Well, then, I will
leave you to beautify;” and so saying, Mrs. Norcott betook herself to her
own, namely, the adjoining and equally unprepossessing-looking sleeping
chamber.
Honor sat down on the edge of her narrow iron bedstead, and felt for the
moment like one dazed. All that during the last hour had occurred was so
widely different from her previous imaginings. Where was the sick-room,
the wasted invalid, the atmosphere of physic-bottles and of gloom? Instead,
had she not been received with chaff and cheerfulness? Was not her father
in apparently perfect health? And already, simultaneously almost with her
arrival, had not a visitor appeared, an intimacy with whom her conscience
warned her had better be avoided, and regarding whom, as she was well
aware, her mother-in-law had already thrown out hints as uncalled for as
they were offensive? And then, closely following on these mental
communings, there came the more searching questions of, “What would
John think of all this mean deceit? Would he not, in his indignation at the
trick, instantaneously require her return?” Instantaneously? Yes! Honor felt
well assured of that; John Beacham was the last man in the world to suffer
patiently such a deception as had been practised upon him. He hated—of
that too his wife was well aware—the man who had deceived him, with as
much of rancorous feeling as he was capable of entertaining; and therefore
any further sojourn on her part under her father’s roof would, were John to
become cognisant of the truth, have been indignantly protested against. But,
on the other hand, Honor herself, though aware that she had been lured
under a false presence to Stanwick-street, was by no means disposed to
disclose this fact to one so deeply interested as was John in all that so nearly
concerned her safety and well-being. She was conscious, on the contrary, of
a very decided inclination to remain, for the present at least, where she was.
Of course this inclination—the mere passing of the desire through her heart,
to say nothing of the yielding to it—was wrong, selfish, and unwifely to the
most unpardonable extent. Honor, too, was well aware that she was guilty
in not driving from her, at the very first onslaught, the tempter who assailed
her. There was little excuse, save in the weakness of our most imperfect
human nature, for the taking of this first dearly-bought step in wrong. It cost
but little trouble putting that wrong foot foremost. She had but to be
passive, nothing could be easier, and the affair, one might almost say,
righted itself. But facile as it all had seemed, and scarcely out of the
common order of things, the time came when that poor weak woman would
have given all of life that remained to her, could she have, by so doing,
annulled the decision of a moment, and thus averted all the terrible
consequences that followed thereupon.
She would not write—so Honor, with very little hesitation, decided—to
inform John Beacham that her father was well in health, and that her longer
stay in London was uncalled for. It was wonderful, whilst acting thus, how
many specious arguments she made use of to persuade herself that she was
less guilty than she seemed. No one could imagine—so she told herself
(sitting before the small painted mirror, with her fair hair hanging loosely
about her neck and shoulders)—no one could by any possibility imagine
that she could be there for her own pleasure. Such a wretched room as they
had given her! Room, indeed! Would anyone in his or her senses at
Peartree-house have called that closet of a place by such an inappropriate
name? And then her father, though his bodily health was acknowledged to
be satisfactory, yet betrayed, in Honor’s opinion, evident symptoms of a
mind ill at ease at least, if not diseased. His pecuniary affairs, too, struck his
inexperienced daughter as being in no flourishing condition. The smallness
and mesquinerie of the house (a part of which only was occupied by her
relations); the absence of a man-servant—for Honor had picked up a good
deal of the knowledge of “life” from the pages of three-volume novels; to
say nothing of the dress, cheap though showy, of her hostess, betrayed to
Honor the fact that either money was far less plentiful in her father’s than
her husband’s home, or that penuriousness was a vice indulged in to a large
extent among her newly-found connections.
“If my father were rich and prosperous,” she said to herself—and, to do
her only justice, this ingenious though unconscious sophist firmly believed
in the honesty of her excuses—“if my father were rich and prosperous, I
should act differently, and write at once to tell John he is well. I should
mind in that case less, I think, the making him have a still worse opinion of
my poor father than I know he has at present. If I could hope that John
would make excuses for them, I should know better what to do; but he
would be simply furious. I know that he would never have let me come, if
he had not believed that my father was suffering from the effects of that
horrid blow; and perhaps, after all, he was; and besides, if he did make the
worst of his illness for the purpose of having me with him, where was the
mighty harm? It only shows that my poor father loves me,” added Honor,
sadly, to the wilful tender little heart, which was, alas, so likely to be led
astray by its own warm womanly impulses.
It was with such false reasonings as these, that Honor persuaded herself
to keep the real state of things a secret, pro tem. at least, from her husband.
He would never, she decided—even if he lived to the age of Methuselah—
understand her feelings, or see things (even if she wrote to him about her
father) as she saw them; and so, after sighing a little over her husband’s
small amount of solicitude and comprehension regarding the trifling things
that so much make or mar the happiness of a young and childless woman,
Honor entered on her course of deception. She was interrupted in her
cogitations—cogitations which so materially affected the future happiness
of one who, albeit he wore his heart, as the saying is, on his sleeve, Honor
had proved herself to be so little capable of comprehending—by a hasty
knock from the “girl of the house”—the “young person,” whose back hair
was thrust into a greasy net, and whose upper woman was clothed in a red
Garibaldi that had evidently seen service, which warned the visitor from the
country that by indulging herself in reflection, she was doing the wrong
thing at the wrong time. Dinner was “on table,” as the parlour-maid (to
whom Colonel Fred was in the habit of saying civil things) with no great
show of respect informed her; and Honor, in some trepidation—for she did
not feel exactly at home in her father’s house—hastily put the finishing
touches to her simple toilette, and hurriedly, two steps at a time, in very
unmatronly fashion, descended the many flights of stairs to the drawing-
room. Colonel Norcott was standing on the hearthrug with his back to the
fireless grate, when his daughter entered with an apology on her lips, and a
pretty deprecating smile lighting up her face. Mrs. Norcott had already
taken her seat at the round table, which had been cleared for dinner, and
was gazing with large anxious eyes, anticipative of evil, on the pewter dish-
cover, not one of the brightest specimens of its kind, that graced the simple
board.
“I am so sorry,” Honor was beginning; “I had my trunk to unpack; and
my hair was so tumbled that I was obliged to undo it, and—”
“And you couldn’t have been quicker if you’d done it for a bet,” said the
Colonel good humouredly. “So now for the miserable meal we call dinner.
You’ll wish yourself back at the farm-house, I suspect, when you taste the
nastiness that Mrs. Thingummy treats us with. You get rather different grub
at home—eh, Miss Honor?”
His daughter laughed lightly as she took her place beside him. It amused
her greatly to be called “Miss Honor,” just as if she were a girl. And then he
looked at, and spoke so kindly to her that she was already beginning to feel
at home in the Stanwick-street lodging. With the large-boned, youthfully-
dressed matron, dispensing with an air that was intended to be genteel, the
ill-dressed, London-flavoured whiting from the scantily-filled dish before
her, Honor did not expect to feel much kindred sympathy. Mrs. Norcott
was, however, to judge from external appearances at least, good-natured,
and facile à vivre. If she had ever enjoyed the prestige of being that often
self-reliant and arrogant character yclept an heiress (a fact of the truth of
which Honor began to doubt), there had as yet cropped out no signs either
of a love of domination or a purse-proud spirit. A harmless vanity, joined to
a blind worship for the Colonel, had hitherto struck Honor as the most
distinguishing feature in the Australian lady’s idiosyncrasy.
“If you can eat that stuff it’s more than I can,” said the master of the
house, pushing away his plate with disgust. “You see, my dear child, what it
is to have a father who hasn’t one shilling to rub against another. I—”
“Now, Colonel, I am surprised to hear you talk in this way,” put in his
wife. “There are a precious good many shillings in three hundred pounds a-
year, or I am a good deal more out in my arithmetic than I think I am. The
idea of talking in this way before your daughter! Why, she’ll think she’s
come among beggars, to hear the way you’re going on.”
Fred laughed sardonically. “Not much need to talk about it, I think.
Those horrible whitings fried in black grease render all further explanation
on the subject nugatory. I don’t suppose that any affectation of superfluity is
likely to deceive Mrs. Beacham; and, in my opinion, it is always better to be
plain-spoken. You’ve got a poor devil of a father, my dear child, who finds
it hard enough, I can assure you, to make both ends meet. Of course you
will be uncomfortable here, I expect that; but I do flatter myself that you
won’t throw me over, Honor, because I’m a poor man. I’ve trusted in
women all my life, and never had cause to repent it yet; so here’s your
health, my dear, and may you enjoy health and wealth and happiness long
after your poor old father has been laid under the sod.”
He had taken advantage of Lydia’s momentary absence to utter this
pathetic speech, and as the red Garibaldi was not there to mar by force of
contrast the Colonel’s paternal platitudes, he got through his toast
swimmingly. In another moment, and before Honor’s hand, which had been
lovingly extended to meet her father’s, could be withdrawn, the parlour-
maid, in whose roguish black eyes the “first-floor front” was certainly no
hero, had bounced back into the room, bearing before her a large specimen
of that economical and succulent dish known to housekeepers as a juicy leg
of mutton. Nothing overcome at the sight of this delicacy, Mrs. Norcott
pressed a slice, cut with the gravy in, on Honor’s acceptance.
“What, not a mouthful? Dear me now, how sorry I am! Is there nothing
we could tempt you with? It’s because the mutton’s raw, perhaps, that your
stomach turns a little at it. Lydia, can you get nothing from the larder for
Mrs. John Beacham? That knuckle of ham, now—”
Miss Lydia grinned broadly. “You’ll never see that there mouthful of ’am
again, ’m,” she said pertly, and after the fashion of one accustomed to speak
her mind. “The Kunnle he ate that for his breakfast this morning afore he
went out;” and having so said, she went on briskly with the important duties
of her calling.
To Honor, accustomed as she was to “the land flowing with milk and
honey” of the old farm-house at Updown Paddocks, the state of the
Stanwick-street larder appeared a most deplorable affair indeed. As for her
father—her high-bred, distinguished-looking father, with his delicate
aristocratic hands, his dainty golden sleeve-buttons, and, in her opinion, his
warm paternal heart—she could hardly refrain from tears as she looked
upon his futile efforts to eat the nauseous food that was set before him. She
had not been reared, as we know, in the school of over-refinement, and to
do violence to her own feelings in order to spare the self-love of another
was one of the consequences on an advanced state of civilisation which had
not, as yet, made itself felt in the somewhat arrière parish of Switcham. To
feign an appetite if she had it not was not therefore amongst the small
deceptions which Mrs. Beacham felt called upon to practise, and for that
reason the poor girl rose dinnerless, or, as she would in her ignorance have
called it, supperless, from that untempting board. No sooner had the
energetic Lydia retired, closing the door upon all (save its unwelcome
perfume) that remained of that highly-unsatisfactory repast, than Colonel
Norcott, taking his hat from a side table, announced his intention of going
out.
“Only for an hour or so—just to smoke a cigar in the open,” he said
carelessly. “You’ll be in bed though, Honor, I suppose, before I come back?
Beauty-sleep, eh? We mustn’t lose those country roses sooner than we can
help, or we shall have John looking us up with that stout stick of his. Gad,
how quick he struck, and how it tingled! I can feel it now;” passing his hand
playfully over his forehead. “Took one so deucedly by surprise, you know.
Hadn’t an idea, of course, that he was going to do anything of the kind.
Nothing but a light cane in my hand, talking quietly about old times, when,
without a word, down comes the sledge-hammer, and, by Jove! I was
floored.”
“He was very sorry afterwards, indeed he was,” Honor said pleadingly.
“I have heard him say so often. He hardly knew what he did. If he had not
been sorry, he would never have let me leave the Paddocks to-day.”
“Wouldn’t he?” chucking her under the chin. “Looks sharp after his
pretty wife, eh? But as to being sorry, I can believe as much of that as I like.
If he had been, he would have answered a letter that I wrote to him some
time ago about Rough Diamond; but as he didn’t,” and a very vindictive
expression flitted across his bearded face, “I know what to think, and, what
is more, shall probably act upon the conviction I have come to.”
Honor could only look her surprise at this wholly unexpected outburst.
Before, however, she could utter a syllable in extenuation of her husband’s
sin against politeness, Colonel Norcott had taken his departure, leaving her
to spend the hours till welcome bedtime came in listening to the
uncongenial gossip of the woman whose society was by himself so
evidently unprized. Honor’s first experience of genteel life in London was
certainly neither an amusing nor an instructive one.
CHAPTER XXII.
FAST DOWNHILL.
Honor’s first letter to her husband—which she despatched the day but one
after she left the Paddocks—was not written without a considerable amount
of thought and caution. It was not in this young creature’s nature to be false.
On the contrary, deceit hung like a chain of lead upon her mind—a chain
that was heavy and galling, and which, save when she was diverted from
the pain it caused her by the excitement of dissipation, of Arthur Vavasour’s
society, and, alas, by the admiration of which this true daughter of Eve well
knew herself to be the object, Honor’s consciousness of her own disloyalty
caused her to feel very thoroughly unhappy and remorseful. Her letter to
John—the first which she had ever addressed to him—caused her even
while she wrote it to blush for shame. In it—while she carefully avoided, or
rather ingeniously glossed over, the subject of her father’s illness—any
acute observer might have perceived that she was in no hurry to return to
Sandyshire. She had found the Colonel better, she wrote; but he was
looking ill, and complained a good deal of his head. (This, in Honor’s
defence, I may remark, was no invention on her part.) Altogether, she felt
she was a comfort to her father. He was in very different circumstances
from what she (Honor) had imagined him to be. Really quite poor, she
almost thought. They had no house, only a small lodging, and they lived
very poorly—so poorly that Honor was quite sure John would not like it at
all; while as for mother she would not be able to exist on the kind of food
that was served up in Stanwick-street. As regarded herself, she was—
though she could bear it very well for a time—extremely uncomfortable. A
little attic at the very top of the house!—an attic with a sloping roof, and no
closet to hang her dresses in, and—But there is no occasion to follow Mrs.
John in her filling up of this her first letter with diatribes against her own
discomfort, and with comparisons (flattering, as she hoped, to the old lady’s
pride) between the wretchedness of the furniture and the poverty-stricken
nature of the food in Stanwick-street, and the luxuries and comforts which
she, the writer, had enjoyed at home. She wound up her letter (a missive in
which she had carefully abstained from any allusion to the amusements,
both present and to come, which were in readiness for her delectation) with
a hope that her father’s health would continue to improve; in which case, in
a fortnight or ten days, perhaps, Colonel Norcott would let her talk of
returning to the Paddocks. Both he and his wife showed her so much
kindness and affection that, however much she would like to be at home
again, she could not think just at present of speaking about her return.
This was the sum and substance of Honor’s letter to her husband, and
now that it has been very frankly laid before the reader, I greatly fear that
his opinion of my poor heroine will not be much raised thereby. Little
enough have I to say in her excuse. She was very human, very womanly;
with the seeds of corruption in her veins, the child of a weak mother and a
wicked father, her infant innocence unshielded by a prayer, the silent
nursery work, the holy secret duties which are a mother’s province, and hers
only to perform, perforce left undone—how can we wonder then that this
child of nature, abandoned to the care of hirelings, and so early transplanted
to a soil in many respects uncongenial, should prove herself to be no better
than hundreds upon hundreds of her sex and age, who, giving up reality for
things hoped for, find to their cost that their foolish discontent has proved
their deadliest bane!
“Well, John, and what is the letter about? She seems to have written
plenty, any way; but I suppose you won’t care to tell me what all that heap
of writing is about;” and Mrs. Beacham, who, as was usual with her at
letter-delivery time, was busily employed in the housewifely and popular
task of concocting strong tea from a not over liberal allowance of the herb,
endeavoured to look as if she were not in the slightest degree interested in
the queries to which she had just given voice.
John, who had just finished his letter, and was proceeding to read it a
second time, in order to render himself thoroughly master of its somewhat
puzzling contents, pushed the delicate and young-lady-like looking epistle
across the table with rather an impatient gesture.
“I don’t know that you’ll be able to make much more of a hand of it than
I can,” he said gruffly, for his heart felt terribly sore, and with men of John
Beacham’s stamp emotion does not manifest itself in an especially tender
fashion. “The man hasn’t much the matter with him, as far as I can
understand; never had, I daresay,” he added under his breath, but his mother
caught the words, and treasured them in her mind for future use.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com