Programming Kotlin Applications Building Mobile and Server Side Applications With Kotlin 1st Edition Brett Mclaughlin
Programming Kotlin Applications Building Mobile and Server Side Applications With Kotlin 1st Edition Brett Mclaughlin
com
https://textbookfull.com/product/programming-kotlin-
applications-building-mobile-and-server-side-applications-
with-kotlin-1st-edition-brett-mclaughlin/
OR CLICK HERE
DOWLOAD EBOOK
https://textbookfull.com/product/kotlin-apprentice-second-edition-
beginning-programming-with-kotlin-irina-galata/
textbookfull.com
https://textbookfull.com/product/building-web-and-mobile-arcgis-
server-applications-with-javascript-lewin/
textbookfull.com
https://textbookfull.com/product/spring-boot-up-and-running-building-
cloud-native-java-and-kotlin-applications-mark-heckler/
textbookfull.com
https://textbookfull.com/product/programming-kotlin-enhance-your-
skills-for-android-development-using-kotlin-2nd-edition-alexander-
aronowitz/
textbookfull.com
https://textbookfull.com/product/exploring-blazor-creating-hosted-
server-side-and-client-side-applications-with-c-taurius-litvinavicius/
textbookfull.com
https://textbookfull.com/product/programming-android-with-kotlin-
achieving-structured-concurrency-with-coroutines-pierre-olivier-
laurence/
textbookfull.com
PROGRAMMING
KOTLIN® APPLICATIONS
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Programming Kotlin® Applications
Programming Kotlin® Applications
BUILDING MOBILE AND SERVER-SIDE
APPLICATIONS WITH KOTLIN
Brett McLaughlin
Copyright © 2021 by John Wiley & Sons, Inc., Indianapolis, Indiana
ISBN: 978-1-119-69618-6
ISBN: 978-1-119-69616-2 (ebk)
ISBN: 978-1-119-69621-6 (ebk)
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means,
electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of
the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through
payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923,
(978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions
Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online
at www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect
to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without
limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional
materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the
understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional
assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author
shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation
and/or a potential source of further information does not mean that the author or the publisher endorses the information the
organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web
sites listed in this work may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the United
States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard
print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD
or DVD that is not included in the version you purchased, you may download this material at booksupport.wiley.
com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2020947753
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are
trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other
countries, and may not be used without written permission. Kotlin is a registered trademark of Kotlin Foundation. All other
trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or
vendor mentioned in this book.
for Leigh, as always, my person
ABOUT THE AUTHOR
BRETT MCLAUGHLIN has been working and writing in the technology space for over 20 years. Today,
Brett’s focus is squarely on cloud and enterprise computing. He has quickly become a trusted name
in helping companies execute a migration to the cloud—and in particular Amazon Web Services—by
translating confusing cloud concepts into a clear executive-level vision. He spends his days working
with key decision makers who need to understand the cloud as well as leading and building teams of
developers and operators who must interact with the ever-changing cloud computing space. He has
most recently led large-scale cloud migrations for NASA’s Earth Science program and the RockCreek
Group’s financial platform. Brett is currently the Chief Technology Officer at Volusion, an ecommerce
platform provider.
ABOUT THE TECHNICAL EDITOR
JASON LEE is a software developer happily living in the middle of the heartland. He has over 23 years
of experience in a variety of languages, writing software running on mobile devices all the way up
to big iron. For the past 15+ years, he has worked in the Java/Jakarta EE space, working on applica-
tion servers, frameworks, and user-facing applications. These days, he spends his time working as a
backend engineer, primarily using Kotlin, building systems with frameworks like Quarkus and Spring
Boot. He is the author of Java 9 Programming Blueprints, a former Java User Group president, an
occasional conference speaker, and a blogger. In his spare time, he enjoys spending time with his wife
and two sons, reading, playing the bass guitar, and running. He can be found on Twitter at twitter
.com/jasondlee, and on his blog at jasondl.ee.
ACKNOWLEDGMENTS
I USED TO WATCH MOVIES AND STARE in amazement at the hundreds of names that scrolled by at
the end. How could so many people be involved in a single movie?
Then I wrote a book. Now I understand.
Carole Jelen is my agent at Waterside, and she replied to an email and picked up the phone at a time
when I really needed someone to help me find my way back into publishing. I’m incredibly grateful.
On the Wiley side, Brad Jones was more patient than he ever should have been. Thanks, Brad! Barath
Kumar Rajasekaran handled a million tiny details, and Pete Gaughan and Devon Lewis kept the train
on the tracks. Christine O’Connor handled production, and Jason Lee caught the technical mistakes
in the text that you wouldn’t want to stumble over. Seriously, Jason in particular made this a much
better book with his keen eye.
As usual, it’s an author’s family that pays the highest price. Long days, more than a few weekends and
evenings, and a constant support keep us going. My wife, Leigh, is the best, and my kids, Dean, Rob-
bie, and Addie, always make finishing one of these a joy.
Let’s do brunch, everyone! Mimosas and breakfast tacos are on me.
—Brett McLaughlin
CONTENTS
INTRODUCTION xxv
xvi
Contents
xvii
Contents
xviii
Contents
xix
Contents
xx
Contents
xxi
Contents
xxii
Contents
xxiii
Contents
INDEX 339
xxiv
INTRODUCTION
For decades, the Java programming language has been the dominant force in compiled languages. While
there have been plenty of alternatives, it’s Java that has remained core to so many applications, from
desktop to server-side to mobile. This has become especially true for Android mobile development.
Finally, though, there is a real contender to at least live comfortably beside Java: Kotlin, a modern
programming language shepherded by JetBrains (www.jetbrains.com). It is not Java, but is com-
pletely interoperable with it. Kotlin feels a lot like Java, and will be easy to learn for developers
already familiar with the Java language, but offers several nice improvements.
Further, Kotlin is a full-blown programming language. It’s not just for mobile applications, or a visual
language that focuses on one specific application. Kotlin supports:
➤➤ Inheritance, interfaces, implementations, and class hierarchies
➤➤ Control and flow structures, both simple and complex
➤➤ Lambdas and scope functions
➤➤ Rich support for generics while still preserving strong typing
➤➤ Idiomatic approaches to development, giving Kotlin a “feel” all its own
You’ll also learn that while Kotlin is a new language, it doesn’t feel particularly new. That’s largely
because it builds upon Java, and doesn’t try to reinvent wheels. Rather, Kotlin reflects lessons that
thousands of programmers coding in Java (and other languages) employ on a daily basis. Kotlin takes
many of those lessons and makes them part of the language, enforcing strong typing and a strict com-
piler that may take some getting used to, but often produces cleaner and safer code.
There’s also an emphasis in Kotlin, and therefore in this book, on understanding inheritance. Whether
you’re using packages from third parties, working with the standard Kotlin libraries, or building your
own programs, you need a solid understanding of how classes interrelate, how subclassing works, and
how to use abstract classes along with interfaces to define behavior and ensure that behavior is imple-
mented. By the time you’re through with this book, you’ll be extremely comfortable with classes,
objects, and building inheritance trees.
The Kotlin website (kotlinlang.org) describes Kotlin as “a modern programming language that
makes developers happier.” With Kotlin and this book, you’ll be happier and more productive in your
Kotlin programming.
Yes, but you’ll need more than just this book to build rich mobile applications in
Kotlin. Kotlin is a rich language, and while there are books on all the packages
needed to build mobile languages, this is fundamentally a book on learning Kotlin
from the ground up. You’ll get a handle on how Kotlin deals with generics, inherit-
ance, and lambdas, all critical to mobile programming.
You can then take these concepts and extend them into mobile programming. You
can easily add the specifics of Android-related packages to your Kotlin base knowl-
edge, and use those mobile packages far more effectively than if you didn’t have the
fundamentals down.
If you are anxious to begin your mobile programming journey sooner, consider
picking up a book focused on Kotlin mobile programming, and hop back and forth.
Read and work through Chapter 1 of this book, and then do the same for the book
focused on mobile programming. You’ll have to context switch a bit more, but you’ll
be learning fundamentals alongside specific mobile techniques.
xxvi
Introduction
Chapter 5: Lists and Sets and Maps, Oh My! This chapter moves away (briefly) from
classes and inheritance to add Kotlin collections to your arsenal. You’ll use these collection
classes over and over in your programming, so understanding how a Set is different from a
Map, and how both are different from a List, is essential. You’ll also dig further into Kotlin
mutability and immutability—when data can and cannot change—as well as a variety of
ways to iterate over collections of all types.
Chapter 6: The Future (in Kotlin) Is Generic Generics are a difficult and nuanced topic in
most programming languages. They require a deep understanding of how languages are built.
This chapter gets into those depths, and provides you more flexibility in building classes that
can be used in a variety of contexts than possible without generics. You’ll also learn about
covariance, contravariance, and invariance. These might not be the hot topics at the water
cooler, but they’ll be key to building programs that use generics correctly, and also level up
your understanding of inheritance and subclassing.
Chapter 7: Flying through Control Structures Control structures are the bread and butter of
most programming languages. This chapter breaks down your options, covering if and else,
when, for, while, and do. Along the way, you’ll focus on controlling the flow of an applica-
tion or set of applications all while getting a handle on the semantics and mechanics of these
structures.
Chapter 8: Data Classes This chapter introduces data classes, another very cool Kotlin
concept. While not specific to only Kotlin, you’ll find that data classes offer you a quick and
flexible option for representing data more efficiently than older languages. You’ll also really
push data classes, going beyond a simple data object and getting into constructors, overriding
properties, and both subclassing with and extending from data classes.
Chapter 9: Enums and Sealed, More Specialty Classes This chapter introduces enums, a far
superior approach to String constants. You’ll learn why using Strings for constant values is
a really bad idea, and how enums give you greater flexibility and type safety, as well as mak-
ing your code easier to write. From enums, you’ll move into sealed classes, a particularly cool
feature of Kotlin that lets you turbo-charge the concept of enums even further. You’ll also dig
into companion objects and factories, all of which contribute to a robust type-safe approach
to programming where previously only String types were used.
Chapter 10: Functions and Functions and Functions It may seem odd to have a chapter this
late in the book that purports to focus on functions. However, as with most fundamentals in
any discipline, you’ll have to revisit the basics over and over again, shoring up weaknesses
and adding nuance. This chapter does just that with functions. You’ll dig more deeply into
just how arguments really work, and how many options Kotlin provides to you in working
with data going into and out of your functions.
Chapter 11: Speaking Idiomatic Kotlin Kotlin, like all programming languages, has certain
patterns of usage that seasoned programmers revert to time and time again. This chapter
discusses these and some of the idioms of Kotlin. You’ll get a jump start on writing Kotlin
that looks like Kotlin is “supposed to” all while understanding how you have a tremendous
amount of flexibility in choosing how to make your Kotlin programs feel like “you.”
xxvii
Discovering Diverse Content Through
Random Scribd Documents
The Speaker being conducted to the Chair, by Mr. Van Cortlandt
and Mr. Alston, addressed the House as follows:
Monday, November 2.
Several other members, to wit: from Massachusetts, Ezekiel Bacon;
from New York, Gurdon S. Mumford; from North Carolina, James
Holland; from Kentucky, Matthew Lyon; and from South Carolina,
Richard Wynn, appeared, produced their credentials, were qualified,
and took their seats in the House.
Thursday, November 5.
Revolutionary Pensions.
Mr. Dana said it was well known, that during the last Congress, an
act was passed for the relief of persons claiming pensions. The
object of the act was, to grant relief to some whose cases were not
embraced by the former act, and to grant an increased allowance to
others who had not, as yet, received sufficient. This act provides for
taking depositions before the district judge, in cases where the
claimants have never been placed on the pension list, as well as for
examination of the claims of those who apply to have their pensions
increased. Whether any compensation should be allowed for issuing
commissions, or for making the examinations required, is not
declared by the act. A difference of practice, he understood, had
taken place. In some cases, commissions were issued gratuitously by
the district judge; in other cases, these poor solicitors were obliged,
from their small pittance, to pay for these services. If any
compensation were to be allowed for this service, he thought it
should be paid from the public treasury. Whatever might be the
mode adopted, he wished it to be fixed by law. For this purpose he
offered the following resolution:
Frigate Chesapeake.
Mr. Quincy said the House would recollect that when in Committee
of the Whole on the state of the Union, some days ago, he
submitted an amendment to a resolution of the gentleman from
Virginia, (Mr. Dawson,) which went to an inquiry into the
circumstances of the attack on the Chesapeake, and the causes
assigned for it, as well as the manner in which it was repelled. At
that time two objections of some apparent validity were urged
against this motion; the one was that it might have an improper
effect upon a pending trial, the other was as to its form. To obviate
these objections, he had modified the resolution, which he should
now offer to the House.
Mr. Q. read his motion, as follows:
Mr. Q. would lay before the House his reasons for offering this
resolution. He could not acquiesce in the course which had been
given to that part of the President’s Message which relates to the
attack on the Chesapeake. He could not reconcile it with the sense
of justice or with the honor of this House. He asked gentlemen to
consider our situation in relation to this subject. A violent attack is
made upon one of our public ships of war, in a manner undeniably
hostile. A great degree of excitement has taken place in the public
mind throughout the continent. Our newspapers have teemed with
every species of information, a part of which has been correct, and a
part incorrect; which has sometimes fallen short of the truth, and
sometimes exceeded it; has been sometimes official, and sometimes
unofficial. In this situation of things, the President of the United
States deemed it wise and prudent to call an extraordinary session
of this Legislature. We are now assembled. He has made a
communication to us, and this attack is a striking feature in it. This is
our situation. What have we done? The House has gone into a
Committee of the Whole, taken up the Message of the President, cut
it up into parts, according to Parliamentary custom; and we have
taken as many of those parts as we pleased and referred them to
particular committees; some of which are a kind of patchwork
committees. In all of these references, notwithstanding it was the
very object which occasioned the early meeting of the present
session, no mention is made of the attack on the Chesapeake. The
committee, which he proposed to instruct on this subject, had what
related to aggressions committed within our ports and waters
submitted to them generally, but they have no compass by which to
steer; no prominent object is placed before them. He could not
reconcile this manner of acting with his duty. He deemed it
necessary to obtain a full development of all the circumstances
relative to this affair, in order that Congress, and the people at large,
may form a correct judgment of our situation. The course adopted is
not the course to gain the information so desirable. It is a course of
Parliamentary ignorance, not a course of development. It is a course
of concealment. He spoke as to the general effect of measures, and
not as to gentlemen’s motives.
He inquired of gentlemen what method they would pursue, if they
wanted to understand any particular subject? Would they not refer it
to a distinct committee, and not mix it up with extraneous matter?
And if you give a committee two or three distinct objects to act
upon, but wish them to attend more especially to one, it is proper to
give them specific instructions to that point. This is the way to come
at the proper understanding of a subject. But, on the contrary, if it
were the wish of any member of this House to promote
concealment, to prevent a knowledge of facts, the way is obvious. It
would be to place three or four subjects together, and to suffer the
committee to which they are referred to act as they please upon
them. We know that committees thus left to themselves, will never
do too much.
It was because the people of the United States wish to know
something on this subject, that he made this motion. It may be said
that this committee have already the power, and that they may
make the necessary inquiries without this instruction. But it is the
duty of this House to be certain that they will do so. Indeed, if the
committee were now proceeding in this inquiry, this would be no
good reason why this motion ought not to be adopted. If, without
being instructed by this House, the committee should report the
facts now called for, the honor of the act would rest upon that
committee; whereas it ought to rest upon this House.
Perhaps it may be said, as on a former occasion, that every man,
woman, and child, in the United States is acquainted with these
facts; but what is known from popular report, or newspaper
information, is not the kind of knowledge we want. We want facts
from the proper authority.
An objection had been made to this course, that it would be
casting a censure upon the committee. Not so; it would be no more
than drawing the attention of an organ of the House to a particular
subject. It may be objected to, because a negotiation is pending;
but what is done by Congress, at this time, can have no effect on a
negotiation carrying on across the Atlantic. The House is at present
calm and tranquil, and this is therefore a proper time to undertake
an investigation of the facts required. Let the negotiation terminate
as it may, we shall never have a fair inquiry into these facts, unless
we enter upon it at present. Suppose, said he, the negotiation has a
favorable issue, and no inquiry has been made, is there a member
present who will say the inquiry would then be entered upon? No, it
would be said to be an old wound, which ought not to be probed,
but forgotten. But suppose, on the other hand, that the negotiation
should be abruptly broken off, and this House should be called upon
to put the nation in hostile array, would that be a proper time for
entering upon the proposed inquiry? Would the House be in a fit
state for deliberating upon the facts required? Indeed, the subject
appeared to him so clear, and the duty to bring forward this motion
so impressive, that he could not refrain from making it.
Mr. Burwell said he had hoped he should have been able to have
satisfied the gentleman from Massachusetts, as to the attention of
the committee to whom this duty was assigned; but after an
expression which had dropped from him, he despaired of doing it.
He would, however, inform the House that the committee to whom
the subject was referred were engaged in a course of investigation
on the very part of it now agitated, and had come to a
determination to obtain, from the proper authority, a correct detail of
the circumstances attending this particular attack; not content with
this, they were about to call on the Government for a detail of all
aggressions that had been committed within our ports and waters.
Mr. Blount said, that, at the moment the gentleman from
Massachusetts had moved this resolution, he was in the committee-
room, in the act of addressing a note to the Secretary of State on
this subject, according to the direction of the committee, calling for a
full and correct statement of all the facts relative to the aggression
committed on the frigate Chesapeake. For the satisfaction of the
gentleman, he would read the note which he had written. [Mr. B.
then opened and read the note.]
British Aggressions.
Mr. Quincy said the House might have observed, that in the
Message of the President of the United States to Congress, delivered
on the 27th of October, there was an express reference to a certain
Proclamation interdicting our ports and harbors to British armed
vessels. It was in Great Britain, he understood, a universal
Parliamentary rule, that proclamations of this kind should be laid
before Parliament; and in this country it had heretofore been the
usual practice. In the case of the Proclamation of Neutrality, issued
by President Washington, in 1793, in his first communication to
Congress, he laid it before them, and it was entered on the Journals.
Circumstances of however great notoriety were not official
information on which they could act; but, were it so, he had not
been able to find it in any papers he could procure. He had expected
it would have been connected with the report of the committee on
aggressions; but, as it was not yet before the House, he moved the
following resolution:
Mr. Crowninshield could not see any necessity for calling for this
paper. He well recollected that the President had issued
proclamations on other subjects which had never been laid before
the House. That issued in the case of an aggression committed by
Captain Whitby, commanding an armed ship of Great Britain, had
not been transmitted to the House; so, in the case of the famous
conspiracy of Mr. Burr, a proclamation was issued at the time, and
not laid before the House, nor had the House thought necessary to
call for these papers. They were before the public, and every
member of the House must have perused them. Mr. C. wished his
colleague to show some necessity for the present call; for he could
see none. The practice which had taken place in other countries was
not to govern them; he might as well have drawn a precedent from
the practice of France, Germany, or any other country, as from Great
Britain. Besides, he doubted whether it was the practice there. It
was well known that, under that Government, the King and Council
legislated in a variety of instances. The citizens of this country had
suffered severely by these measures. They legislated for neutrals in
this way, and property to an immense amount had been taken from
our merchants under these orders, and Mr. C. did not know that
their acts in such cases had been laid before the Parliament, or even
called for. He should, however, have no objection to the call in this
instance, but that he saw no necessity for it. The gentleman might
perhaps not have seen the Proclamation; but it was well known that
it had been published in almost all the papers in the Union. It first
appeared in a paper of this city, and he presumed was copied from
that paper into the others. He had no doubt but the Proclamation
would be communicated, or any other paper that might be called for.
Mr. Alston said it was certainly very immaterial whether the
resolution was adopted or not; but it was certainly causing
considerable trouble for nothing, to submit such a resolution to the
House. The gentleman might have laid his hands on it in any paper
published in the Union. Did that gentleman receive an official copy of
the proclamation for convening Congress at this time? If he did, Mr.
A. said he had an advantage over him; for he saw the Proclamation
in the newspapers, and came on in consequence; and if there had
been any proclamation issued, Mr. Q. could have found it in the
newspapers. He had an objection to this resolution, because it was
going out of the way; he had never before known an instance of a
call upon the President for any proclamation which he had not
thought proper to lay before them.
Mr. Quincy said he had cited the example of Great Britain, because
that was the country from whose Parliamentary practice so many
precedents had been drawn. The Proclamation of President
Washington, however, was published in all the papers on the
continent, and yet the President had laid it before Congress on the
first day of the succeeding session. He would refer to the mode in
which it was presented, in order to convince the House it had been
heretofore done. The case was thus: The President of the United
States, after some prefatory observations, tells them that the
Proclamation laid before the House had been issued. Immediately
after this, the Journal says, a Message was received from the
President of the United States, enclosing a copy of the Proclamation.
The case in the present instance was of much more importance: he
had no conception, before he saw the report of the committee, but
that it would be laid before them; he had not conceived it possible
that it would not be laid before them in some way. It had been said,
that he should give reasons for calling for it. He thought that in an
important case like this the House should know what was done. He
had no objection to the Proclamation; but it contained certain
national principles to which they ought to refer.
He was at a loss to account for the opposition which this motion
received from some quarters of the House; it was impossible it could
be made on any other grounds than a determination to vote down at
all events any question that might be moved, or any inquiry that
might be requested on the part of gentlemen of one description in
the House. It seemed to him to be following up the advice which
had lately been given to them through the channel of a paper
printed in this city, which was understood generally to speak a demi-
official language. I have before me, (said he,) the words in which
this House were a short time since addressed in that paper, by a
person making observations on a motion which Mr. Q. had made,
and which was negatived. Mr. Q. then read the following paragraph
from the National Intelligencer, of November 9:
“Let them weigh well the advice of an enemy before they adopt it.
Let them act as they have done in the present instance. Let them
entertain no apprehensions on the sense of popularity, even though
their adversaries should sound the tocsin of alarm, and declare
themselves in patriotic strains the exclusive friends of the people. Let
them remember that while their opponents have nothing to do but
talk, they have to act.”
Mr. Jones moved that the House should, according to the order of
the day, go into Committee of the Whole on the report in favor of
the petition of Sir James Jay. Agreed to, 18 to 29. The report being
read with the letter from the Secretary of State accompanying it,
Mr. Taylor opposed and Mr. Jones supported it.
The question being taken on concurrence with the report, the
votes were, in favor of it 45, against it 46; there appearing some
doubt whether this decision was correct, a second count was about
to be had, when a debate took place, in which Messrs. Upham, Cook,
Dana, Quincy, loan, and Blackledge, supported, and Messrs. J. Clay,
Gardenier, D. R. Williams, Holland, Taylor, and Burwell opposed the
report.
In support of the report it was urged that the secret mode of
correspondence, for which the petitioner prays a compensation, was
very useful in the Revolutionary War, and no doubt might be again;
that the testimony in favor of the invention was very satisfactory;
that there was on file in the office of the Secretary of State, a letter
written by General Washington in this invisible ink; that Mr. Jay had
never received compensation; that although it had been used by
various persons, none had ever yet known the composition of it but
himself; that the report was only to authorize the President to
purchase this secret if he thought fit, leaving him the judge of its
utility.
Those who opposed the report, argued that it was absurd to vote
away money for a thing they did not and could not understand; that
there never yet was a secret ink made but a composition could be
invented that would bring it out, and that possibly Sir James himself
might know such a composition; that the House had no security
before them that it was not or would not be disclosed to other
Governments as well as this; that if secret correspondence was
wanted, it had from late occurrences appeared that Entick’s
Dictionary and a key word would afford, by writing in cipher,
sufficient secrecy.
In the course of this debate much wit was displayed in speaking
on different modes of keeping secrets, and the futility of all; with
allusions to the secret proceedings of Congress, particularly those
which took place on the 19th instant, which were said to have been
known before the House took them up. Some amusement also arose
amongst the members from the difficulty of hearing each other, and
the consequent mistakes that took place.
The question on concurrence being taken was carried, 50 to 48.
The committee rose and reported to the House their agreement to
the resolution contained therein; which was read, as follows:
Tuesday, December 1.
Mr. Quincy offered the following resolution:
Resolved, That the Secretary of the Department of War be
directed to lay before this House an account of the state of the
fortifications of the respective ports and harbors of the United
States, with a statement of the moneys appropriated for
fortifications remaining unexpended; and an estimate of the sums
necessary for completing such fortifications as may be deemed
requisite for their defence.
Mr. Randolph rose and said, that as long as the subject of national
defence was in possession of a respectable committee of the House,
and as long as their report was pending before it, he had deemed it,
if not improper, at least unavailing in him, to offer any thing upon
that subject. But, that committee having reported, he saw, from the
course which the debate had taken yesterday, a necessity so
pressing that he could no longer dispense with it, for offering some
propositions on this most important subject. These propositions
grew out of the almost universal impression which seemed to exist
that there was but one peculiar mode of defence to which the nation
could turn itself in this perilous juncture of their affairs. When so
great an appropriation was demanded for this favorite expedient, he
feared, that if other plans of defence, which had at least as high
claims to the public attention, were not now brought forward, they
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