0% found this document useful (0 votes)
65 views

Learning React Functional Web Development with React and Redux 1st Edition Alex Banks - The newest ebook version is ready, download now to explore

The document promotes various eBooks available for download on ebookname.com, including titles on React, JavaScript, and other subjects. It highlights the ease of accessing instant digital products in multiple formats. Additionally, it provides links to specific eBooks and mentions the authors and editions of the featured titles.

Uploaded by

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

Learning React Functional Web Development with React and Redux 1st Edition Alex Banks - The newest ebook version is ready, download now to explore

The document promotes various eBooks available for download on ebookname.com, including titles on React, JavaScript, and other subjects. It highlights the ease of accessing instant digital products in multiple formats. Additionally, it provides links to specific eBooks and mentions the authors and editions of the featured titles.

Uploaded by

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

Endless Ebook, One Click Away – Start Downloading at ebookname.

com

Learning React Functional Web Development with


React and Redux 1st Edition Alex Banks

https://ebookname.com/product/learning-react-functional-web-
development-with-react-and-redux-1st-edition-alex-banks/

OR CLICK HERE

DOWLOAD EBOOK

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


Click here to visit ebookname.com and download ebook now
Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Learning React Native Building Native Mobile Apps with


JavaScript 1 (Early Release) Edition Bonnie Eisenman

https://ebookname.com/product/learning-react-native-building-
native-mobile-apps-with-javascript-1-early-release-edition-
bonnie-eisenman/

The Road to React The React js in JavaScript Book 2024


Edition Robin Wieruch

https://ebookname.com/product/the-road-to-react-the-react-js-in-
javascript-book-2024-edition-robin-wieruch/

Learning JavaScript Design Patterns A JavaScript and


React Developer s Guide 2nd Edition Adnan Osmani

https://ebookname.com/product/learning-javascript-design-
patterns-a-javascript-and-react-developer-s-guide-2nd-edition-
adnan-osmani/

Painting Islam as the New Enemy Abdulhay Y. Zalloum

https://ebookname.com/product/painting-islam-as-the-new-enemy-
abdulhay-y-zalloum/
The Ritual Theatre of Theodoros Terzopoulos 1st Edition
Freddy Decreus

https://ebookname.com/product/the-ritual-theatre-of-theodoros-
terzopoulos-1st-edition-freddy-decreus/

A Theory of Language and Mind Ermanno Bencivenga

https://ebookname.com/product/a-theory-of-language-and-mind-
ermanno-bencivenga/

Dialectical Behavior Therapy for Wellness and Recovery


Interventions and Activities for Diverse Client Needs
1st Edition Andrew Bein

https://ebookname.com/product/dialectical-behavior-therapy-for-
wellness-and-recovery-interventions-and-activities-for-diverse-
client-needs-1st-edition-andrew-bein/

Applied Mathematical Methods in Theoretical Physics 2ed


Edition Masujima M.

https://ebookname.com/product/applied-mathematical-methods-in-
theoretical-physics-2ed-edition-masujima-m/

Jacques Lacan and Education A Critical Introduction 1st


Edition Donyell L. Roseboro

https://ebookname.com/product/jacques-lacan-and-education-a-
critical-introduction-1st-edition-donyell-l-roseboro/
Small Space Organizing 3rd Edition Kathryn Bechen

https://ebookname.com/product/small-space-organizing-3rd-edition-
kathryn-bechen/
Learning React
Functional Web Development
with React and Redux

Alex Banks and Eve Porcello

Beijing Boston Farnham Sebastopol Tokyo


Learning React
by Alex Banks and Eve Porcello
Copyright © 2017 Alex Banks and Eve Porcello. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles (http://oreilly.com/safari). For more information, contact our corporate/insti‐
tutional sales department: 800-998-9938 or [email protected].

Editor: Allyson MacDonald Indexer: WordCo Indexing Services


Production Editor: Melanie Yarbrough Interior Designer: David Futato
Copyeditor: Colleen Toporek Cover Designer: Karen Montgomery
Proofreader: Rachel Head Illustrator: Rebecca Demarest

May 2017: First Edition

Revision History for the First Edition


2017-04-26: First Release

See http://oreilly.com/catalog/errata.csp?isbn=9781491954621 for release details.

The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Learning React, the cover image, and
related trade dress are trademarks of O’Reilly Media, Inc.
While the publisher and the authors have used good faith efforts to ensure that the information and
instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility
for errors or omissions, including without limitation responsibility for damages resulting from the use of
or reliance on this work. Use of the information and instructions contained in this work is at your own
risk. If any code samples or other technology this work contains or describes is subject to open source
licenses or the intellectual property rights of others, it is your responsibility to ensure that your use
thereof complies with such licenses and/or rights.

978-1-491-95462-1
[LSI]
Table of Contents

Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix

1. Welcome to React. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Obstacles and Roadblocks 1
React Is a Library 2
New ECMAScript Syntax 2
Popularity of Functional JavaScript 2
JavaScript Tooling Fatigue 2
Why React Doesn’t Have to Be Hard to Learn 3
React’s Future 3
Keeping Up with the Changes 4
Working with the Files 4
File Repository 4
React Developer Tools 5
Installing Node.js 6

2. Emerging JavaScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Declaring Variables in ES6 10
const 10
let 10
Template Strings 12
Default Parameters 13
Arrow Functions 14
Transpiling ES6 17
ES6 Objects and Arrays 19
Destructuring Assignment 19
Object Literal Enhancement 20
The Spread Operator 22

iii
Promises 24
Classes 25
ES6 Modules 27
CommonJS 28

3. Functional Programming with JavaScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31


What It Means to Be Functional 32
Imperative Versus Declarative 34
Functional Concepts 36
Immutability 36
Pure Functions 38
Data Transformations 41
Higher-Order Functions 48
Recursion 49
Composition 52
Putting It All Together 54

4. Pure React. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Page Setup 59
The Virtual DOM 60
React Elements 62
ReactDOM 64
Children 65
Constructing Elements with Data 67
React Components 68
React.createClass 69
React.Component 72
Stateless Functional Components 73
DOM Rendering 74
Factories 77

5. React with JSX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81


React Elements as JSX 81
JSX Tips 82
Babel 84
Recipes as JSX 85
Intro to Webpack 93
Webpack Loaders 94
Recipes App with a Webpack Build 94

6. Props, State, and the Component Tree. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109


Property Validation 109

iv | Table of Contents
Validating Props with createClass 110
Default Props 114
Custom Property Validation 115
ES6 Classes and Stateless Functional Components 116
Refs 119
Inverse Data Flow 121
Refs in Stateless Functional Components 123
React State Management 123
Introducing Component State 124
Initializing State from Properties 128
State Within the Component Tree 130
Color Organizer App Overview 130
Passing Properties Down the Component Tree 131
Passing Data Back Up the Component Tree 134

7. Enhancing Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141


Component Lifecycles 141
Mounting Lifecycle 142
Updating Lifecycle 146
React.Children 157
JavaScript Library Integration 158
Making Requests with Fetch 159
Incorporating a D3 Timeline 160
Higher-Order Components 166
Managing State Outside of React 172
Rendering a Clock 173
Flux 174
Views 176
Actions and Action Creators 177
Dispatcher 177
Stores 178
Putting It All Together 179
Flux Implementations 180

8. Redux. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
State 184
Actions 187
Action Payload Data 189
Reducers 190
The Color Reducer 193
The Colors Reducer 195
The Sort Reducer 197

Table of Contents | v
The Store 198
Subscribing to Stores 201
Saving to localStorage 202
Action Creators 203
Middleware 206
Applying Middleware to the Store 207

9. React Redux. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211


Explicitly Passing the Store 213
Passing the Store via Context 216
Presentational Versus Container Components 220
The React Redux Provider 223
React Redux connect 224

10. Testing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229


ESLint 229
Testing Redux 233
Test-Driven Development 233
Testing Reducers 234
Testing the Store 242
Testing React Components 245
Setting Up the Jest Environment 245
Enzyme 247
Mocking Components 249
Snapshot Testing 258
Using Code Coverage 262

11. React Router. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273


Incorporating the Router 274
Router Properties 277
Nesting Routes 279
Using a Page Template 279
Subsections and Submenus 281
Router Parameters 286
Adding Color Details Page 286
Moving Color Sort State to Router 292

12. React and the Server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297


Isomorphism versus Universalism 297
Server Rendering React 301
Universal Color Organizer 306
Universal Redux 308

vi | Table of Contents
Universal Routing 310
Communicating with the Server 318
Completing Actions on the Server 318
Actions with Redux Thunks 321

Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

Table of Contents | vii


Preface

This book is for developers who want to learn the React library while learning the
latest techniques currently emerging in the JavaScript language. This is an exciting
time to be a JavaScript developer. The ecosystem is exploding with new tools, syntax,
and best practices that promise to solve many of our development problems. Our aim
with this book is to organize these techniques, so you can get to work with React right
away. We’ll get into Redux, React Router, and build tooling, so we promise not to
introduce only the basics and then throw you to the wolves.
This book does not assume any knowledge of React at all. We’ll introduce all of
React’s basics from scratch. Similarly, we won’t assume that you’ve worked with ES6
or any of the latest JavaScript syntax. This will be introduced in Chapter 2 as founda‐
tion for the rest of the chapters.
You’ll be better prepared for the contents of the book if you’re comfortable with
HTML, CSS, and JavaScript. It’s almost always best to be comfortable with these big
three before diving into a JavaScript library.
Along the way, check out the GitHub repository. All of the examples are there and
will allow you to practice with hands-on examples.

Conventions Used in This Book


The following typographical conventions are used in this book:
Italic
Indicates new terms, URLs, email addresses, filenames, and file extensions.
Constant width
Used for program listings, as well as within paragraphs to refer to program ele‐
ments such as variable or function names, databases, data types, environment
variables, statements, and keywords.

ix
Constant width bold
Shows commands or other text that should be typed literally by the user.
Constant width italic
Shows text that should be replaced with user-supplied values or by values deter‐
mined by context.

This element signifies a tip or suggestion.

This element signifies a general note.

This element indicates a warning or caution.

Using Code Examples


Supplemental material (code examples, exercises, etc.) is available for download at
https://github.com/moonhighway/learning-react.
This book is here to help you get your job done. In general, if example code is offered
with this book, you may use it in your programs and documentation. You do not
need to contact us for permission unless you’re reproducing a significant portion of
the code. For example, writing a program that uses several chunks of code from this
book does not require permission. Selling or distributing a CD-ROM of examples
from O’Reilly books does require permission. Answering a question by citing this
book and quoting example code does not require permission. Incorporating a signifi‐
cant amount of example code from this book into your product’s documentation does
require permission.
We appreciate, but do not require, attribution. An attribution usually includes the
title, author, publisher, and ISBN. For example: “Learning React by Alex Banks and
Eve Porcello (O’Reilly). Copyright 2017 Alex Banks, Eve Porcello,
978-1-491-95462-1.”

x | Preface
If you feel your use of code examples falls outside fair use or the permission given
above, feel free to contact us at [email protected].

O’Reilly Safari
Safari (formerly Safari Books Online) is a membership-based
training and reference platform for enterprise, government,
educators, and individuals.

Members have access to thousands of books, training videos, Learning Paths, interac‐
tive tutorials, and curated playlists from over 250 publishers, including O’Reilly
Media, Harvard Business Review, Prentice Hall Professional, Addison-Wesley Profes‐
sional, Microsoft Press, Sams, Que, Peachpit Press, Adobe, Focal Press, Cisco Press,
John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe
Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, and
Course Technology, among others.
For more information, please visit http://oreilly.com/safari.

How to Contact Us
Please address comments and questions concerning this book to the publisher:

O’Reilly Media, Inc.


1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional
information. You can access this page at http://bit.ly/learning-react-2e.
To comment or ask technical questions about this book, send email to bookques‐
[email protected].
For more information about our books, courses, conferences, and news, see our web‐
site at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia

Preface | xi
Acknowledgments
Our journey with React wouldn’t have started without some good old fashioned luck.
We used YUI when we created the training materials for the full stack JavaScript pro‐
gram that we taught internally at Yahoo. Then in August 2014, development on YUI
ended. We had to change all of our course files, but to what? What were we supposed
to use on the front end now? The answer: React. We didn’t fall in love with React
immediately, it took us couple of hours to get hooked. It looked like React could
potentially change everything. We got in early and got really lucky.
This book would not have been possible without the support of Ally MacDonald who
helped us every step of the way and was monumentally patient with us through sev‐
eral library updates. We’re grateful to Melanie Yarbrough, Colleen Toporek, and
Rachel Head for their amazing attention to detail. Thanks to Sarah Ronau for proof‐
reading this book well before it was ready for human eyes and to Bonnie Eisenman
for her great advice and overall delightfulness. Thanks also to Stoyan Stefanov, who
was nice enough to provide a technical review even though he’s really busy building
cool stuff at Facebook.
There’s also no way this book could have existed without the Sharon Adams and
Marilyn Messineo. They conspired to purchase Alex’s first computer, a Tandy TRS 80
Color Computer. It also wouldn’t have made it to book form without the love, sup‐
port, and encouragement of Jim and Lorri Porcello, and Mike and Sharon Adams.
We’d also like to acknowledge Coffee Connexion in Tahoe City, California for giving
us the coffee we needed to finish this book, and its owner, Robin, who gave us the
timeless advice: “A book on programming? Sounds boring!”

xii | Preface
CHAPTER 1
Welcome to React

React is a popular library used to create user interfaces. It was built at Facebook to
address some of the challenges associated with large-scale, data-driven websites.
When React was released in 2013, the project was initially viewed with some skepti‐
cism because the conventions of React are quite unique.
In an attempt to not intimidate new users, the core React team wrote an article called
“Why React?” that recommended that you “Give It [React] Five Minutes.” They
wanted to encourage people to work with React first before thinking that their
approach was too crazy.
Yes, React is a small library that doesn’t come with everything you might need out of
the box to build your application. Give it five minutes.
Yes, in React, you write code that looks like HTML right in your JavaScript. And yes,
those tags require preprocessing to run in a browser. And you’ll probably need a
build tool like webpack for that. Give it five minutes.
If you read that article—as we did—you may have been dazzled by the promise of a
new JavaScript library—a library that would solve all of our problems with the DOM;
a library that would always be easy to work with and would never hurt us.
Then the questions start to arise: how do I convert this JSX? How do I load data?
Where does the CSS go? What is declarative programming? Every path leads to more
questions about how to incorporate this library in your actual day to day work. Every
conversation introduces new terminology, new techniques, and more questions.

Obstacles and Roadblocks


By taking a few minutes to learn about React components, you’ve opened a door to a
different way of thinking about and approaching web development. However, there

1
Other documents randomly have
different content
The Project Gutenberg eBook of Expedition to
Pluto
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.

Title: Expedition to Pluto

Author: Fletcher Pratt


Laurence Manning

Release date: March 29, 2020 [eBook #61694]


Most recently updated: October 17, 2024

Language: English

Credits: Produced by Greg Weeks, Mary Meehan and the Online


Distributed Proofreading Team at http://www.pgdp.net

*** START OF THE PROJECT GUTENBERG EBOOK EXPEDITION TO


PLUTO ***
Expedition to Pluto
By Fletcher Pratt and Laurence
Manning

Within the Goddard's hurtling hull Captain


"Steel-Wall" McCausland, hero of the space fleets,
nursed his secret plan for an Earth reborn. Reuter
the scientist cuddled his treacherous test-tubes.
And Air Mate Longworth grappled an unseen horror
that menaced a billion lives!

[Transcriber's Note: This etext was produced from


Planet Stories Winter 1939.
Extensive research did not uncover any evidence that
the U.S. copyright on this publication was renewed.]
"Now passing Phobos, the second moon of Mars. From this point to
the orbit of Jupiter we are in the planetoid belt, the most dangerous
portion of our voyage. This ship's armor of twenty-inch beryll-steel
may be perfectly adequate to keep meteorites out, but let just one
of those planetoids, little worlds, hit us and this broadcast would end
right now. Here we are! Phobos at our left and down, if there is any
up or down out here in empty space. It's a little red moon, cracked
and seamed, all rock; it has no atmosphere and no weather. The
rocks stand up, jagged and sharp. There she goes! Good-bye Phobos
—we're making 9,250 miles an hour past Phobos, according to a
message from Captain McCausland which has just been handed to
me. The Captain doesn't look well this morning. He seems depressed
and the difficulties of this expedition are weighing on him. That's all
for today. This is 7-LOP, the interplanetary expedition ship Goddard,
on the exploring expedition to Pluto. Your reporter, Paulette de Vries
speaking. Interplanetary time 0-six-0-0, May 24, 2432."
The girl snapped the key of her microphone off and turned angrily to
the young man who had tapped her on the shoulder. "What do you
mean by interrupting my broadcast, Adam Longworth?"
The tall young man was frowning at her. "You know the crew listens
in on these broadcasts, don't you?"
"Well, what am I supposed to do about that? Give three cheers?"
"Listen, Paulette. On an expedition as dangerous as this, is it right to
let the crew know the Captain is feeling depressed or doubtful? I
didn't mean to make you sign off, though."
"I signed off because I was through. Don't flatter yourself! Trouble
with you is you try to run everybody's business. I thought you might
have got over that in the ten years since I knew you in school, but
you haven't. Trying to keep me out of the control room so I wouldn't
hurt myself! Wake up, Mr. Longworth, this is 2432; you're still living
back in the nineteen-hundreds when woman's place was in the
home."
Longworth glanced at a bandage around the girl's left wrist. Paulette
reddened.
"All right, I slipped and sprained my wrist. So what? So you have my
things moved to another cabin, where I'll be more comfortable.
You're an interfering old woman, Mr. Longworth. You're hopeless!"
Longworth reddened uncomfortably.
"Very well, Paulette, I'll stop interfering as you call it. But really, you
ought to stop referring to the Captain in such a manner as to break
down the morale of the expedition."
The girl glared at him. "I'll take orders about that kind of thing from
Captain McCausland and nobody else. And I don't think the man I'm
going to marry will censor what I have to say."
Adam Longworth's face set as he stood for a moment irresolute.
Then, as Paulette said nothing more, he turned and left the cabin.
Outside he paused, gazing down the long main corridor of the space
ship toward the open fo'castle lock, where the crew lolled in the
month-long idleness of space-voyaging. He frowned, strode off to
find Captain McCausland.

Captain McCausland—"Old Steel-Wall" as he was known in the


League of Planets Space Service—was poring over the course plotted
on the chart table. The handsome, saturnine face and straight back
were those of a youth; but he was forty-five and had twenty years of
service behind him and had won the honor medals of three planets.
He was so absorbed that he did not notice the Mate till Longworth
touched his arm.
"Yes?" he said, turning round with a pair of dividers in his hand.
"It can wait sir, if you're busy."
McCausland looked at him out of cold, efficient eyes. "Speak up."
"It's the crew, sir. You know how these long runs are. Months with
nothing to do, nothing to see."
There was a flicker around the Captain's mouth that might have
been amusement. "Trouble?"
Adam looked startled. "Oh, no, nothing yet. I just wanted to head
off trouble before it started, sir. You heard Miss de Vries broadcast
just now?"
Captain McCausland nodded, and this time the smile of amusement
was definitely present. "I think the word was 'depressed' wasn't it?
And you're afraid it will throw the crew into a panic, and they'll turn
the ship around on us and head for home. Is that it, Mr. Longworth?"
Adam, wishing he were anywhere but just there, and wilting visibly
under the sarcastic gaze of the Captain, plunged desperately ahead.
"Well, sir, I took the liberty of asking her not to do it again.... She
said she was taking orders only from you ... that is ... I'm sorry, sir, I
didn't know you were going to...."
"To be married, you mean? Well, why not?" He smiled again. "The
ceremony will take place as soon as we come back from this
expedition. That gives her a certain amount of privilege you
understand." His face turned suddenly grave and his voice a trifle
sharp. "Moreover, Miss de Vries is here as radio reporter for the
Interplanetary broadcasting. I want you to understand, Mr. Mate,
that I'll have no interference with her. Instead of chasing bugaboos,
suppose you check the course through the planetoid belt. I'll leave
you with it; that will give you something real to worry about for a
change."
Adam stared hopelessly after his retreating back. Damnation!
Everything had seemed to go wrong since the beginning of this
voyage. The harder he tried to prove himself worthy of the
appointment as second-in-command to "Old Steel-Wall" the worse
things went. With a shrug he turned doggedly to the chart work.
Two hours later he stepped over to the chart-room port and gazed
out into the velvet blue-black of space where the thousand suns of
the Milky Way burned across the horizon. It was no use. He was
going to have to make a fool of himself again.
But could he help it? Captain McCausland had certainly asked him to
check the course through the planetoid belt. Perhaps he would
forget now, and not ask about the checking operation. But if he did?
Certainly Walter McCausland couldn't have been wrong. Yet the
figures—? Adam studied his work sheet again, shaking his head.
"Finished the checking, Longworth?" The voice startled him so that
he jumped.
"Yes, sir. Shall I take over the watch, sir?"
"Little early, aren't you? What do you think of the course, Mister?"
Adam hesitated.
"It seems ... likely to get us there, sir."
McCausland's eyes became points. "Are you by any chance evading
my question? I'll repeat it. It was—what do you think of the course?
What is your opinion?"
Adam gulped. Here it was.
"There seems to be a fault in it, sir. I'm sorry."
"Indeed?" The tone was sarcastic. "Elucidate, Mister Mate."
"It takes us up out of the plane of the ecliptic, then back again
beyond the planetoid belt. That's very good, sir, and quite safe, but
didn't you omit the fuel consumption factor? The course as plotted
gives two shifts of forty-five degrees each, or half a complete stop,
as far as fuel is concerned. It would cut down the amount of fuel
available for exploration on Pluto to—well, here are the figures as
I've worked them out. We'd have about enough for two or three
landings. But if we went right through the danger belt of the
planetoids as originally planned, we would save enough fuel to really
explore the planet. We have to explore thoroughly if we're going to
find beryllium there. It won't lie on the surface. Why, it's hardly
worth going on at all if we can't do any more exploring than that....
That's my opinion, sir, and I didn't volunteer it, and I ask your
pardon in advance."

The great space captain smiled easily. "No need to beg my pardon at
all. At first glance one would think you had the right of it, but I just
happen to have gone into the matter a little deeper. You understand
the reasons behind this voyage? Well, suppose that after having
been away for two years we come back right on schedule, but
without a load of beryllium, without having found any trace of it.
What will happen? The League of Planets simply orders out another
expedition, better equipped, and we go down as having failed."
"But Captain! In two years there may not be enough light alloys left
on the three planets to build another ship as big as this! The service
to Mars will have to be stopped long before that. The lithium mines
there can't operate unless the water supply from Venus is
maintained."
"Well, what of it? Nobody likes to work in that Martian colony."
Adam caught his breath.
"But how are the atomic motors that do all the work going to
operate without the lithium from Mars?"
"And what of that, even? It would be temporary. Just a few months
or years till another expedition could be sent out. You take things
too seriously. What is there to prove that some other method of
armoring space-ships won't be found? Beryllium may not be
necessary after all."
"Perhaps you're right." Adam was still skeptical. "But is it likely, sir?
You've been on the space run so long you haven't kept up with
chemistry. The armor against meteorites now is so thick that any
metal but beryllium would double the weight of the vessel, and even
with these seven million horsepower Buvier-Manleys we couldn't
make the run from Venus to Mars. Why, sir, it would mean the end
of the lithium mines, it would mean the end of atomic power, and
we'd have to go back to the barbarism of the twentieth century,
when they ran everything by electricity from waterfalls!"
Captain McCausland raised an athletic hand. "Spare me that, Mister
Mate! I have heard it at approximately a hundred banquets before
starting out on this expedition. Yes, we carry the fate of the world
and all that. We have to find beryllium or else the Mars mines can't
be run and the atomic motors stop. I could sing it in my sleep. But
suppose we do take chances and get this ship wrecked. Won't the
world have to go back to 'barbarous' electric power after all? For my
part, I think some of those people in the twentieth century probably
had a good time."
Adam was silent. There was something in the Captain's reasoning,
he felt. Yet he, Adam Longworth, could not but feel that the issue
was a desperately serious one for every inhabitant of the three
worlds—Earth, Venus and Mars—belonging to the planetary league.
The entire known supply of beryllium, the precious light, strong
metal that was alone suitable for the armor of space ships, had been
exhausted. All that remained was in the hulls of the few dozen ships
carrying water from Venus to Mars, and from the arid deserts of
Mars, bringing to Earth the equally precious lithium which was the
only material with which atomic motors could be powered.
Every year, in spite of the best of care, one or two space ships would
be wrecked—caught in the sun's gravitational field, or lost through
some small error of navigation. Soon there would be no more space
ships; and no more could be built. Each of the outer planets had
been explored in turn—each but the last, the outermost and most
distant; Pluto. They were on their way there now; if they could not
make it—
"Very well, sir," he said aloud. "I see your point. Will you take over
the controls at the change of course?"
"I'll take over now. Report in two hours.... One more thing,
Longworth. You're young, damn young, to be first mate on this
expedition. You know you were a last-minute choice, because of an
accident to a much more experienced, and from what I've seen so
far, a much better man. Make the most of your chance, but don't
forget I'm captain here. I can't go into my reasons for everything I
do. That's all, Mister Mate."

"Hello, Earth! This is Paulette de Vries speaking, aboard 7-LOP,


space-ship Goddard . For the last two days we have been running
along the first leg of the angle that will lift us over the dangerous
belt of tiny planets thirty million miles beyond Mars. In a few
minutes, the ship's motors will be started to turn our course again—
straight for Pluto. I'm going to turn you over to the microphone in
the motor compartment and let you listen as the seven-million-
horse-power atomics take hold. Jake Burchall is in charge down
there at the motors.... Ready, Jake? Take it away!
... "That's all, folks. We're on the new course, with the engines shut
off, and we'll coast along for eight months at a speed of two miles a
second, 120 miles a minute, 7,200 miles an hour toward Pluto.
Nothing for anyone to do—a nice vacation for eight months. We're
giving a costume ball, folks; it's all we can think of. It won't be much
of a ball, though, as I'm the only woman aboard. I'm going to lend
some of the space-men some of my dresses—" (CRASH!)
"What was that, quick—!"
She got the answer, and went on.
"It's all right, just one of the incidents of interplanetary navigation.
Hit by a meteorite. Out here above the planetoid zone and close to
Jupiter meteorites are more common. Here's Mr. Wayland, one of the
junior officers, with a report. What's the damage, Mr. Wayland? It is!
Folks back on Earth, we surely got it that time! The meteorite
penetrated! Right through the twenty-inch beryll-steel armor of our
hull into compartment eighteen. The whole wall of the hull is
crushed in there, we've lost a few hundred cubic feet of air, but the
doors are closed and our air supply is safe. Here's First Mate
Longworth, just back from compartment eighteen. He says they'll
leave the compartment as it is, and build a tunnel of thin metal
through it to reach the five compartments toward the stern.
"Folks, can you imagine the shock of that meteorite? It's only a foot
through and weighs five hundred pounds. If it had been one of the
planetoids our whole hull would be crushed now. Captain
McCausland turned our course to avoid the planetoid zone entirely
and does that prove he was right? It does, and how! Well, folks, it's
been a long day and an exciting one. This is 7-LOP, space-ship
Goddard , signing off. Paulette de Vries speaking. 0-nine-two-seven,
May 27, 2432."

Adam had returned from the damaged compartment in time to catch


the close of the broadcast as he was stripping off the space suit in
which he was making the examination. Dog-tired, he had just
switched off the light preparatory to turning in when the light and
buzzer flashed at the door.
"It's me, Jake," came a voice.
The First Mate switched on the light, and called: "Come in."
A small man, his face seamed by a thousand wrinkles, slipped
through the door almost furtively and stood, twisting his hands in
the audition helmet which enabled him to hear in the engine room
above the noise of the motors.
"Didn't think you'd be in bed so soon, Mr. Adam," he apologized.
"But you always was an early retirer. I remember when I had you on
the training ship—he—he—he." He ended on a kind of nervous little
giggle, and Adam looked at him sharply.
"Yes, I remember. I couldn't cork off for a minute without hearing
someone pounding on the door and you yelling, 'It's Jake Burchall!
Time to get up'" His face sobered. "You didn't come here to talk
about old times, Jake. What's on your mind?"
"Well, you know how one thing and another gets around on a long
run like this. I didn't know but maybe there was something I could
help you about, sort of, he—he—he."
"Afraid not, Jake. Everything on hand is up to me. You can tell me
one thing, though. I was just in from the Mars run when I found my
name posted for this expedition, and I never did hear whose place I
got as First Mate on this trip. Do you know who it was?"
"Didn't nobody tell you that? It was Blagovitch."
"Why, he's one of the most cautious men in the service! What
happened to him?"
"Bruk his foot. He-he-he. There was some said he did it on purpose."
"But what could Old Steel-Wall—that is, why did the Captain pick
him in the first place?"
"Well, Mr. Adam, there's a lot of things about this trip ain't the same
as an ordinary run. I wonder myself sometimes. The Cap'n, he picks
a course way out of the ecliptic to dodge planetoids he didn't stand
one chance in a million of hitting anyhow; and he picks him a mighty
cautious mate, and then he picks him a young mate when the other
one can't go. What's he 'fraid of?"
"He's afraid of failing, that's all, Jake."
"He-he-he. Well, maybe I'm a old fool. I'd say it was more like he
was 'fraid of succeeding."

"Hello, Earth! This is your radio gal, Paulette de Vries, speaking from
7-LOP, space-ship Goddard . Interplanetary time two-two-0-three, or
just three seconds behind schedule for entering the atmosphere of
Pluto. We're falling rapidly toward the planet. I can only see half of
it, filling the entire horizon. The color is almost exactly that of a
pearl in moonlight, white with blue lights and absolutely featureless.
Sunlight out here is indescribably weak. Our spectroscope, handled
by Professor Reuter, shows the atmosphere is high in fluorine, with
traces of argon, and outside that a thin belt, a very thin belt of
helium and hydrogen. I told you all that the other day. We have
accurate temperature readings now, folks, and what they say is 200
degrees below zero, which is plenty chilly. You could drive a nail with
a butter hammer at that temperature, folks, and it means we will
have to do our exploring by diving, since the whole surface of the
planet will be covered, perhaps miles deep, by liquid gases. Can't tell
till we get there. Once we do get in, however, these talks will
temporarily cease, folks. I'll be sorry, because I've enjoyed them,
and I've enjoyed hearing from all of you back on Earth, so many
million miles away. But I'll be back, and so will all the crew and its
heroic captain. You may remember—Stand by! We're in the
hydrogen layer now. It's misty, streaming past the ports, so I can
hardly see anything. I must sign off now. This is 7-LOP, space-ship
Goddard."
Adam Longworth crouched motionless. The muscles bulged along his
arms, shoulder and neck quivered with tension, and perspiration
stood in tickling beads on his skin. His eyes were fixed on the control
panel before him; on either side was a quartermaster at a set of
controls and behind the three stood Captain McCausland, calm and
watchful.
Adam's hand moved rapidly and a quivering needle stood still on a
dial.
"Three gravities insufficient."
The Captain's finger found a red button on the portable signal panel
that made a three-inch medallion on the left breast of his uniform.
Throughout the ship there was a flash of red lights; loudspeakers
echoed his "Stand by for five gravities."
The quartermasters flung long levers; the motors boomed, braking
the speed of the Goddard's fall toward the surface. Captain
McCausland slumped to the acceleration and recovered; the air-
speed indicator crept toward the bottom of the dial, and had almost
reached it, when a loudspeaker twanged nasally. "Visibility fifty feet,
liquid surface. Forty feet—going down—afloat, sir."
Adam killed the motor with a plunge of his finger and his ears rang
in the sudden stillness.
"Thank you, gentlemen," said the Captain. "Perfect landing, Mister
Longworth. Relieve the navigation watch and report to the chart-
room in ten minutes."
Adam saluted, said a few words to the quartermasters and went out
with them to the fo'castle. The men off watch were just unstrapping
themselves from their bunks. Jake Burchall stepped up.
"Do I take up the new watch, Mr. Adam?"
"Two hours from now. Look here, Jake, there's something I wish
you'd do."
"Yes sir."
Adam lowered his voice.
"Did you hear the report? Fluorine all through this planet. Our ports
are glass, and fluorine acts on glass. They're thick, of course, and
have layers of plastic, but it will wear them through eventually.
We've got to think of something to do about it, and I think I have
the answer. Remember compartment eighteen? She'll be flooded.
Suppose when you're posting that watch you get into a space suit
and slide in there. Don't go outside, but cut loose some of the mica
lining around the break. When you get it, you can make some mica
sheets for the helmet view-ports of your space suit. Then get into
compartment eighteen again, and try it out. I'm no chemical expert,
but mica should insulate the view-ports on the helmet, and if it'll do
that, it will insulate the view-ports of the whole ship. Report to me
privately. I don't want to make a fool of myself if Professor Reuter
already has some other scheme worked out."
Jake grinned in understanding.
"Yes sir. He-he-he. Hope he hasn't."
In the chart room, when Adam arrived, he found a small gathering.
Perkins, the chemists, was there; so was Professor Reuter, the
astronomical man, a couple of assistants, and Captain McCausland,
looking extremely grave, thoughtful, but ruffled.
"Well, Longworth," he said. "You're just in time to order out the
navigation watch and set the course back to Earth."
Adam was aghast. "Not really?"
"Ask these gentlemen." He indicated the scientists.
Professor Reuter cleared his throat, but it was Perkins who spoke.
"At least we cannot remain here. The fluorine here will gradually, but
certainly, cut through the glass in this ship."

Adam flushed. He burst out: "But you knew there was fluorine a
month ago! Didn't anyone—?"
Captain McCausland raised his hand. "Please."
Professor Reuter explained. "To tell the truth there was some
discussion at that time. I am afraid I must confess myself
considerably at fault. Dr. Perkins at that time urged that the
expedition return and install quartz ports on the Goddard. At that
time I judged the temperature would be about what it is, minus 200,
and at that figure fluorine would not be present in the liquid portion
of the atmosphere, but would exist as a gas, and therefore would
not make contact with our ports while diving."
"I warned you it would be in solution," remarked Dr. Perkins.
"Yes." Professor Reuter, a big man, with folds of fat hanging from his
cheeks, pursed his lips and blew through them. "At the time, I must
confess, I really must confess, that I failed to consider the fact that
the enveloping upper atmosphere of the planet would cause the
surface temperature to be lower than that in the atmosphere itself.
As a result, it is just cold enough to hold a certain amount of fluorine
in solution in this cold ocean—"
"And, in a nut-shell, we must turn back," said Adam. He appealed to
Captain McCausland. "Isn't there anything aboard ship with which
we could insulate the ports?" Scientists always made difficulties, he
thought; an old space captain like McCausland would not be so hard
to down.
"We can try putting divers in space suits with double-thickness glass
in the ports. That would last a couple of hours at all events. I don't
doubt but we could get volunteers in this crew."
Reuter blew through his thick lips again. "Dangerous. As scientific
head of the expedition I will permit nothing of the kind. Naturally,
Captain, we are under your orders, but if you take such a step it will
be without my authority."
McCausland made a gesture of hopelessness. "Have you any other
ideas to suggest, Mister Longworth?"
Was "Old Steel-Wall" giving up this easily? Adam's thoughts
wheeled, but he schooled himself to inquire mildly, "Have you
thought of trying mica windows, sir?"
"That would do it!" cried Dr. Perkins excitedly. "Fluorine doesn't
attack mica—at least at Earth temperatures. I don't know about
these sub-zero atmospheres, but it ought to work. Have we the
mica?"
"The ship is lined with it," remarked McCausland. "But we can't very
well take the ship apart."
"Compartment eighteen, sir!" Adam burst out.
"Try it by all means: Hurry though, for we'll have to shutter the
ship's ports within an hour or get out of here. I congratulate you,
Mister Longworth. That was well thought of."
Was there a touch of irony in the voice? As Adam saluted and
withdrew, he wondered. Nobody else appeared to have noticed it, to
have noticed that there was something in the Captain's voice that
didn't somehow sound quite right.

Three men were grouped around the air lock at eighteen, and they
looked up as the First Mate approached. "He's coming out now, sir,"
said one of them. "Been in already once, and Bjornsen fitted a mica
shield over one of his helmet ports. He's trying that and the straight
glass shield in comparison."
Adam nodded wordlessly, watching the lock handle. Presently it
turned and out stumbled a figure like a gnome, cased in hairy hoar-
frost. "Pretty cold out there," said one of the men, as with gloved
fingers he labored deftly at Burchall's helmet.
The little wizened face came out of it, grinning like a monkey's. "It
works, sir! I was in a good five minutes. Look here—the glass lens is
all pitted and scored, but the mica isn't touched. Something funny
out there in that ocean, though."
"What do you mean?"
"Something with legs, only they weren't exactly legs, either—"
"Careful with that space suit there, Jake. Material's brittle after that
cold."
Adam raised his voice. "Look here men. We have a job on our
hands. We must make and install port covers for every port on the
ship. You know, the regular collision covers—beryll-steel. Jake, go up
forward and get a dozen men, while you, Bjornsen, fix those mica
covers on a dozen space suit helmets. Make it snappy, for Heaven's
sake. We have just one hour to work in."
"Beg pardon, sir, but wouldn't it be easier to do it outside this
atmosphere?"
"Haven't the fuel. Hurry!"
The ship rang with orderly disorder, as man after man of the off-duty
watch reported, received the space suit with the new mica windows,
and passed out through the air-lock in compartment eighteen to join
the others who were adjusting protective collision-shutters over the
big ship's ports. The last man through, Adam embarked on an
inspection tour of the ship. Compartment 23 checked—all ports
shuttered; compartment 22—
A bell rang violently, and the loudspeaker system shouted: "First
Mate Longworth wanted in the Captain's cabin at once. First Mate
Longworth wanted—"
"First Mate Longworth reporting," Adam remarked into his chest
phone, and hurried along the corridor.
Captain McCausland was seated at his desk, drumming on it with his
fingers. "Mister Mate," he burst out, as Adam entered, "do you know
what time it is?"
"No, sir."
The Captain indicated the space-chronometer set in the wall. "Your
hour is up. Call your men in. We're leaving."
"But, sir, they're nearly finished—"
"Mister Mate, I have taken the trouble to explain my orders to you
once before. I'll do it once more, so there will be no possible
mistake. I'm responsible for the safety of this expedition and the
lives of the people aboard. In the present case it's my responsibility
to see that this cold fluorine ocean doesn't eat through the ports and
put everyone to a horrible death, corroding as it freezes them—
including Miss de Vries. Call in your men. That's an order!"
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like