100% found this document useful (1 vote)
4K views

(Ebook) High-Performance Programming in C# and .NET: Understand the nuts and bolts of developing robust, faster, and resilient applications in C# 10.0 and .NET 6 by Jason Alls - Download the ebook with all fully detailed chapters

The document provides information about various ebooks available for instant download on ebooknice.com, focusing on programming in C# and .NET. It highlights titles such as 'High-Performance Programming in C# and .NET' by Jason Alls and 'Pro C# 10 with .NET 6' by Andrew Troelsen and Philip Japikse, among others. The ebooks cover foundational principles, performance optimization, and advanced programming techniques in C# and .NET.

Uploaded by

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

(Ebook) High-Performance Programming in C# and .NET: Understand the nuts and bolts of developing robust, faster, and resilient applications in C# 10.0 and .NET 6 by Jason Alls - Download the ebook with all fully detailed chapters

The document provides information about various ebooks available for instant download on ebooknice.com, focusing on programming in C# and .NET. It highlights titles such as 'High-Performance Programming in C# and .NET' by Jason Alls and 'Pro C# 10 with .NET 6' by Andrew Troelsen and Philip Japikse, among others. The ebooks cover foundational principles, performance optimization, and advanced programming techniques in C# and .NET.

Uploaded by

palorrodha
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/ 84

Instant Ebook Access, One Click Away – Begin at ebooknice.

com

(Ebook) High-Performance Programming in C# and


.NET: Understand the nuts and bolts of developing
robust, faster, and resilient applications in C#
10.0 and .NET 6 by Jason Alls

https://ebooknice.com/product/high-performance-programming-
in-c-and-net-understand-the-nuts-and-bolts-of-developing-
robust-faster-and-resilient-applications-in-c-10-0-and-
net-6-54553130

OR CLICK BUTTON

DOWLOAD EBOOK

Get Instant Ebook Downloads – Browse at https://ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Pro C# 10 with .NET 6: Foundational Principles and Practices in Programming


by Andrew Troelsen, Philip Japikse ISBN 9781484278680, 1484278682

https://ebooknice.com/product/pro-c-10-with-net-6-foundational-principles-and-
practices-in-programming-44480694

ebooknice.com

(Ebook) Pro C# 10 with .NET 6 : Foundational Principles and Practices in Programming


by Andrew Troelsen; Phil Japikse ISBN 9781484278697, 1484278690

https://ebooknice.com/product/pro-c-10-with-net-6-foundational-principles-and-
practices-in-programming-47148782

ebooknice.com

(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason; Viles, James ISBN
9781459699816, 9781743365571, 9781925268492, 1459699815, 1743365578, 1925268497

https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374

ebooknice.com

(Ebook) Concurrency in .NET: Modern patterns of concurrent and parallel programming


(With examples in C# and F#) by Riccardo Terrell ISBN 9781617292996, 1617292990

https://ebooknice.com/product/concurrency-in-net-modern-patterns-of-concurrent-
and-parallel-programming-with-examples-in-c-and-f-27186094

ebooknice.com
(Ebook) The Nuts and bolts of Paced ECG Interpretation (Nuts and Bolts Series) by
Tom Kenny ISBN 9781405184045, 1405184043

https://ebooknice.com/product/the-nuts-and-bolts-of-paced-ecg-interpretation-
nuts-and-bolts-series-1836302

ebooknice.com

(Ebook) Options and Derivatives Programming in C++23: Algorithms and Programming


Techniques for the Financial Industry, 3rd Edition by Carlos Oliveira ISBN
9781484298268, 9781484298275, 1484298276, 1484298268

https://ebooknice.com/product/options-and-derivatives-programming-
in-c-23-algorithms-and-programming-techniques-for-the-financial-industry-3rd-
edition-53487340

ebooknice.com

(Ebook) Simple and Efficient Programming with C# : Skills to Build Applications with
Visual Studio and .NET by Vaskaran Sarcar ISBN 9781484287378, 1484287371

https://ebooknice.com/product/simple-and-efficient-programming-with-c-skills-to-
build-applications-with-visual-studio-and-net-49420130

ebooknice.com

(Ebook) Simple and Efficient Programming with C#: Skills to Build Applications with
Visual Studio and .NET by Vaskaran Sarcar ISBN 9781484273210, 1484273214

https://ebooknice.com/product/simple-and-efficient-programming-with-c-skills-to-
build-applications-with-visual-studio-and-net-34493440

ebooknice.com

(Ebook) Implementing Design Patterns in C# 11 and .NET 7: Learn how to design and
develop robust and scalable applications using design patterns - 2nd Edition by
Malavasi Cardoso, Alexandre F. ISBN 9789355517333, 9355517335

https://ebooknice.com/product/implementing-design-patterns-in-c-11-and-
net-7-learn-how-to-design-and-develop-robust-and-scalable-applications-using-
design-patterns-2nd-edition-53883082

ebooknice.com
High-Performance
Programming in C#
and .NET

Understand the nuts and bolts of developing robust,


faster, and resilient applications in C# 10.0 and .NET 6

Jason Alls

BIRMINGHAM—MUMBAI
High-Performance Programming in C# and .NET
Copyright © 2022 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted
in any form or by any means, without the prior written permission of the publisher, except in the case of
brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information
presented. However, the information contained in this book is sold without warranty, either express or
implied. Neither the author nor Packt Publishing or its dealers and distributors, will be held liable for
any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and
products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot
guarantee the accuracy of this information.

Associate Group Product Manager: Gebin George


Publishing Product Manager: Alok Dhuri
Senior Editor: Kinnari Chohan
Technical Editor: Maran Fernandes
Copy Editor: Safis Editing
Project Coordinator: Manisha Singh
Proofreader: Safis Editing
Indexer: Subalakshmi Govindhan
Production Designer: Sinhayna Bais
Marketing Coordinator: Sonakshi Bubbar

First published: July 2022

Production reference: 1290722

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.

ISBN 978-1-80056-471-8

www.packt.com
I would like to dedicate this book to the team at Packt, who helped
me through each step of the way and were very accommodating and
understanding of the difficulties I was going through in my personal life
while working on this book. They have been a truly great team that has
encouraged me each step of the way. I could not have written this book
without their expertise and guidance.

I would also like to dedicate this book to my wonderful parents, who had
to suffer long periods without me as I spent many a long night and many
weekends on this book, but who encouraged me to keep going through
difficult times.

– Jason Alls
Contributors
About the author
Jason Alls is the author of Clean Code in C# and has been programming for over 21
years. Working with an Australasian company, he started his career developing call center
management reporting software used by global clients, including telecom providers,
banks, airlines, and the police. He then moved on to develop GIS marketing applications
and worked in the banking sector, performing data migrations between Oracle and SQL
Server. Certified as an MCAD in C# since 2005, he has been involved in the development
of various desktop, web, and mobile applications.
Currently employed by a leading software house, he develops and supports order
processing and warehouse management software written in C#.

I would like to send a warm thank you to Joy and Gianni, who reviewed
the chapters for me. Their attention to detail was excellent, and they
would often let me know when things needed improving or when I had
left something out. Because of them, the content of this book, I feel, will
be of great benefit to programmers and developers at all levels. I happily
recommend them as reviewers to any budding authors.
About the reviewers
Gianni Rosa Gallina is an Italian senior software engineer and architect who has
been focused on emerging technologies, AI, and virtual/augmented reality since 2013.
Currently, he works at Deltatre’s Innovation Lab, prototyping solutions for next-generation
sports experiences and business services. Besides that, he has more than 10 years of
certified experience as a consultant on Microsoft and .NET technologies (including
technologies such as the Internet of Things, the cloud, and desktop/mobile apps). Since
2011, he has been awarded Microsoft MVP in the Windows Development category. He
has been a Pluralsight Author since 2013 and is a speaker at national and international
conferences.

Joy Rathnayake is a solutions architect with over 19 years of industry experience and is
part of the Digital & Emerging Technology (DET) team at EY GDS, based in Colombo,
Sri Lanka. He is primarily responsible for understanding customer requirements,
identifying required products/ technologies, and defining the overall solution design/
architecture.
Before he joined EY GDS Sri Lanka, Joy worked as a solutions architect at WSO2 Inc.,
Totalamber Ltd, Virtusa Ltd, Solid Quality Mentors, IronOne Technologies, and Sri
Lankan Airlines. He was responsible for architecting, designing, and developing software
solutions primarily using Microsoft and related technologies.
Joy has been recognized as both a Microsoft Most Valuable Professional (MVP) and
a Microsoft Certified Trainer (MCT). He has contributed to developing content for
Microsoft Certifications and has worked as a Subject Matter Expert (SME) for many
Microsoft exam development projects.
He has contributed a lot to the community by presenting at various events, such as
Microsoft Tech-Ed, Southeast Asia SharePoint Conference, and SharePoint Saturday.
Joy enjoys traveling, speaking at public events/conferences, and reading.
Table of Contents
Preface

Part 1: High-Performance Code Foundation


1
Introducing C# 10.0 and .NET 6
Technical requirements 4 Using records 15
Obtaining and building the latest Using the new pattern
Roslyn compiler from the source code 5 matching features 21
Using new expressions with
Overview of Microsoft .NET 6 7 targeted types 25
Moving to one unified platform 8 Using covariant returns 27
Garbage collection 9
Just-In-Time compiler 9
Native compilation 28
Text-based processing 10 Performing native compilation of
.NET Core applications 29
Threading and asynchronous
operations10 Improving Windows
Collections and LINQ 11 Store performance 35
Networking and Blazor 11
Improving ASP.NET
New performance-based APIs and
performance35
analyzers12
Summary37
Overview of C# 10.0 12 Questions and exercises 38
Writing top-level programs 13
Further reading 38
Using init-only properties 14
viii Table of Contents

2
Implementing C# Interoperability
Technical requirements 42 Performing Component Object
Using Platform Invocation Model (COM) interoperability 58
(P/Invoke)43 Reading data from an
Using unsafe and fixed code 44 Excel spreadsheet 59
Exposing static entry points using Creating an Excel add-in 61
P/Invoke 48
Safely disposing of unmanaged
Interacting with Python code 56 code64
Summary 68
Questions 68
Further reading 69

3
Predefined Data Types and Memory Allocations
Technical requirements 72 Building a stack versus building a heap
(example project) 87
Understanding the predefined
.NET data types 73 Choosing between a struct and a class 93

Understanding the predefined value Passing by value and passing


types in C# 74 by reference 94
Understanding the predefined
Building a pass-by-reference
reference types in C# 75
example program 94
Understanding static types 81
Boxing and unboxing 97
Understanding the various
Performing boxing 98
types of memory used in C# 83
Performing unboxing 98
The stack 84
The heap 85 Summary102
Questions103
Further reading 103
Table of Contents ix

4
Memory Management
Technical requirements 106 Preventing memory leaks 127
Object generations and Understanding the dangers of
avoiding memory issues 106 using Marshal.ReleaseComObject 128
Understanding long and How using events can be a
source of memory leaks 138
short weak references 111
Finalization117 Summary151
Using finalization 118 Questions152
Implementing the Further reading 152
IDisposable pattern 122

5
Application Profiling and Tracing
Technical requirements 157 Installing and using
Understanding code metrics 158 dotnet-counters 183
Application metrics 158 Collecting data and saving it to a file
Assembly metrics 159 for post-analysis 185
Namespace metrics 160 Listing .NET processes that can be
monitored 187
Type metrics 161
Listing the available list of well-known
Method metrics 162
.NET counters 187
Field metrics 162
Monitoring a .NET process 188
Performing static
Tracking down and
code analysis 163
fixing a memory leak
Generating and viewing with dotMemory 189
memory dumps 167
Finding the cause of a UI
Viewing loaded modules 169 freeze with dotTrace 198
Debugging your applications 171 Optimizing application
Using tracing and performance and memory
diagnostics tools 172 traffic with dotTrace 206
Using the Visual Studio 2022 Summary209
Performance Profiler 172
Questions210
Using JetBrains dotMemory 179
Further reading 210
Using JetBrains dotTrace 181
x Table of Contents

Part 2: Writing High-Performance Code


6
The .NET Collections
Technical requirements 217 Deciding between using
Understanding the different arrays or collections 234
collection offerings 217 Accessing objects using
The System.Collections namespace 218 indexers239
The System.Collections.Generic Comparing IEnumerable and
namespace220 IEnumerator242
The System.Collections.Concurrent Database query performance 246
namespace221
Exploring the yield keyword 253
The System.Collections.Specialized
namespace222 Learning the difference
Creating custom collections 223 between concurrency and
parallelism260
Understanding Big O notation 225 Learning the difference
Choosing the right collection 225 between Equals() and == 261
Setting up our sample Summary265
database227 Questions265
Deciding between interfaces Further reading 266
and concrete classes 229

7
LINQ Performance
Technical requirements 268 LINQ queries 285
Setting up a sample database 268 Increasing Group By
Setting up our in-memory performance in LINQ queries 287
sample data 271 Filtering lists 290
Database query performance 273 Understanding closures 295
Getting the last value of Summary299
a collection 283 Questions299
Avoid using the let keyword in Further reading 299
Table of Contents xi

8
File and Stream I/O
Technical requirements 302 Accessing files asynchronously 315
Understanding the various Writing text to a file asynchronously 316
Windows file path formats 302 Handling I/O
Removing the maximum path length operation exceptions 319
limitation using the registry 303
Performing memory
Removing the maximum path length
limitation using the group policy 304
tasks efficiently 323
Understanding local
Considering improved storage tasks 326
I/O performance 305 Summary327
Moving files 308
Questions 328
Calculating directory sizes 313
Further reading 329

9
Enhancing the Performance of Networked Applications
Technical requirements 333 Programming a simple gRPC
Blazor application 358
Understanding the network
layers and protocols 334 The blank solution 359

The TCP/IP model 338 Optimizing internet resources 365


Writing an example email application
Using pipelines for content
with the TCP/IP model  339
streaming366
Improving web-based Writing and running a TCP server
network traffic 342 console application 367
Recording your web-applications Writing and running a TCP client
performance using Microsoft Edge 343 console application 372

High-performance Caching resources in memory 374


communication using gRPC 347 Summary 378
Programming a simple gRPC client/ Questions 378
server application 348 Further reading 379
xii Table of Contents

10
Setting Up Our Database Project
Technical requirements 382 SqlCommandParameterModel
Setting up our database 382 class393
Setting up our database Writing the AdoDotNet class 393
access project 386 Writing the
Writing the Properties class 387 EntityFrameworkCoreData
Writing the DatabaseSettings class 388 class400
Writing the DapperDotNet
Writing the SecretsManager 389 class403
Writing the Product class 391 Summary409
Writing the Further reading 410
SqlCommandModel class 392
Writing the

11
Benchmarking Relational Data Access Frameworks
Technical requirements 413 Benchmarking data
Benchmarking data insertion deletion methods 432
methods413 The benchmarking results
Benchmarking data and their analysis 437
selection methods 420 Summary442
Benchmarking data Questions443
editing methods 427 Further reading 444

12
Responsive User Interfaces
Technical requirements 446 Adding a splash screen that updates
with loading progress 448
Building a responsive UI
with WinForms 446 Adding the increment count button
and label 451
Enabling DPI awareness and long file
Adding a table with paged data 451
path awareness 447
Table of Contents xiii

Running long-running tasks in Building responsive UIs


the background 456 with .NET MAUI 489
Layouts 489
Building a responsive UI
Accessibility490
with WPF 461
BlazorWebView492
Building a responsive UI
with ASP.NET 471 Building a responsive UI
Implementing memory caching 472 with MAUI 492
Implementing distributed caching 475 Building a responsive UI
Using AJAX to update part of the with WinUI 3 507
currently displayed page 478
Summary510
Implementing WebSockets 481
Questions511
Implementing a real-time chat
application using SignalR 484 Further reading 511

13
Distributed Systems
Technical requirements 514 Containers and serverless 532
Implementing the CQRS Managing your cloud
design pattern 514 infrastructure with Pulumi 534
Implementing event sourcing 516 Performance considerations
Event sourcing example project 519 for distributed computing 538
Using Microsoft Azure for Summary541
distributed systems 528 Questions542
Azure Functions 529 Further reading 543
Durable Azure Functions 530

Part 3: Threading and Concurrency


14
Multi-Threaded Programming
Technical requirements 548 Pausing and interrupting
Understanding threads threads552
and threading 548 Destroying and canceling
Creating threads and threads553
using parameters 549 Scheduling threads 556
xiv Table of Contents

Thread synchronization Questions561


and locking 558 Further reading 561
Summary560

15
Parallel Programming
Technical requirements 564 Parallel debugging and
Using the Task Parallel Library profiling tools 578
(TPL)564 The Parallel Stacks window 578
Using Parallel LINQ (PLINQ) 568 The Tasks window 579
The Concurrency Visualizer 580
Programming parallel data structures 570

Benchmarking with Summary 583


BenchmarkDotNet571 Questions 584
Using lambda expressions Further reading 584
with TPL and LINQ 576

16
Asynchronous Programming
Technical requirements 586 Benchmarking GetAwaiter.
Understanding the TAP model 586 GetResult(), .Result, and .Wait
Naming, parameters, and
for both Task and ValueTask 593
return types 587 Using async, await,
Initiating asynchronous operations 587 and WhenAll 596
Exceptions 588 Canceling asynchronous
Optional cancellation 588 operations 598
Optional Progress Reporting 589 Writing files asynchronously 600
async, await, and Task 590 Reading files asynchronously 602
Summary604
Questions604
Further reading 605
Table of Contents xv

Assessments
Chapter 1, Introducing C# 10.0 Chapter 9, Enhancing the
and .NET 6 607 Performance of Networked
Chapter 2, Implementing C# Applications612
Interoperability 608 Chapter 10, Setting Up Our
Chapter 3, Predefined Data Database Project 612
Types and Memory Chapter 11, Benchmarking
Allocations 608 Relational Data Access
Chapter 4, Memory Frameworks612
Management609 Chapter 12, Responsive User
Chapter 5, Application Interfaces613
Profiling and Tracing 609 Chapter 13, Distributed
Chapter 6, The .NET Systems  613
Collections610 Chapter 14, Multi-Threaded
Chapter 7, LINQ Performance 611 Programming614
Chapter 8, File and Stream I/O 611 Chapter 15, Parallel
Programming614
Chapter 16, Asynchronous
Programming614
Index
Other Books You May Enjoy
Preface
Writing high-performance code while building an application is crucial, and over the
years, Microsoft has focused on delivering various performance-related improvements
within the .NET ecosystem. This book will help you understand the aspects involved in
designing responsive, resilient, and high-performance applications with the new versions
of C# and .NET.
You will start by understanding the foundation of high-performance code and the latest
performance-related improvements in C# 10.0 and .NET 6. Next, you’ll learn how to
use tracing and diagnostics to track down performance issues and the cause of memory
leaks. The chapters that follow then show you how to enhance the performance of your
networked applications and various ways to improve directory tasks, file tasks, and
more. You’ll go on to improve data querying performance and write responsive user
interfaces. You’ll also discover how you can use cloud providers such as Microsoft Azure
to build scalable distributed solutions. Finally, you’ll explore various ways to process code
synchronously, asynchronously, and in parallel to reduce the time it takes to process a
series of tasks.
By the end of this C# programming book, you’ll have the confidence you need to build
highly resilient, high-performance applications that meet your customer’s demands.

Who this book is for


This book is for software engineers, professional software developers, performance
engineers, and application profilers looking to improve the speed of their code or take
their skills to the next level to gain a competitive advantage. You should be a proficient C#
programmer who can already put the language to good use and is also comfortable using
Microsoft Visual Studio 2022.
xviii Preface

What this book covers


Chapter 1, Introducing C# 10.0 and .NET 6, talks about the Common Language Runtime
(CLR). You will start by learning about what’s new in C# 10.0 and .NET 6. Then you will
learn about the .NET native runtime and CoreCLR. Next, you will learn about the unified
BCL followed by Windows Store performance. Finally, you will learn about ASP.NET 5
performance.
Chapter 2, Implementing C# Interoperability, introduces Microsoft .NET interoperability.
You will learn how to call and dispose of unsafe code. You will also learn how to migrate
legacy COM programs to .NET using COM interoperability. In this chapter, you will learn
how to create .NET libraries and components and use them in legacy COM applications.
By the end of the chapter, you will have learned how to consume COM components in
.NET and how to consume .NET applications in COM components. This will help you to
migrate COM applications over to the .NET platform.
Chapter 3, Predefined Data Types and Memory Allocations, explores C# primitive types
and C# object types. You will learn about the stack and the heap and about passing data
by reference and by value. Then you will learn about boxing and unboxing and their
implications on application performance. You will also be refreshed on the C# primitive
type, and how to build objects that perform well.
Chapter 4, Memory Management, talks about the garbage collector. You will learn how to
use tracing and diagnostics to track down performance issues and the cause of memory
leaks. Then you will learn about object generations and how the garbage collector decides
what to dispose of. You will also learn about weak references and how to correctly dispose
of objects in order to prevent memory leaks.
Chapter 5, Application Profiling and Tracing, teaches you how to profile your applications
to identify poor areas of performance. You will learn about code metrics and how to
perform static code analysis. In your drive to write code that is more performant, you will
learn to make use of memory dumps, the loaded modules viewer, debugging, tracing, and
dotnet-counters. By the time you have completed this chapter, you will have the skills and
experience you need to profile your own applications.
Chapter 6, The .NET Collections, explores the collections framework. You will learn about
the different collections and how to best use them to get maximum performance from
them. You will access the various collections in the System.Collection, System.
Collection.Concurrent, and System.Collections.Generic namespaces.
You will also create your own custom exceptions and learn how to query collections using
LINQ.
Preface xix

Chapter 7, LINQ Performance, explains how to perform LINQ queries with performance
in mind. Depending on how you use LINQ, different methods that return the same result
can behave and perform differently. And so, in this chapter, you will learn how best to
perform queries on LINQ to improve the performance of your applications.
Chapter 8, File and Stream I/O, explains how to improve file and directory performance.
You will learn ways to improve directory tasks, file tasks, memory tasks, and isolated
storage tasks. In this book, you will learn how to write to files asynchronously and read
from files asynchronously.
Chapter 9, Enhancing the Performance of Networked Applications, breaks down how to
speed up the performance of network applications. You will learn how to communicate
over a network using the TCP and UDP network protocols. Then you will learn how to
perform network tracing processes with the OSI Network Layer Reference Model and a
selection of TCP and UDP networking protocols. Cache management will also be covered
so that you can improve the efficiency of resource retrieval.
Chapter 10, Setting Up Our Database Project, sets up the Northwind database project on
SQL Server as we will be using this database in the next section to benchmark data access
methods.
Chapter 11, Benchmarking Relational Data Access Frameworks, benchmarks three
different ways to manipulate SQL Server database data. We will be performing a side-by-
side comparison of Entity Framework, ADO.NET, and Dapper.NET. After running the
benchmarks for each of these data access and object mappers, you will be able to make
an educated judgment call on the best form of data access and object mapping for your
projects.
Chapter 12, Responsive User Interfaces, explains how to write responsive user interfaces.
You will write responsive Windows Forms (WinForms), Windows Presentation
Foundation (WPF), ASP.NET, .NET MAUI, and WinUI applications. Using background
worker threads, you will see how you can update and work with the user interface in real
time by running long-running tasks in the background.
Chapter 13, Distributed Systems, describes distributed applications and explains how
to improve their performance. You will learn how to build performant distributed
applications using the Command Query Responsibility Separation (CQRS) software
design pattern, event sourcing, and microservices. You will see how to use cloud providers
such as Microsoft Azure to build scalable distributed solutions using Cosmos DB, Azure
Functions, and the open source Pulumi infrastructure tool.
xx Preface

Chapter 14, Multi-Threaded Programming, explores what threads and threading are and
discusses background and foreground threads. Then you will learn how to pass data
into threads before you run them. You will also learn how to pause, interrupt, destroy,
schedule, and cancel threads.
Chapter 15, Parallel Programming, explains how to take advantage of the multiple CPU
cores that are available in today’s modern computers. You will learn how to process your
code by distributing the work between processes concurrently.
Chapter 16, Asynchronous Programming, demystifies the Task Asynchronous
Programming (TAP) model. You will learn how to program tasks asynchronously
and access web resources using async, await, and WhenAll. You will also look at
different return types, how to extract the required results, and how to correctly cancel
asynchronous operations and perform asynchronous file reading and writing.

To get the most out of this book


You will need to be proficient in C# and know how to use Visual Studio 2022 to create,
run, and debug C# programs and install NuGet packages. You will get the most from this
book if you follow along, write the code, and use the tools specified. But if you are too
busy, follow Microsoft’s guidance for obtaining and installing the following software.

If you are using the digital version of this book, we advise you to type the code yourself
or access the code from the book’s GitHub repository (a link is available in the next
section). Doing so will help you avoid any potential errors related to the copying and
pasting of code.
Please try and answer the questions, read the external resources provided at the end
of each chapter, and put what you have learned into action in your own programming
and performance training exercises. This will help to reinforce what you have learned
throughout this book.
Preface xxi

Download the example code files


You can download the example code files for this book from GitHub at https://
github.com/PacktPublishing/High-Performance-Programming-in-
CSharp-and-.NET. If there’s an update to the code, it will be updated in the GitHub
repository.
We also have other code bundles from our rich catalog of books and videos available at
https://github.com/PacktPublishing/. Check them out!

Download the color images


We also provide a PDF file that has color images of the screenshots and diagrams used in
this book. You can download it here: https://packt.link/hQmsb.

Conventions used
There are a number of text conventions used throughout this book.
Code in text: Indicates code words in text, database table names, folder names,
filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles.
Here is an example: “The enum data type is 4 bytes (32 bits) in size, nullable, and has
a minimum value of 0. You can measure the size of a value type using sizeof(Type
type).”
A block of code is set as follows:

static void Main(string[] _)


{
Console.WriteLine(“Chapter 3: Strings are immutable”);
var greeting1 = “Hello, world!”;
var greeting2 = greeting1;
Console.WriteLine($”greeting1={greeting1}”);
Console.WriteLine($”greeting2={greeting2}”);
greeting1 += “ Isn’t life grand!”;
Console.WriteLine($”greeting1={greeting1}”);
Console.WriteLine($”greeting1={greeting2}”);
}
xxii Preface

When we wish to draw your attention to a particular part of a code block, the relevant
lines or items are set in bold:

git clone https://github.com/dotnet/roslyn.git

Any command-line input or output is written as follows:

csc /help
csc -langversion:10.0 /out:HelloWorld.exe Program.cs
csc HelloWorld
cd css

Bold: Indicates a new term, an important word, or words that you see onscreen. For
instance, words in menus or dialog boxes appear in bold. Here is an example: “Make sure
the project is set to Debug mode, and then step through the code.”

Tips or important notes


Appear like this.

Get in touch
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, email us at
[email protected] and mention the book title in the subject of your
message.
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you have found a mistake in this book, we would be grateful if you would
report this to us. Please visit www.packtpub.com/support/errata and fill in the
form.
Piracy: If you come across any illegal copies of our works in any form on the internet,
we would be grateful if you would provide us with the location address or website name.
Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in
and you are interested in either writing or contributing to a book, please visit authors.
packtpub.com.
Preface xxiii

Share Your Thoughts


Now you’ve finished High-Performance Programming in C# and .NET, we’d love to hear
your thoughts! If you purchased the book from Amazon, please click here to go
straight to the Amazon review page for this book and share your feedback or
leave a review on the site that you purchased it from.
Your review is important to us and the tech community and will help us make sure we’re
delivering excellent quality content.
Part 1:
High-Performance
Code Foundation

Part 1 covers the foundation of high-performance code. We cover what’s new in C# 10.0
and .NET 6, including performance improvements. Next, we look at the interoperability
that is available that allows the gradual porting of Python systems to C#, followed by the
garbage collector. You will learn how types can negatively impact performance, as can
manually calling the garbage collector. And finally, we look at how we can use profiling
tools to identify and address performance issues.
This part contains the following chapters:

• Chapter 1, Implementing C# 10.0 and .NET 6


• Chapter 2, Introducing C# Interoperability
• Chapter 3, Predefined Data Types and Memory Allocations
• Chapter 4, Memory Management
• Chapter 5, Application Profiling and Tracing
1
Introducing C# 10.0
and .NET 6
Microsoft .NET 6 and C# 10.0 are the latest incarnations of the .NET platform and C#
programming language. They bring many performance enhancements to the C# and .NET
programmer community. We will start this book with an overview of the new versions of
C# and .NET.
In this chapter, you will start by downloading, restoring, building, and testing the latest
version of the .NET compiler called Roslyn. Then, you will review what's new in .NET 6,
including the areas where performance has been greatly enhanced. Then, you will review
what's new in C# 10.0 by looking at some code examples that demonstrate these features.
In the Native compilation section, you will build a project and run it as an MSIL project
with multiple binaries, then compile and run it as a single native binary. Finally, you
will learn how to improve the performance of Windows Store applications and ASP.NET
websites.
4 Introducing C# 10.0 and .NET 6

In this chapter, we will cover the following topics:

• Overview of .NET 6: In this section, we will cover, at a high level, what's new in
.NET 6. You will learn about the various performance improvements that will be
part of .NET 6.
• Overview of C# 10.0: Having learned how to obtain the latest Roslyn code in the
Technical requirements section, in this section, you will learn about the various
features that will be part of C# 10.0. This will include code examples.
• Native compilation: In this section, you will learn how to compile a .NET
Core application into a single native executable. You will write a simple console
application that recursively converts audio files from one format into another.
• Improving Windows Store performance: This is a brief section that provides
standard guidelines for improving the performance of applications that target the
Windows Store.
• Improving ASP.NET performance: This is a brief section that provides some
standard guidelines for improving ASP.NET applications.

By the end of this chapter, you will have the following skills:

• You will understand what's new in Microsoft .NET 6.


• You will be able to apply the new C# 10.0 code features within your source code.
• You will be able to compile your source code to native assemblies (also known
as binaries).
• You will know what, how, and where to look for information on improving the
performance of applications that target the Windows Store.
• You will know what, how, and where to look for information on improving the
performance of ASP.NET applications.

Let's begin this chapter by looking at Microsoft .NET 6.

Technical requirements
You will need the following prerequisites to complete this chapter:

• The latest preview version of Visual Studio Community Edition or higher.


• Microsoft .NET 6 SDK.
Technical requirements 5

• This book's source code: https://github.com/PacktPublishing/High-


Performance-Programming-in-CSharp-and-.NET/tree/master/
CH01.
• Optional: The latest Roslyn compiler built from source. The source code is available
on GitHub at https://github.com/dotnet/roslyn. This should be
automatically installed when you install the latest preview versions of Visual Studio.

Note
You can find the latest complete and up-to-date C# 10.0 feature set at
https://github.com/dotnet/roslyn/blob/master/docs/
Language%20Feature%20Status.md. At the time of writing, C# 10.0
is still undergoing much development and change. So, the contents of this book
may not work as expected. If this turns out to be the case, then please refer to
the preceding URL for the most relevant information to help you start working.

Obtaining and building the latest Roslyn compiler


from the source code
Note
The build system of all .NET-related repositories has been in flux for several
years now. We will provide the instructions for compiling Roslyn here; these
were correct at the time of writing. For the latest instructions, please read
the README.md file located at https://github.com/dotnet/
roslyn.

The following instructions are for downloading and building the latest version of the
Roslyn compiler source on Windows 10:

1. In the root of the C:\ drive, clone the Roslyn source code by using the following
command in the Windows Command Prompt:
git clone https://github.com/dotnet/roslyn.git

2. Then, run the following command:


cd Roslyn

3. Restore the Roslyn dependencies by running the following command:


restore.cmd
6 Introducing C# 10.0 and .NET 6

4. Build the Roslyn source code by running the following command:


build.cmd

5. Test the Roslyn build by running the following command:


test.cmd

6. Once all the tests have finished running, check the versions of C# that are accessible
to the new computer. Do this by opening a Command Prompt window and
navigating to C:\roslyn\artifacts\bin\csc\Debug\net472.
7. Then, run the following command:
csc /langversion:?

Note
I always run my Command Prompt as an administrator. Hence, the screenshots
will show Command Prompt in administrative mode. But running Command
Prompt as an administrator is not necessary for this exercise. Where Command
Prompt must be executed as an administrator, this will be made clear as
needed.

You should see something equivalent to the following:

Figure 1.1 – The versions of the C# programming language supported by the compiler
Overview of Microsoft .NET 6 7

As you can see, at the time of writing, version 10.0 of the C# language is available via the
C# compiler. C# 10.0 is set as the default. The preview is still under development. The
default version may be different on your computer.

Note
The latest version of Visual Studio 2022 should allow you to use the latest
available C# 10.0 code features. If it doesn't, then compile the latest source and
overwrite the files located at C:\Program Files (x86)\Microsoft
Visual Studio\2022\Preview\MSBuild\Current\Bin\
Roslyn.

The following three sets of instructions provide compiler help for compiling a program
that targets a specific C# version and then runs the program. These commands are for
demonstrative purposes only, and you do not have to run them now:

csc /help
csc -langversion:10.0 /out:HelloWorld.exe Program.cs
csc HelloWorld

Now that you can build C# 10.0 from the command line and from within Visual Studio
2022, let's learn what kind of new development is taking place with Microsoft .NET 6.

Overview of Microsoft .NET 6


Microsoft .NET 6 is the latest incarnation of .NET. You can access the downloads at
https://dotnet.microsoft.com/download/dotnet/6.0. The downloads are
available for Windows, macOS, and Linux users.

Note
To get the most out of .NET 6 and C# 10.0, it is best that you have Visual Studio
2022 or later installed.

The .NET 6 API documentation is available at https://docs.microsoft.com/


dotnet/api/?view=net-6.0.
8 Introducing C# 10.0 and .NET 6

Microsoft .NET 5 and later will no longer carry the Core or Framework suffix, as per the
following article: https://redmondmag.com/articles/2019/12/31/coming-
in-2020-net-5.aspx. Microsoft's goal with version 5 and later of the .NET platform
is to create a single platform for the .NET development of WinForms, WPF, Xamarin.
Forms, ASP.NET Core, and all other forms of .NET development. Xamarin.Forms
becomes Microsoft MAUI, with the main difference between versions being that the new
Microsoft MAUI will only use a single project to target all operating systems and devices.

Moving to one unified platform


The infrastructure for .NET 6 consists of runtime components, compilers, and languages.
Microsoft .NET SDK will sit on top of this infrastructure. The tools that will be available
include the command-line interface, Visual Studio Code, Visual Studio for Mac, and, of
course, Visual Studio.
With the unified platform, you can write desktop applications using WinForms, WPF,
and UWP. Web applications can be written using ASP.NET. Cloud applications will target
Microsoft Azure. Mobile applications will be written using Microsoft MAUI. Games,
virtual reality (VR), and augmented reality (AR) applications will be developed in
Unity, using Visual Studio 2022 or higher as the C# code editor. IoT will target ARM32
and ARM64 architectures. Finally, you will be able to develop artificial intelligence (AI)
applications using ML.NET and .NET for Apache Spark.
Microsoft is planning on producing a single .NET runtime and framework that is uniform
in its developer experience and runtime behavior across applications and devices. This will
be accomplished by building a single code base that combines the best elements of.NET
Framework, .NET Core, Mono, and Xamarin.Forms.
The main features of.NET 6 are as follows:

• Unified developer experiences, regardless of the applications being developed and


the devices being targeted.
• Unified runtime experiences across all devices and platforms.
• Java interoperability will be available on all platforms. This is stated in the Redmond
Magazine article called Coming in 2020: .NET 5, The Next Phase of Microsoft's .NET
Framework: https://redmondmag.com/articles/2019/12/31/coming-
in-2020-net-5.aspx.
• Multiple operating systems will be supported for Objective-C and Swift.
• AOT will be supported by CoreFX to provide static .NET compilation, support
multiple operating systems, and produce assemblies that are smaller in size.
Overview of Microsoft .NET 6 9

Now, let's look at some of the new features of .NET 6 from a high-level viewpoint.

Garbage collection
The garbage collector's performance regarding marking and stealing has been improved.
When a thread has finished its marking allotment, it can steal outstanding marking
work from other threads. This speeds up the process of collecting items to be garbage
collected. Reduced lock contentions on computers with higher core counts, improved
de-committing, avoidance of costly memory resets, and vectorized sorting are just some of
the new garbage collection performance improvements in .NET 6.

Just-In-Time compiler
In .NET 6, the Just-In-Time (JIT) compiler has also been improved. You can apply
various optimizations to the JIT, and it has an unlimited amount of time to implement
those optimizations. Ahead-Of-Time (AOT) is just one of the various techniques
provided to the JIT so that it can compile as much code as it can before executing the
application. The JIT now sees the length of an array as unsigned, which improves the
performance of mathematical operations carried out on an array's length. There are still
many changes being made.
Suffice to say that between the JIT and the GC, the performance improvements that have
been made to JIT and GC concerning memory and compilation optimizations are just two
reasons alone to migrate to .NET 6.
The JIT also recognizes more than a thousand new hardware intrinsic methods. These
methods allow you to target various hardware instruction sets from C#. You are no longer
tied to just x86_x64 hardware instruction sets.
Several runtime helper functions are available in the JIT. These helper functions enable
the JIT compiler to manipulate the source code so that the code runs must faster. Generic
lookups are much faster now, as they no longer need to employ slower lookup tables.
10 Introducing C# 10.0 and .NET 6

Text-based processing
Performance enhancements have also been made within the text-based processing
elements of .NET 6. These include (but are not limited to) processing whitespace in the
System.Char class, which requires less branching and fewer arguments. Because this
class is used in various text-processing objects and methods within .NET 6, the speed of
processing text in .NET 6 will be generally improved. DateTime processing is also at
least 30% faster due to optimizations in extracting the date and time components from
the raw tick count. Performance improvements have also been made to string operations
due to culture-aware modifications of StartsWith and EndsWith. By utilizing stack
allocation and JIT devirtualization, the performance of data encoding, such as UTF8 and
Latin1 encoding, has also been enhanced.
Regular expression (RegEx) performance has also been improved in .NET 6. The RegEx
engine has had performance improvements that increase textual processing by up to
three to six times and even more. The CharInClass method is more intelligent in
determining if characters appear within the specified character class. Character and digit
comparisons use lookup tables and various method calls are inlined, providing improved
RegEx processing. Generated code for various expressions has been improved. Searching
for RegExes is carried out using span-based searching with vectorized methods. The
need for backtracking has been eliminated as it analyzes RegExes during the node tree
optimization phase and adds atomic groups that do not change the semantics but do
prevent backtracking. These are only some of the improvements to RegEx performance.
But there are many more.

Note
For more in-depth knowledge on .NET 5 performance improvements to
RegExes, please read the following very detailed post by Stephen Toub:
https://devblogs.microsoft.com/dotnet/regex-
performance-improvements-in-net-5/.

Threading and asynchronous operations


Threading and asynchronous operations have also received a performance boost in .NET 5
with the experimental addition of async ValueTask pooling. You can turn on pooling by
setting DOTNET_SYSTEM_THREADING_POOLASYNCVALUETASK to true or 1. Pooling
creates state machine box objects that implement the interfaces, IvalueTaskSource,
and IValueTaskSource<TResult>. The runtime adds these objects to the pool.
Volatility has also received performance improvements in ConcurrentDictionary,
with performance improving as much as 30% on some ARM architectures.
Overview of Microsoft .NET 6 11

Collections and LINQ


The collections have also seen several performance enhancements, mainly to
Dictionary<TKey, TValue>, HashSet<T>, ConcurrentDictionary<TKey,
TValue>, and System.Collections.Immutable. The HashSet<T> collection's
implementation has been rewritten and re-synchronized with Dictionary<TKey,
the TValue> implementation, and moved further down the stack. The performance
of foreach when iterating through an ImmutableArray<T> has been
improved, and the generated code has been reduced in size by the addition of the
[MethodImpl(MethodImplOptions.AggressiveInlining)] annotation to
the GetEnumerator method of ImmutableArray<T>. Other elements of the .NET
collections, such as BitArray, have also seen performance improvements.
In .NET 5, LINQ has also seen further performance improvements, including OrderBy,
Comparison<T>, Enumerable.SkipLast, and by making implementing
Enumerable.Any more consistent with Enumerable.Count. These are only a few
performance improvements that have been to the collections.

Networking and Blazor


Networking has received a lot of work on performance improvement, especially the
System.Uri class (especially in its construction). The System.Net.Sockets and
System.Net.Http namespaces have also seen performance improvements. Many
improvements have been made to how JSON is processed with JsonSerializer in the
System.Text.Json library for .NET.
As Blazor uses the .NET mono runtime and .NET 5 libraries, a linker has been added
that trims code from the assembly that is not used down to the member level. The code
to be trimmed is identified by static code analysis. User interface response times are also
improved in Blazor Web Assembly applications, as the client-side code is downloaded
before being executed, and behaves just like a desktop application – but from within the
browser.
Furthermore, general improvements that have gone into .NET 5 include faster assembly
loading, faster mathematical operations, faster encryption and decryption, faster
interoperability, faster reflection emitting, faster I/O, and various allocations in various
libraries.
12 Introducing C# 10.0 and .NET 6

New performance-based APIs and analyzers


A few new performance-focused APIs have been added to .NET 5. Internally, some of
these APIs are already being used to reduce code size and improve the performance
of .NET 5 itself. They focus on helping the programmer to concentrate on writing
performant code and removing the complexity of tasks that have been previously hard
to accomplish. These new APIs and improvements to existing APIs include Decimal,
GC, MemoryExtensions, StringSplitOptions, BinaryPrimitives,
MailAddress, MemoryMarshall, SslStream, HttpClient, and more.
The .NET 5 SDK has also seen the addition of some new performance-based analyzers.
These analyzers can detect accidental allocations as a part of range indexing and offer
ways to eliminate the allocation. Analyzers will detect the old overloads for the Stream.
Read/WriteAsync methods and will offer fixes to enable automatic switching to the
newer overload methods that prefer Memory overloads. In StringBuilder, it is more
performant to use typed overloads to append non-string values such as int and long
values. When situations are encountered by the analyzer where the programmer has called
ToString() on a type that's being appended for which a typed overload exists, the fixer
will detect these situations and automatically switch to using the correct typed overload.
With LINQ, it is now more efficient to check if (collection.Count != 0) using the
(!collection.IsEmpty) syntax. The old way will be detected by the analyzer and
fixed to use the more performant new way. Finally, when you have worked to make your
code faster, your code is made correct, as the analyzer flags cases that use loops to allocate
memory from the stack using stackalloc. This helps prevent stack overflow exceptions
from being raised.
To see the road ahead in terms of .NET's new development, you can view the .NET
Core roadmap located at https://github.com/dotnet/core/blob/master/
roadmap.md.
Now, let's look at C# 10.0.

Overview of C# 10.0
You can find the features that will become part of C# 10.0 on the Roslyn GitHub page at
https://github.com/dotnet/roslyn/blob/master/docs/Language%20
Feature%20Status.md.
Not all these features are available at the time of writing. However, we will look at some of
the available features. With that, let's start with top-level programs.
Overview of C# 10.0 13

Writing top-level programs


Before C# 9.0, the Hello, World! console application was always the starting point for
learning C#. The file that students would update was called Program.cs. In this file, you
would have something akin to the following:

using System;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
}

As you can see, first, we import our System library. Then, we have a namespace
definition followed by our class definition. Then, in the class definition, we have our Main
method, in which we output the phrase "Hello, World!" to the console window.
In version 10.0 of the C# programming language, this can be simplified down to
a single line:

System.Console.WriteLine("Hello, World");

Here, we have eradicated 10 lines of code. Running the program will output the following:

Figure 1.2 – The console window showing the output "Hello World!"
14 Introducing C# 10.0 and .NET 6

If we open the generated DLL in IL DASM, we will see the following:

Figure 1.3 – ILDASM showing the internals of the hello world program
You will see from the decompilation that the compiler adds the Main method at compile
time. The next addition to C# 10.0 that we will look at is init-only properties.

Using init-only properties


Init-only properties allow you to use object initializers with immutable fields. For our little
demonstration, we will use a Book class that holds the name of a book and its author:

namespace CH01_Books
{
internal class Book
{
public string Title { get; init; }
public string Author { get; init; }
}
}

The properties can be initialized when the book is created. But once created, they can
only be read, not updated, making the Book type immutable. Now, let's look at init-only
properties. In the Program class, replace its contents with the following:

using System;
using CH01_Books;
var bookName = new Book { Title = "Made up book name",
Author = "Made Up Author" };

Console.WriteLine($"{bookName.Title} is written by
{bookName.Author}. Well worth reading!");
Overview of C# 10.0 15

Here, we imported the System and CH01_Books namespaces. Then, we declared a new
immutable variable of the Book type. After that, we output the contents of that Book type
using an interpolated string. Run the program; you should see the following output:

Figure 1.4 – The output of our init-only properties example


Now that we have been introduced to init-only properties, let's look at records.

Using records
When updating data, you do not want that data to be changed by another thread. So,
in multi-threaded applications, you will want to use thread-safe objects when making
updates. Records allow complete objects to be immutable and behave as values. The
advantage of using records over structs is that they require less memory to be allocated
to them. This reduction in memory allocation is accomplished by compiling records to
reference types. They are then accessed via references and not as copies. Due to this, other
than the original record allocation, no further memory allocation is required.
Let's learn how to use records. Start a new console application.
To demonstrate the use of records, we will use the following Book example:

internal record Book


{
public string Title { get; init; }
public string Author { get; init; }
}
16 Introducing C# 10.0 and .NET 6

The only change to the Book class is that class has been replaced with record.
Everything else remains the same. Now, let's put the record to work:

1. Replace the contents of the Program class with the following code:
using System;
using CH01_Records;

var bookOne = new Book {


Title = "Made Up Book",
Author = "Made Up Author
};

var bookTwo = bookOne with {


Title = "And Another Made Up Book"
};

var bookThree = bookTwo with {


Title = "Yet Another Made Up Book"
};

var bookFour = bookThree with {


Title = "And Yet Another Made Up Book: Part 1",
};

var bookFive = bookFour with {


Title = "And Yet Another Made Up Book: Part 2"
};

var bookSix = bookFive with {


Title = "And Yet Another Made Up Book: Part 3"
};

Console.WriteLine($"Some of {bookThree.Author}'s
books include:\n");
Console.WriteLine($"- {bookOne.Title}");
Console.WriteLine($"- {bookTwo.Title}");
Overview of C# 10.0 17

Console.WriteLine($"- {bookThree.Title}");
Console.WriteLine($"- {bookFour.Title}");
Console.WriteLine($"- {bookFive.Title}");
Console.WriteLine($"- {bookSix.Title}");
Console.WriteLine($"\nMy favourite book by {bookOne.
Author} is {bookOne.Title}.");

2. As you can see, we are creating immutable record types. We can create new
immutable types from them and change any fields we like using the with
expression. The original record is not mutated in any way. Run the code; you will
see the following output:

Figure 1.5 – Init-only properties showing their immutability


Despite changing the title during the assignment, the original record has not been
mutated at all.
3. Records can also use inheritance. Let's add a new record that contains the
publisher's name:
internal record Publisher
{
public string PublisherName { get; init; }
}
18 Introducing C# 10.0 and .NET 6

4. Now, let's have our Book inherit this Publisher record:


internal record Book : Publisher
{
public string Title { get; init; }
public string Author { get; init; }
}

5. Book will now include PublisherName. When we initialize a new book, we can
now set its PublisherName:
var bookOne = new Book {
Title = "Made Up Book",
Author = "Made Up Author",
PublisherName = "Made Up Publisher Ltd."
};

6. Here, we have created a new Book that contains Publisher.PublisherName.


Let's print the publisher's name. Add the following line to the end of the Program
class:
Console.WriteLine($"These books were originally published
by {bookSix.PublisherName}.");

7. Run the code; you should see the following output:

Figure 1.6 – Init-only properties using inheritance


Overview of C# 10.0 19

8. As you can see, we never set the publisher's name for bookTwo to bookSix.
However, the inheritance has followed through from when we set it for bookOne.
9. Now, let's perform object equality checking. Add the following code to the end of
the Program class:
var book = bookThree with { Title = "Made Up Book" };
var booksEqual = Object.Equals(book, bookOne) ?
"Yes" : "No";
Console.WriteLine($"Are {book.Title} and
{bookOne.Title} equal? {booksEqual}");

10. Here, we created a new Book from bookThree and set the title to Made Up
Book. Then, we performed an equality check and output the result to the console
window. Run the code; you will see the following output:

Figure 1.7 – Init-only properties showing the result of an equality check


It is clear to see that the equality check works with both book instances being equal.
20 Introducing C# 10.0 and .NET 6

11. Our final look at records considers positional records. Positional records set data
via the constructor and extract data via the deconstructor. The best way to
understand this is with code. Add a class called Product and replace the class with
the following:
public record Product
{
readonly string Name;
readonly string Description;

public Product(string name, string


description)
=> (Name, Description) = (name,
description);

public void Deconstruct(out string name, out


string description)
=> (name, description) = (Name,
Description);
}

12. Here, we have an immutable record. The record has two private and readonly
fields. They are set in the constructor. The Deconstruct method is used to return
the data. Add the following code to the Program class:
var ide = new Product("Awesome-X", "Advanced Multi-
Language IDE");
var (product, description) = ide;

Console.WriteLine($"The product called {product} is an


{description}.");
Discovering Diverse Content Through
Random Scribd Documents
deceptive, and the evil-disposed seek solitude for indulgence, the
cloud of a witness rose from beneath the skirt of your coat, with the
odor of tobacco from your suddenly concealed pipe, to confirm your
shame in the presence of purity. If your soul has been tempted, it
has been from gross indulgence to purity.”
The padre abashed relapsed into silence. But Dr. Baāhar, who had
for a butterfly consideration furnished him with the means of
indulgence, undertook his vindication, which he commenced with the
syllogistic proposition: “We will certainly admit that your spasmodic
sarcasms are poetical refinements upon fact, but I contend that you
are neither scientific or logical in your deductions. If God created
man with reasoning instincts, they were undoubtedly intended for
invention and indulgence. Again, in depriving children of their natural
protectors’ care and example, is in open controversion of Divine will.
As for me, I do not assume to be more wise in my day, than my
ancestors were in theirs. By the assumptions of your theory, founded
upon the partial knowledge of these egotistical Heracleans, who
have been shut out from a knowledge of the world from time
immemorial, we should repudiate the transmitted experience of our
ancestors. I shall not be guilty of so gross an act of ingratitude; my
father the counselor, and his progenitors, ate their saur-kraut and
sausages, drank their beer, smoked their pipes, and were excellent
swordmen and genealogists, and I intend to do honor to the habits
they inculcated.”
Pettynose the buzz recorder of sound, and Lindenhoff the
genealogical curator of sound, with Viscouswitzs the photographic
artist, sided with Dr. Baāhar, the latter sensuously remarking: “The
women may be accounted puritanically beautiful, but they lack the
bouquet of civilization, as well as the natural flavor peculiar to the
creole variations; and as to pleasure, I could derive as much by an
association with marble busts in the atélier of a sculptor. There is an
air of repulsiveness about them that repels geniality, so that I never
feel comfortable in their presence, and but for the encampment of
the Vermejo Indians on the lake, I would, with the first opportunity,
throw up my engagement and return to the haunts of civilization; for
of all things I abhor pedantry in men and puritanism in women.”
“We are as yet novices in the ways of the Heracleans,” urged Mr.
Dow, “and but imperfectly understand their motives of action or
system of self government. To judge them from our partial
impressions, which your personal opinions bespeak, is proof positive
that the cavils of surmise, peculiar to individuals, originated the
prejudices to which you have given voice. To me the addenda to
their morning salutation and evening anthem of praise, as rendered
by M. Hollydorf, bore advisory reference to the source of their
happiness.” M. Hollydorf fully endorsed Mr. Dow’s views.
CHAPTER XI.

M. Hollydorf after morning salutation mustered his assistants for the


inauguration of the legitimate duties entailed by his commission; as
he had become fully impressed with the necessity of “working up” a
sufficient number of experimental proofs for the basis of a
preliminary despatch of intention. Selecting a retired portion of the
latifundium for his field of operations they commenced their labors in
good earnest. Of all the civilized nations of the world, we can claim
for the Germans a just preëminence in those departments of science
devoted to the investigations of the habits and associations of insect
life. In truth, the enthusiasm shown for insect explorations has
extended itself to every department of their national existence; from
the palace to the cabin particular attention is devoted to hunting,
impaling, and preserving their cadavers, arranged in order, genera,
and species, in mausoleum cabinets for mummified exhibition as
shrines for the enraptured gaze of Teutonic devotees. Even the
mediæval Gael of the Scottish Highlands never possessed, in living
endowment, an attritive iota of the associate luxurious zest imparted
from their joint stock investments, or the Egyptian, of yore, in his
necropolitan collections, a source of such vain-glorious gratification.
M. Hollydorf’s first day’s investigations were rewarded with the
discovery of old species, familiar to his eye, under new and strange
combinations, affording conclusive evidence of exotic transfusion in
propagation at some remote period. In semi-meditation, with a
disinclination for food and midday rest, he continued his preparatory
investigations while his assistants refreshed themselves with their
accustomed rations and siesta. Availing themselves of his invitation
and leisure, the prætor, Correliana, Mr. Welson, and Dow made their
appearance. Apologizing for interrupting his studies, Correliana
requested the privilege of subjecting a flower from her garden to the
magnifying power of the tympano-microscope? Assuring him, with
its presentation, that she felt certain, from its extreme beauty and
purity of fragrance, that it would attract a high order of animalculan
existence capable of appreciating its rare combinations. After a close
examination with his unaided eyes, he declared it to be of an
unknown species and as peculiar in its rare beauty, novelty of its
perfume, and delicate pungency of its impression, as the Heraclean
representatives of woman kind were superior and distinct from their
civilized genera in the purity of their habits and customs. With this
combined pronunciamento of comparison as a vent to his
enthusiastic admiration, he placed the flower in the field receptacle
of the tympano-microscope for focal magnifying reflection of its
parasitic habituary residents, for inspection and classification in
substance and sound. With an exclamation of surprise, compounded
of fear and amazement, he started back from the instrument
exposing to view the petals and pistils peopled with a multitude of
diminutive human beings, who were convulsed with sneezing
spasms of laughter, which they tried in vain to suppress with
expedients in common use by our kind. The tympanum in sound
articulation reverberated their tiny cachinnations and sternutatory
explosions with such comical effect, that the prætor and Correliana
were compelled, notwithstanding all their efforts to avoid the
impulsive sympathy of contagion, to join issue with this mirthful
introduction of our savans to a kindred animalculan representation of
our race. While equally subject to the uncontrollable spasms of
mirthful laughter and dumb amazement, the spectators to this scene
of apparent conjurement were held speechless.
The leader of the diminutive apparitions at length leaped lightly, as if
propelled by a sneeze, upon the stage within the reflecting compass
of the tympano-microscope. Then, after a few ineffectual attempts
to regain his composure, he finally succeeded in obtaining sufficient
control to offer the following apologetic address, which gradually
recalled us to our senses; but not in sufficient degree for a
realization of their actual existence as human beings, free from the
magic attaint of fears conjured from superstitious instinct. He thrice
repeated to attract our attention from the stupor of amazement:
“Men of science, and deliverers of the Heracleans, our protogean
affinities!” Our partial attention secured, he continued. “If through
the disability of our Dosch, or chief advisor, our selection as
Manatitlan ambassadors to welcome you, in our people’s behalf as
the preservers of our co-affinities in affection, should prove a source
of discredit from our undignified appearance on presentment, it
would prove a source of lasting sorrow. But we feel certain that you
will extend to us the favor of believing that we are not inclined to
untimely mirth, notwithstanding the example we have given to the
contrary. With the concerted desire to impress you at a suitable
moment with the reality of our existence as a race, Mistress
Correliana probably forgot the keen sensitiveness of our schneiderian
membranes to pungent odors, and with the intention of giving as
much eclat as possible to our introduction, selected from her garden
the most beautiful and fragrant flower of its parterres. The novelty
of our emprise withheld our attention from the flower until it was
placed in your hand for examination, then too late to effect an
exchange, we braced ourselves to resist its effects. Hence our
humiliating condition when exposed to your view and hearing!
Thrown off our guard by the transformation effected in our size and
sound of our voices, and above all by the consternation manifested
in the expression of your faces, we could not resist the impulse of
our naturally mirthful dispositions. That the infection should reach
and overpower the more staid humor of our cousins, you will not
wonder, when you recall your own and our disordered extremes. If
you will control your perturbed emotions for a moment’s reflection
you will be able to realize the irresistible nature of our impressions
under these combined effects. Withal, when our existence and
presence in auramentation becomes familiar as a recognized reality,
you will find in our joyous dispositions a ready explanation for these
ante phases of our first personal introduction.”
Upon this hint, Correliana conquered sufficient composure to
introduce the speaker as Manito, the Prætor of Maniculæ, the chief
city of Manatitla. Then with the accompaniment of a spasmodic
inclination to sneeze, as they leaned over the serrated edges of the
petals, the tribunes were introduced individually by name. This
process was lengthened by occasional suppressed tendencies to
mirthful outbreaks, which gave M. Hollydorf and his companions an
opportunity for partial recovery from their dazed state of
amazement. When sufficiently restored for intelligent
comprehension, the flower was changed for one of less pungent
odor, and Manito from the rostrum point of a petal continued his
address.
“From our diminutive size we willingly subscribe to the designation
your nomenclature bestows upon insect animalities which are but
partially visible to your unaided eyes. Still we do not disdain our size,
for with the Manatitlans it has received the compensating privilege of
a perception that enabled them to distinguish the evident object of
mankind’s intelligent endowment above the instincts of associate
animality.
“Like individuals of your race, ours vary in size. Some among the
Manatitlans have reached in stature a height approximating in a
remote degree to your well formed dwarfs of a standard monstrosity
in the diminutive extreme sufficient for the excitement of wondering
surprise. Our own divisions are expressed in terms rating from the
smallest in stature, which are called tits; these form the masses, but
with a sensible diminution in numbers from an upward tendency to
the second degree of elevation from the majority. The middle class
are styled mediums. With every generation this grade has been
increased in proportion with the decrease of the tits, and ranks in
status with your “well to do” money grade of merchants and
speculators. The giantesco enjoys the highest statutory standing in
the ranks of size, representing your titled duke commanders, and
subalterns of lordly and knightly degree. But these distinctions are
only perceptible to the eye, and in no way arbitrary in the
assumption of prerogative stature rights above those below. As our
scholastic term of education commences with the infant at the age
of two years: the first stage that directs and controls the infantile
perceptions and cravings of instinct is styled pupillage, and is under
the supervision of the censor and nurse, who hold the instinctive
exaggerations of parental fondness in check from birth. This
habilitative stage of matriculation is the most trying for direction, as
upon it depends the matriculant’s after power of self-control. The
second stage of nonage commences at seven, when the self-
devising perceptions begin to expand into individuality, that require
educated direction, and leading encouragement. At fourteen, or the
pubertal stage, the first indications appear for the premonitory
inauguration of status rank established for the distinctions of size.
The initiatory discipline of the scholar entering upon his senior term,
induces the tractor disposition of the censorial advisor, in association
with his juniors; in place of your form system of “bullying” the
nether “fag,” whose weakness makes submission a virtue, when
subject to the classical distinctions of arbitrary power. The seniors
become assistant tutors to the censors and teachers from the age of
fourteen until the close of their twenty-third year, when they
graduate; and after a probationary term of three months’
“courtship,” with the connubial censors’ selection of affiances, are
married. This cursory glance will serve for an introductory insight
into our natural system of education designed for the direction of
our immortal endowment in perceptive flight above the body’s
ephemeral gratification of instinctive desire.
“Of other matters, pertaining to our actual realization of an enduring
happiness, you will be advised by our advisors; as our interview was
designed solely for your recognition and realization of our existence
as a race in diminuendo alliance with your own. Our associations
with your race are of a privileged description, which from the
concentrated acuteness of our sensitive perceptions, enables us to
divine your thoughts by auramental espionage. If you will give a
moment’s investigation to the impressions of thought, when free
from the turmoil of suspicious doubts, which now assail and render
your efforts for reasonable perception void, you will find that they
are all distinctly enunciated in the thalmus auditorium, which is the
focal centre for maturing sensorial observations. Our size, and
practical knowledge of the sensitive departments of your ears,
enables our giantescoes to gain the aural sinus without provoking
titillation, and its proximity to the vibrating portal, or vellum
auditorium, permits our sensitive perceptions of sound to realize
your thought articulations before they are matured for retentive
comparison, or the vocalized utterances of speech communication.
So that in reality, we hold the gigas (the name word we use for the
designation of your race in contradistinction to our own) subject to
our direction, when free from the ruling habits of instinctive
indulgence, which defy control. As the previous knowledge of our
advisers has preferred you to their confidence, I will state that our
means of direction are through thought substitution, which the
giantesco is able to modulate with ventriloquial variations of voice
for the receptive nullification of those derived from their own
sensoriums. Of course, the effects vary with the intensity of the
subject’s command over his own sensorium, and the absorbing
influence of educated impressions imparted from habits and
customs. As an example, I will now state that M. Hollydorf, in his
turmoil of doubts, feels that Mistress Correliana has in some way
imposed upon his confidence; but my informer says that his
impressions are in no wise capable of assuming the power of self
control, so that upon our own responsibility we will exonerate
Correliana from all deceptive intentions; as she was subject to our
control in withholding from you a knowledge of our presence, as the
mysterious source of her guiding premonitions, and means of
obtaining information of human affairs in the world beyond the
inclosing walls of their isolated city. Now, in turn, we ask you to
withhold from your companions the result of your day’s explorations,
that you may observe the influence we are able to exert for their
mystification, and the development of the intangible resources of
instinct, which subserve for the delusive beguilement of reason from
the intelligent direction of creative indications. This much, will prove
sufficient for your night’s cogitations, but to-morrow the Dosch and
his advisors will instruct you in the weightier matters pertaining to
our educating system devised for self control. As you are still
hovering in the clouds of doubt, we will regale your senses, for
composure, with a musical olio. M. Hollydorf, at the period of our
first introduction, was considered an excellent judge of music, and at
times amused himself with amateur compositions, one of which
pleased me, and on my return to Manatitla I presented it to our
musical censor, who adopted and incorporated it with our
salutations. We will now render it, that you may pass censure or
commendation upon the accuracy of our version; for of all the selfish
kleptomanias, that of stealing musical compositions, and mutilating
them in transposition for an author’s reputation founded upon a lie,
is the most contemptible within the range of barren instinct.
Fortunately, only the younger branches of the Mouthpat tribes of our
species have ever been guilty of a witless invention base enough to
seek gratification from so mean a subterfuge.”
With this apologetic prelude Manito marshaled his choristers along
the borders of the dependent curves of the petals facing his
bewildered auditors and rendered the following stanzas with an
effect that revived them from their superstitious fears:—
“From darkness dread, the dawn appears!
Mother of day, whose dewy tears,
Distilled from the labors of the night,
Greet with joy, the sun birth of light.

“Hail, glorious mother of morn!


Beautiful type of woman’s form,
When hallowed from instinctive night,
She hails, at birth, a son of light.”

M. Hollydorf recalling the occasion and source of inspiration, glanced


at Correliana with a furtive look of anguish. For the prompting
source of the stanzas, was a longing desire that woman’s beauty
should be adorned with more lasting “graces” than those bestowed
by the fashionable dressmaker, dancing master, and boarding-school
mistress, in hopeful premonition of an immortality with joys
exceeding the gossiping allurements of a heaven of sense. The look
of sympathy he received in return banished from his thoughts
doubts, and suspicions of supernatural agency. Manito, observing
the confidence expressed in his glance, and the more ready belief of
Mr. Welson and Dow, that the Manatitlans in reality represented a
diminutive department of human mortality, said, that as his mission
for the day had been fulfilled in degree beyond expectation, they
would not prejudice their success by prolonging the interview, but
would leave them with a new zest for the transmission of one of
their best melodies. He then rearranged his choristers and rendered
“Home, sweet home,” with an effect that caused them to join in
thought sympathy with the affectionate harmony of Manatitlan
expression. At the close the prætor and tribunes of Maniculæ bid
their first giga audience good-by, and disappeared from view.
Correliana then signaled the stoop of her favorite falcon Merlin from
his circling wafts above the latifundium; after a short perch of a few
moments upon her wrist, he was despatched, as she announced, to
Maniculæ, bearing back the prætor, Manito, and tribunes.
Mr. Welson was the first to break silence after their departure, with a
long drawn,—“Whew,” as a prelude to the exclamation, “Ah, ha!
mistress Correliana, we have the secret now to all your mysterious
enactments, which inclined those the least superstitiously prejudiced
to credit you with an inheritance tinctured with the pretensions of
your sibylline ancestry. But our wondering amazement is scarcely
less than it would have been under the superstitious impression that
you really possessed the power invoked by the ancient sibyl. Still the
manifestation of a visible source, however small, is far more
agreeable to our perceptions.”
Correliana answered, with a pleading smile, “You will surely forgive,
and pardon me for retaining a secret of such importance, in the face
of all your kind and confiding acts, now that you have learned that I
received it in trust from a source so well qualified with the essentials
of prudent direction? The Dosch, however, will more fully state the
many causes that rendered its retention desirable. But of this you
can rest assured, the Manatitlans are bonâ fide representatives of
animalculan humanity; and when I state that we are solely indebted
to them for our redemption from the bondage of instinct, you will
understand the nature of our trust in their direction.”
Beckoning the stoop of a falcon, it alighted upon her wrist. She then
exposed, beneath what they had supposed to be an ornamental
attachment of designation, a howdah. Then taking from her pocket
pouch a reel of filmy thread,—attenuated to a degree that rendered
it almost imperceptible to the eye, she wound the free end around
Mr. Welson’s finger, then asked him to try its strength. With his
utmost exertion, tried with many devices for its separation, the
thread remained unparted. She then explained that the materials,
from which, in perfect combination, it was drawn, were mineralized
with flexile and vis inertia substances in adaptation for a great
variety of purposes, subserving for the protective furtherance of
health, comfort, and personal purity. Also for protective defense, “as
it is impenetrable to the swiftest fledged missiles when wrought into
textile fabrics.” But its most esteemed peculiarities are repulsive
resistance to uncleanly cohesion, combined with a nonconducting
neutrality in the transmission of cold and heat, causing the refuse
excretions of the body to evaporate without obstructing the rejecting
orifices of the ducts, when used in its adaptation for raiment. In
part, we have been able to imitate this valuable acquisition for the
protective preservation of our persons from decomposing agencies,
which are constantly in a fermentable and putrefactive state of
conceptive action for the production of renewed vitality varied in
degenerative series. But of these matters the Manatitlans will advise
you in due time. In your present state of perturbation it will but little
avail to extend our conversation into details that require for a
complete understanding consecutive exposition.
After Correliana and her father had taken their leave of the four
favored witnesses of the new grade revelation in the status of
humanity, they remained standing in the same position, absorbed
with contending emotions of doubt and belief, until aroused by the
approach of Dr. Baāhar and the padre. Then, with a forced recovery,
M. Hollydorf announced his intention of discontinuing his
explorations for the time being; which afforded his assistants a
desired relief, for with their few hours’ occupation they had
discovered in themselves an unwonted dislike for the professional
details of their occupation. While on their way to deposit the
tympano-microscope in the house designated by Correliana as the
one intended for the reception of the Dosch, the four maintained
their thoughtful silence until after they had bestowed upon the
instrument of revelation a careful disposal. Then M. Hollydorf
sententiously remarked, “Although still perplexed, I am confident in
the full integrity of Correliana’s assurance that these Manatitlans are
bonâ fide embodiments of humanity, with intelligent capabilities
superior to our own! But it is hard to reconcile them with any of the
preconceived ideas of our race. They certainly advocate, with
practical demonstration, a more direct and reasonable way for the
attainment of present and prospective happiness, than that of
redemption from sin by saving grace?”
“By all that there is in us, capable of assuming the control of
judgment, we cannot avoid their own, Miss Correliana’s, and the
confirmation of our own senses in attestation of the fact of their real
presence,” added Mr. Welson.
“For my own part,” said Mr. Dow, “there is to me nothing more
strange in their discovery, than in that of the Heracleans, now that
we have recovered, in a measure, from the first startling effects. It
has occurred to me frequently, of late, that there must have been
some interior creative object in the gradations of instinct, and
ultimate alliance of superhuman intelligence with the highest grade?
It is certainly impossible for me to reason myself into the belief that
we have been endowed with a perception of goodness, and the
necessity of purity for its attainment, to have them dispensed with in
life for the substitution of the instinctive greed of selfishness, with
the accommodating proviso of repurification by an act of saving
grace! Neither can we disguise the fact, that we now think and act
quite unlike our former selves, with a sensible improvement in
happiness, in freedom from the selfish accessories we formerly
thought necessary for its assurance.”
At this point they were interrupted by the entrance of the prætor
with his wife and daughter, who came to inquire if M. Hollydorf
wished to suggest any change for the better accommodation of his
instrument with regard to light? In the expression of his satisfaction,
M. Hollydorf alluded not only to the wonderful preservation of the
buildings, but furniture, which appeared, in style, to have been
coeval in manufacture with the remnants seen in old Heraclea. In
explanation the prætor said that it was much easier to preserve from
decay than to restore ruins. But the means of preservation had been
bestowed by Giganteo XVI., Dosch of the Manatitlans, as a legacy to
the sons of Indegatus, associate prætors of Heraclea, who were the
first of our race that became personally acquainted with animalculan
humanity. “You will find all of the unoccupied houses of the city in
like good condition with this, and equally free for your inspection
and occupation.”
As the occasion was opportune, M. Hollydorf consulted with those
present how he might prepare a statement of the day’s
developments sufficiently credible for the acceptable belief of the
Home Society? The prætor advised him to defer his cause of
perplexity to the Dosch, who would resolve it readily, from a
personal knowledge of the characteristic peculiarities of the
members of the R. H. B. Society. Then Mr. Dow preferred his petition
for their united aid in the advancement of his historical compendium
of the Heracleans. This all were pleased to accord, as it was through
his indomitable perseverance that the discovery was accomplished,
before the City of the Falls had been reduced to the tenantless
condition of its senior counterpart. As he was referred to me for
special aid in compilation, from his lack of knowledge in the
constructive use of the Heraclean idiom,—which was to us personally
a source of mutual regret,—it will be well to state in anticipation of a
similarity in diction of our separate labors, that I have been in no
way beholden to him for the style I have adopted in recording the
historiographical account of the corps investigations. I trust that this
egoistic explanation will prove sufficient in efficacy to redeem me
from plagiaristic odium?
CHAPTER XII.

The prætor and his family, including Cleorita and Oviata Arcos, with
the Four, awaited, on the morning succeeding the eventful day of
Manito’s animalculan introduction, the coming of the Dosch of
Manatitla in the audience chamber of the house, dedicated by
Correliana in aptitude to the developing powers of the tympano-
microscope, “the auriculum.” After a short delay of expectation, the
courier falcon appeared at poise, from which in swift descent it came
in downward incline direct to its perch on Correliana’s wrist. But a
second elapsed before the tympanum reëchoed in cheery tones of
salutation the voice of our expected visitor. Our attention attracted
to the field of magnifying reflection, discovered a coterie of
animalculans, of nearly the same size, grouped about the speaker.
With the salutation, “Afferens scientiam errantes gigantes,” he
addressed us as follows:—

For ages untold, our race have waited in patient expectation for the
morning’s dawn when they could salute yours face to face, and
impart to you a source of happiness that in life realizes communion
with immortality. To us has been vouchsafed this coveted privilege,
and it shall be our study to improve it to your advantage.
Notwithstanding the malapropos accident—casting upon Correliana
an arch glance that wrought for her face a scarlet veil—of yesterday,
which detracted from the dignity of an introduction so important to
the regenerative welfare of your race, we were glad that auspicious
mirth was the trophy of the occasion, rather than tears of grief, of
which we shall be mindful in adjudging our censure to the cause.
Joyous mirth we have esteemed an evidence of goodness, for it
declares itself beyond the reach of selfish impediment that breeds
evil intention; even when the foibles of our kind become the subjects
of humorous provocation. Mirth is ill timed, when preconcerted with
a knowledge that a portion of those present will be unable to
appreciate the humorous incentive; as it opens wide the door of
suspicion with your peoples, who have been educated under the
partial sway of national habits and customs. Dissimilarity in habits
and customs, under national patronage, begets from seeming
incongruity a disposition to gibe with missile retorts, fledged and
tipped with ironical sarcasms, as rankling in effect as the pointed
weapons in the mouth of Mr. Welson’s knighted chief. To be frank, if
the ludicrous scene of yesterday had occurred with matured
acquaintance, I should not have spared the demure, but conscious
blushes of the fair medium. Our first acquaintance with you,
although not mutual in personal recognition, is of older date than
yesterday, and upon it has been founded our predilections, which in
train have led to the many concurrent circumstances favoring the
happy issue of our more direct scheme, devised for the liberation of
your race from the pampering trammels of instinct. It would have
been quite easy for our first giantescoes to have obtained an
introduction to your race, if they had emulated the desire of being
exhibited as an iotian monstrosity for the gratification of giga greed
and curiosity. But fortunately for our present hoped-for issue, our
system of education, devised for the development of affectionate
confidence, encouraged the past generations of our race to wait for
an opening free from the entailment of experimental disadvantage. A
knowledge of our race for the gratification of your scientific savants
curiosity, would have been as profitless for good, as their sight-
seeing acquaintance with the moon and stars. Our Manatitlan sages
have from the earliest period recommended extreme caution to
prevent the premature introduction of our race to yours. The
favorable indications to be watched for in premonition of a
successful issue were those of extreme folly, heralding a closing
cycle; for the contrast afforded by the result of our happy example
would attract kindly imitation of those inclined to affectionate
goodness.
Desideratus, one of our most approved prognosticators, deposed
that the affections of woman afford the best test of a closing giga
cycle. When frivolity and the gossiping comparisons of vanity gain
the ascendency over natural affection, inherent as the birthright of
woman, then you may know that the symbolic serpent’s tail has
received its final circle inclination for union with the mouth. This
inclination was foreshadowed in the eighteenth century, with
invention of power looms; which with the largely increased
acceleration of steam, fabricated in excess of the world’s actual
requirements for healthy protection and comely adornment. With
steam as an inductive aid to civilized progression, the Eugenic era
was ushered in, when the frail mortal tenements of women became
subject to empirical vanity, and in rivalry, the standard-bearers for
cumbersome mechanical products, to the utter perversion of healthy
elasticity, comfort, and their special vocation of fostering for
immortality affectionate goodness. This dereliction of giga women
from their manifest duty, has brought in train domestic and dynastic
miseries, while from dreary self conviction their hopeless prospect
closes with the grave. As we have now adventured the only
opportunity that has ever occurred, with a prospect of success, for
extending the influence of our happy experience to your race, we
will with our introduction premise a description of Our Country.
Manatitla is situated in the Andean district of La Plata, with a
southern aspect. It occupies a space between the parallels of 20°
40˝ and 30° south latitude and 40° 50° west longitude, embracing
an area of forty square furlongs, of Manatitlan measurement. Its
surface is diversified, combining in well-defined variety mountains,
hills, and vales, with their concomitant streams, lakes, and brooks;
affording with arable advantages, prospects unrivaled in beauty,
which have been enhanced by the grateful labor of its inhabitants in
acknowledgment for the benefits bestowed. The climate is salubrious
and free from the extremes of heat and cold, having a valley altitude
varying but little from six thousand feet above the estuary of the La
Plata. The adjacent country is occupied by the giga and animalculan
wild hordes. The Minim is the largest river. Its source is derived from
Lake Areta, located in the Andean spur of Ultisimma; flowing in a
northeasterly direction it finally becomes tributary to the Vermejo.
On the northwestern bank is situated our chief city, Maniculæ. Forty
of our miles below, on the same bank, is situated the City of Iota,
containing twenty thousand inhabitants. Nearly opposite the last
named city, is the town of Speck, its inhabitants, in transition, being
chiefly occupied in the manufacture of auro-silicate for edificial
construction and textile fabrics, rendering them indestructible and
repulsive to cumulative adhesion. The entire population of Manatitla
is estimated at eighteen millions, with a healthy tendency to a
continued rapid decrease in number, from causes which will be
described hereafter.
The Traditional History of Manatitla, is coeval with the imaginary
date of Mauna Che’s advent as a deity from the La Plata into Alta
Peru, reaching in your time measurement to eleven thousand years,
which probably embraces relics of truth, among others a like origin
with the Heracleans; as we are without doubt descended from
castaway parasites of gigas from the eastern continent. But as it is a
constant repetition of acts of oppression, in kind with your classical
written history, we will not shock you with their rehearsal.
The Actual, or Written History of Manatitla, was commenced in the
latter portion of the reign of King Primus, from which dates our
transition period, or emancipation of our people from the instinctive
rule of the stomach and its engendered lusts. But from its
resemblance in factional disruptions to your own, culminating in a
parallel to their cycle condition, we will only allude to the causes that
immediately preceded, and in tendency wrought the changes that
finally effected partition from old habits, and the reverenced usages
of instinct. Arbitrary, religious, and civil exactions, seconded by
compulsory persuasion against all nonconformists, signalized the
tendencies of the period, and gave birth to an ultra instinctive race,
styled liberal democrats, who claimed the inalienable right of
suffragian equality bestowed upon the lower orders of the animal
creation, in the exercise of their untrammeled state of field and
forest freedom. The regular national church, and king, persecuted
the nonconformists and schismatics with dire vengeance, under the
patronage of godhead personification, translating the living heretics
with tortures, burnings, and repetitions of drowning suffocations by
resuscitations from a moribund state, and like admonitory
chastenings in transition for the final judgment of their long
enduring and merciful godhead. The persecuted schismatics
emigrated to distant lands, in order that they might worship their
God of reformation in freedom from invidious restriction of rites.
When located, they in turn used the same strenuous arguments to
subvert the tribal forms of worship. Gaining the ascendency, with
destructive agents, they deprived the aboriginals of local option,
forcing them to conform, with death and displacement, until they
had obliged the remnant descendants of their benefactors to accept
a conditional exile on the outskirts of progressive civilization, in
transit for a grave ultimatum. The notable invention of letters
signalized the latter portion of the reign of Primus, and to it he laid
claim as king rief discoverer; which in the law of entail declares the
subject a utensil to be used for the exaltation of kingly prerogative;
being identified with everything that pertains to the glory of the
throne and its legitimate scionry, his assumptive appropriation was
sustained with ministerial affidavits and legal opinions, in attestation
of King Primus’s great literary and inventive capacity, allied to
clemency, justice, and generosity. But after his death, there was
found concealed in the hut of a bard, who had disappeared just
anterior to the announcement of the king’s invention, parchments
inscribed with the newly introduced characters, which set forth the
bard’s adverse claims in these terms:—
With symbolic signs, I have found,
The art of representing sound.
On distant business one can send,
Or with them greet a distant friend.

From this scrap of post circumstantial testimony, it is evident that he


either intended to filch from the king, or that the king did obtain his
reputation for literary invention from the fior’s or bard’s genius. The
latter presumption receives probable confirmation from our aura-
mention of similar pretentions to authorship advanced by giga
potentates of the past and present age.
The rule of King Primus was of the most despotic description ever
enforced by an arbitrary will over the weak subserviency of plodding
human instinct, which in kindred affinity with the dogs, is content to
give vent to a growling yelp when the freedom of its tail is ground
by the heel of the oppressor. Whenever these constitutional growls
foreboded an insurrectionary show of teeth, the gregarious spirit of
commune revolt was allayed by the grant of a new charter of rights,
but if this precedental sop failed to lay the retaliative spirit
engendered by oppression, the current of their wrath was turned
against their neighbors, with arbitrary conjurations as the
provocations, of war. As an infallible test of his infallibility death
displaced him to make room for a successor. The people put on
sackcloth, and rolled in the dust of humiliation, in mournful
semblance of grief for the loss of their demi-god, whose dealings
had been grievous and past finding out.
After public eulogistic exaltations, funereal orations and lamentations
had subsided, his only son was proclaimed successor with jubilant
rejoicings. But Justinatus, the son, resolutely announced his
determination to reject the succession, recommending the people to
select from the wise men of the nation a council to decide upon a
form of government best suited in adaptation for the requirements
of the people; but they with their faces and thoughts turned to the
rear, in reverence for past usage, clamored for a king. But they
found in Justinatus a man as determined for the enforcement of
right, as his father had been for wrong. He commanded them to turn
their faces to the future, and act according to his direction, not for
themselves or their generation alone, but for those who were to
succeed them. Submissive to the letter of his direction, but in
conformity with precedental creed, they elected eight men by ballot,
and instructed them to proclaim Justinatus king. With this evidence
of their precedental stupidity he assumed the power of directing
them for their own good, selecting four men of as well approved
wisdom as his judgment could discover, he placed at their head his
early instructor as chief advisor, with the titled designation of Dosch.
After this inauguration of an advisorial system, Justinatus, as a pupil,
received from them instruction; combining, with his advance in
knowledge, his aid in promoting the practical development of means
for insuring equality in thought and judgment, necessary for the
promotion of the common welfare.
In consideration of the fluctuating variations incident to common
usage, their first endeavors were directed for the devisement of a
method that would insure exampled conformity in act. The difficulty
of effecting uniform compatibility, in the then present habits of the
people, soon became apparent. As a dernier of preparation, a
division of labor was enforced, according with the personal healthy
capacity of each individual. Under this system of equalized industry
for community support, the drones were soon discovered, and
subjected to the taskmaster supervision of those capable of
exercising self control for the common good. Of course the outcry of
slavery and oppression became rampant with the ill disposed and
vicious; but compelled association with the good soon wrought a
happy change; but not before many revolutionary schemes of revolt
had been planned by the democratic majority, and nipped in the
bud. The great bar to the full success of the renovating process, was
the all absorbing lust for selfish gratification, procured from the
sacrifice of others’ welfare. Exhortations and demonstrations of the
evil effects and instability of pleasures having a material dependency
upon the appetites and passions of the body were of no avail.
Stimulating provocations, for the production of inordinate appetites,
had held an increasing sway from time immemorial, and the
infatuation still continued to subvert the efforts of the Doschate of
advisors for the establishment of a rational source of happiness, that
should extend its blessings for the reciprocal appreciation of all.
Laws and penal restrictions proved of easy evasion, and the local
option of individuals native to Manatitla, having a desire to establish
in perpetuity the happiness of their people, as a beacon light of
example, were openly defied by aliens. To restrict emigration, which
was claimed as a privileged right ordained as an inherent instinct of
animality, they did not dare! as it was declared by the majority an
assumption that would directly controvert the rights of septs and
nationalities guaranteed by deity. The civilized progenitors of the
races represented by tribes and small nationalities occupying the
country adjacent to Manatitla, had undoubtedly been parasitical
attaches to giga castaways like those of the Manatitlans. This
stumbling block of perversion, continued from generation to
generation for centuries; until the advent of the Dosch Desiderata,
who with the aid of his advisors, turned the tide anarchy by the
adoption of foreigners as guests, withholding the privilege of
citizenship for bestowal upon their children’s children of the third
generation. This inaugurated an era memorable for the change of
precedental precept, based upon warlike achievements, into a
source of abhorrence with the increasing minority. Thoughtful
consideration bestowed upon example for the transmitted
improvement of future generations in goodness, produced a
wonderful effect upon the actors of the then present generation by
the induction of harmony from reciprocal goodwill. Through his wise
deductions, that clearly demonstrated the necessity of self
government in association with others, woman threw off her shroud
of vanity, and labored earnestly for the renewal of her lost prestige
of trust, bestowed for the transmission of purity and goodness. The
incipient struggles of the minority, under the direction of Desiderata,
were short and decisive; but for the time being evoked with
groveling bitterness fierce invective from the majority. A memorial
address of remonstrance, from the democratic majority, against the
abrogation of the rights of citizenship, in the first and second degree
of alien residence, set forth, that God had created all men free and
equal without respect to color or habits, with the command that they
should work out their own way of salvation, and that each individual
was guaranteed an inalienable right to participate in the government
of his fellow man. “And that, whereas, as hereinafter stated,” the
citizens of Manatitla represent different nationalities, it was but just
and right that they should have a voice in the council of advisors, in
order that they might guard and protect their own liberties and
safety. With this preamble, imitated from giga precept, the contest
can be realized without repeating the stale platitudes of democratic
subterfuge. The promulgated reply was as follows:——
“The Dosch of Manatitla and his advisors, to the alien guests
(heretofore, in acceptation, adopted citizens) of their people and
country, greeting! We have received your petition, and have
reviewed with care the requests you have proffered. Our answer is
set forth in the subjoined proclamation.
“‘To the residents of Manatitla of foreign birth! As it is our matured
desire to emancipate the people native to our country from their
own degrading habits, and the deleterious example of those derived
from extraneous source, we herewith announce the corrective
enactments we have devised for the collective well being and
happiness of all within our advisorial control. As it is manifest, from
the conclusive evidence of creative design, that mankind are in
bodily and functional alliance with all the different grades of
animality, through the representative agency of omnivorous instinct;
it is also as clearly evident that his endowed superiority resides in his
privileged capacity for self control, with an ultimate intention equally
apparent. For a rational realization of this saving clause, an easy
estimate can be made of all the tangible sources of happiness held
by human kind independent of the body’s instincts. As upon these
depend our hopes of happiness in life, in premonition of immortality,
it is imperative with all to hold them in reciprocal cultivation for the
confluent control—in subjection—of the passions inherent with the
vital functions of animality. As woman, the endowed source and
mother of our race, when free from the attaint of man’s selfish
invention, expresses a natural repugnance to everything opposed to
purity and goodness, and in the full fruition of her endowment is
reverenced as the germ ideal of immortality; we have through her a
direct indication of the immortal source of happiness bestowed with
creative intention for the local option of mankind. In negative
assurance, that purity and goodness is the endowed source of
happiness; woman when lost to their sustenance, becomes
hopelessly degraded, sinking with loathsome taint below the vilest
brute, and utterly lost to the instinctive ties of affection, will not
hesitate to sacrifice mother, husband, sister, and child to the
poisonous lust of her reptile selfishness.
“‘That the cause of this ferocious degeneration, which has the power
of transforming woman from the glorious ideal of immortality, into
an object too repulsive for her destroyer to find in his vocabulary
words of beastly vulgarity sufficiently strong in the odor of
putrefactive designation for expressing in comparison the foulness of
his scorn, is derived from man’s insatiate devisement, cannot be
denied! For the exampled amendment of this woful cause of
degeneration, we have provided family censors, and nurses, in
sufficient number for present requirement, whose duty it will be to
hold in check parental indiscretions, and mutations incited from the
instinctive variations of fondness and petulance. With the close of
the second year, the provisorial charge of the family censor and
nurse will be transferred with the infant to the national school of the
department in which they reside, their guardian duties continuing
until the seventh year, at the commencement of which the child is
matriculated as a pupil, with full scholastic adoption by the censors
and teachers. For the additional furtherance of our system,
subserving for the vindication of creative indications for the
elimination of our immortal endowment, we have separated the
sexes that in the process of educational attainment they may remain
free from the natural temptations inherent with instinct.
“‘The benefits conferred by our national system of education you
have realized in the peaceful confidence and unity imparted in after
association; also the sequent inseparable unity of our marriage
conjunctions. In truth, they are happily too apparent to be gainsaid.
So that in accepting our hospitality as guests, you cannot avoid, in
courtesy, a willing recognition of our rights of freehold preëmption,
for preserving our habits and customs of purity and goodness, intact
from the infringements of foreign attaint; or question the justice of
our privilege of enforcing their observance; or in default, question
our corrective enactments devised for the culprit’s realization of
practical liabilities incurred by the transgressor. These will be strictly
enforced. But that there may be no cavilings, with the hue and cry
of barbarous excess in punishment, we have provided
accommodations adapted to the specie degradation of the lower
orders of animal instinct, of sufficient capacity for associate
occupation by human emulators of bestiality in kind; through all the
gradations from the omnium gatherum ‘swine,’ blood thirsty ‘tiger,’
down to the reptile conservators of poison. For the correction of
women who have lapsed from their vocation of conservators of
purity and goodness, into the incipient stages of gadding and
gossiping detraction, we have provided cage apartments for their
mutual accommodation with birds representing their kind, in the
hopping vent of thoughtless words. We have provided for initiatory
correction pavonias (animalculan peacocks) for the exemplar
admonition of the vain-glorious; and jab-boracidas (jackdaws and
magpies) for the likeness of gossipping repeaters; for the loud
mouthed and strepitant clackitas (parrots and cockatoos), and for
the ‘fashionable’ imitators, simia curios (female monkeys). These, as
occasion may require, will extend invitations to their ‘likes’ of the
human sex to attend their levées, which will be subject to the
auditorial outside inspection of the public, if morbid curiosity should
prompt witnesses to the ordeal of misery. These provisos and
corrective conceptions have been devised for, and proved to be of
universal benefit, with the evidence of well attested experience; and
we desire your coöperation, as guests, for the perfection of our
system designed for the advancement of purity and goodness. But
shall strenuously insist that your children shall become participants
in the privileges conferred by our system of education.’”
As you will readily conceive, this proclamation of Desiderata and his
associates caused the fulmination of bitter invectives and threats of
vengeance, which served to vindicate the wisdom of the predicated
precautions. But the writers of the period state that in a few
generations the influence for good extended to savage tribes, who
petitioned for admission of their children into our national schools.
The improvement was so marked in its demonstration of a realizing
source of happiness, that but three centuries elapsed from the
period of organization, before the foreign nationalities were
peacefully absorbed, their subjects becoming educated citizens of
Manatitla.
With the illustrative sketch that I have given of Manatitla’s transition
period of extension, you, and the readers of the historiographer’s
transcript, will readily understand the inceptive source and stages
that premised the establishment of our practical system of
education. But owing to the limited number of words and terms for
the expression of purity and goodness, with their practical variations,
in your languages, we are of necessity obliged to use them in
frequent repetition.
CHAPTER XIII.

At this stage, M. Hollydorf interrupted the Dosch, with the assurance


that he was fully convinced not only of the actual existence of
animalculan humanity, but of the tangible wisdom of Manatitlan
providence, shown in their inauguration of rational system for
educational discernment, necessary for the fulfillment in life of happy
intention. “But the difficulty of making the home society realize by
letter the multiplying wonders in the course of our discoveries,
puzzles my invention for a credible method of imparting the
information without subjecting my sanity and integrity to
impeachment. If you can, in your wisdom, resolve me how I may
absolve myself with credit in my official correspondence, I shall
certainly feel grateful.”
The Dosch smilingly assured him that he had no occasion for fear, as
the sensational novelty of truthful record, with a little auramental aid
rendered by the Manatitlans in the substitution of thought, would
suffice for the ready adoption and belief of his report, as a
marvelous indication of the age, in evidence of rapid progression
under German lead. With this closing advisorial suggestion the
Dosch and his companions departed for Maniculæ.
The abstracted mood, fitful and irrelevant conversation, with the
daily convocations of the four conservators of the Manatitlan secret,
in the house under the northern temple’s eastern wall, did not fail to
attract the wondering curiosity of their associates. But as M.
Hollydorf had emancipated the members of the corps from field
duty, they found no lack of pleasing occupation in rendering useful
aid to the Heracleans. Doctor Baāhar had enlisted the padre, for a
quid pro quo, in the pursuit of butterflies; the two curators of sound
engaged in herding and woodland pursuits; Jack and Bill, under
Heraclean and Kyronese instruction, engaged in “navigating” a small
garden plot in the latifundium, with amusing success, while
Viscouswitzs, the artist, wooed the Indian maids of the Vermejo
tribe.
The Dosch, in continuation of his historical sketch of the Manatitlans,
passed to the period noted as the Heraclean epoch.

The third century of your Christian era was well advanced before
they were aware that there was a race of white gigas occupying a
city not far remote from Maniculæ. At that period distance was
measured by the time occupied in conveyance by the insects then in
use for transportation; but as the vitality of their bodies was subject
to deciduous tenure, travelers were obliged to confine their
researches within the limits of populated districts, between which
adventitious paths were well defined. The defective means of
communication with remote Manatitlan provinces had ever been a
source of sincere regret. Still the lack of advancement in the art of
locomotion had never interfered with the actual realization of
happiness. The wood roach and beetle were used as insects of
draught in the preparation of the soil for cultivation, and the flea for
equisaltation, it being the favorite mount for distant journeys and
pleasure excursions. The first innovation upon these time honored
extra locomotive adjuncts, was effected by the persevering ingenuity
and daring courage of a medium named Bussee. He had from an
early age devoted his thoughts to natural history with the practical
intention of improving the native stock which was too diminutive to
be made available for transportation. As a boy he had been noted
for a quick practical judgment, displayed in his ability to eke out
from scant means the fulfillment of a desired end. Many of his
improved domestic utensils are still in use, in evidence of an
inventive genius in advance of his age. His habits were erratic,
showing an impatience that disdained restraint within the bounds of
precedental usage. Still his affectionate desire to confer public
benefits attracted a grateful solicitude whenever his absence was
unusually prolonged. But as he rarely returned without some
valuable acquisition, confidence in his ability for self-protection
waived anxiety. At length an absence of two months without
communicating with his family, aroused public sympathy to such a
pitch that a search was decided upon. In preparation the citizens of
Maniculæ had collected in the anthemique to consult upon the most
feasible means of conducting the search.
When the direction was decided upon, and they were issuing forth
for its prosecution, they were startled by the gyrations of an apis
isolata (solitary bee) in close proximity to their heads. After a few
eccentric evolutions which excited a commensurate degree of alarm,
their fears were relieved by a shout of laughter in the jovial tones of
the absentee, who, by a skillful direction, caused the bee to alight in
their midst. When sufficiently assured of freedom from danger, his
parents and the Dosch approached near enough to obtain a view of
his mechanical appliances for guiding his prize. Between the wings
of the bee, upon his back, a net with latticed films, supported in
dome shape by stiff fibres, was attached. This turret was retained in
place by filaments, which passed beneath his body, in the
articulation between the body and thorax, so that his movements
and winged action were not impeded. To the antennæ, on either
side, were attached filamental guides, or reins, for directing his
course, the proximal extremities being coupled within the pilot cone.
When assured of the strength and security of the attachments, the
Dosch and parents of Buzzee ventured on a short experimental
flight. As the insect circled, in company with his mate, to gain a bee
line, the daring volantaph caused him to execute a variety of
intricate evolutions, which at first alarmed his passengers, who
expostulated with him in reproof for his temerity. But when he
explained his wish to show them how completely the movements of
the bee were under his control, they no longer offered objections,
their fears being turned to admiration. When satisfied that air flights
could be conducted with more ease, safety, and swiftness, beyond
the most sanguine expectations of ancient or modern Manatitlan
prognosticators, his enterprise was highly commended. When landed
the Dosch and advisors expressed a desire, in behalf of the people,
to listen to a relation of his adventures in the anthemique, as it
would be the means of avoiding rehearsals from hearsay, with the
defects that of necessity were attendant upon individual versions. An
hour before evening song the anthemique was thronged with the
citizens of Maniculæ anxious to hear Buzzee’s relation of the
expedients used for a capture so important in its prospective
bearings to the people of Manatitla. To enhance the clearness of his
demonstration, and at the same time show the dazed docility of the
bee, Buzzee directed his flight to the cantilor’s rostrum, and after he
had settled addressed the assemblage from the pilot cone, in
substance, as follows:—
“Although no stranger to your manifestations of affection, I am well
aware that in appearance I have been remiss in rendering you
suitable returns; but am certain that your confidence in the integrity
of my intentions will exculpate me from meditated indifference. I am
now happy in being able to bring you tangible proof that my
wanderings were not prompted from motives of selfishness or
disdain. From my childhood I have listened in silence to the oft
repeated regrets that our extraneous means of locomotion were
limited to insects so lacking in the instincts of intelligence necessary
for successful direction. Those available for locomotion were too
ephemeral in their term of existence to be trusted for conveyance far
beyond the habitable limits of our country, which from the illimitable
firmament seemed to be but a mere speck upon the earth’s surface.
With a curious desire to learn the wonders of creation overshadowed
by the starry canopy, my earliest thoughts were directed to the
acquirement of the means necessary for safe transportation above
the earth’s surface. My thoughts were at first naturally directed to
artificial wings as the indicated means of progressive transposition
from earth to atmospheric space, without giving thought to the
consideration of ponderable adaptability. Human mortality, which
requires omnivorous support, declares itself ponderable in the vis
inertia of earth, in contrast with the airy attenuations that bespeak
adaptative intention in creating the tenants of space. In addition,
with the successful achievement of working wings, there would be
inevitable friction with the uncertainties of wear and derangement in
flight, with awkward position of ponderable suspension in space for
repairs. So my inventive genius was fain to hold itself convinced of
the futility of subverting the order of elementary adaptation,
designed by the Creator for the perfection of His intentions. Self
convicted with the foolish audacity of my labors to safely suspend
with motion, and locomote with facility ponderable humanity in
space, I bethought myself of man’s privilege of making subordinate
organic vitality, with legitimate kindly motive, subservient to his
desired facilitations. For the elucidation of my thought suggestions I
directed my investigations to insects of flight, to select from their
varied species one suited to our requirements. The primary
qualifications necessary were sagacity, supporting wing expanse,
strength, longevity, and equal motion in flight, with instinctive
perception of individuality sufficient for submission to our kindly
direction. The efficient qualities indicated for the selection of a
winged conveyance, were first, size, with an adaptation for control,
in combination with a supporting buoyancy in excess of its individual
requirements. In the second degree intelligence, with a longevity
sufficient for compensative training, and memory capable of
retaining the imposed impressions, subject to the recognition of
personal direction foreign to their own volition. Added to these
essential qualifications, it was desirable that the insect should be
naturally inclined to sustain a long and swift flight. Bees had early
attracted my attention, but there were many objections to their
adoption that seemed insurmountable. Multitudinous in association,
and individually aggressive, were primary defects in disposition;
while in industrious habits and vocation they were subject to routine
enactments, which together with the tenacious nature and method
of collecting and disposing of their food threatened to end my
ambitious projects, in trial with them, in death from suffocation, or
waxed adhesion to their bodies or cells. The fear of being stalled and
borne to their cells for living incorporation, raised an insuperable
dread, that prevented me from coveting an experimental
acquaintance with the working orders of their kind. Often in my
wanderings I have passed beyond the boundaries of Manatitla in
search of a locomotive desideratum, which I had supposed
necessary for the welfare of our race, as well as a gratuitous vehicle
for the gratification of my covetous desire to rise into the realms of
space, to survey beneath our terrestrial place of abode. A month
since I was returning homeward sad and dispirited with continued
disappointments, when at the close of day, while the glowing tints of
the setting sun still lingered in the glory of their parting adornment
to foliage and flowers, I was attracted by the swift whirr of strange
insect wings. In a moment my attention was drawn with intent
desire toward a pair of insects bearing a hybrid resemblance to the
bee family. After a careful reconnoitering inspection, seemingly
directed, first, to the quality of the flowers of a tropical honeysuckle,
and secondly, to see if they contained insect occupants, they
alighted upon the petals of the fairest. Unlike the hoarding selfish
instincts of their congeners of the bee kind, they premised their
labors with playful dalliance, partly upon wing and with sprightly
pedal evolutions, while darting in chase and counter chase in and
out from the petaled cups of the flowers. In a few minutes their
playful antics and fondlings ceased, then the male with an autocratic
appearance of gallantry assisted his spouse to load herself with the
sweets and waxy exudations of the flowers, this accomplished he
sent her unescorted away, evidently to unload in their store house.
During her absence he devoted his time to a general inspection of
the flowers, with the evident intention of selecting the best. In one
he found a belated droniva (a tropical representative of the bumble-
bee family) who was ejected without ceremony, although double the
size of the audacious usurper. His activity, independence, and cleanly
regard for his own person, disposed me to excuse his cavalier
exaction of service drudgery from his mate, as the duty seemed to
afford her pleasure. In fact the pair impressed me so favorably, that
I determined to avail myself of the opportunity to secure a
permanent attachment.
“Years anterior, as you are aware, I perfected a harness in
anticipation of the fulfillment of my hopes of being able to make a
capture suited for our locomotive requirements. This I had carried
with me in all my excursions, and while my coveted prize was
engaged in his erratic flights, I placed myself in ambush in the
fairest flower of his selection, and had the gratification of securing
him in leash before the return of his mate. He soon became aware
of unusual restraint, and curious to learn its cause made
experimental flights which gave me an opportunity to test the
success of my invention, and I was delighted to find that I could
direct his course with ease. Seemingly puzzled at the loss of his
voluntary power of direction, he made every available effort to learn
the cause of his sudden bereavement, and was pursuing his
investigations when his spouse returned. With mandibulations he
quickly communicated to her the restraint that had been placed
upon his movements during her absence. With evident anxiety she
commenced a search for the impedimental cause. In a few moments
she discovered the filamental guides that I had attached to his
antennæ beneath the carapace, but failing in her attempts to
remove them, after a short consultation, they rose in flight from the
flower to the bee line of their home with a marked show of anxiety,
which made me feel a glow of regret that my selfishness had been
the cause of their disquietude. Once only, in homeward flight, did I
attempt to subject him to a variation in course, but it caused such a
trepidation in his mate that it was with difficulty that she recovered
the balance movement of her wings. Reaching their cell, which was
in a fissured ledge of basaltic formation, they held another
consultation and investigation, during which my turret cone was
subjected to a close examination, but the tough silicothed filaments
were too strong for removal by her feeble efforts. Finding his strange
investment inevitable, and attended with but slight inconvenience,
he, at last, with cheerful philosophy, soothed the anxiety of his
spouse with endearments, abated of their autocratic patronizing air
of superiority. This show of appreciation for his mate’s solicitude, at
once bespoke a high degree of sympathetic intelligence attained by
a union of instinctive equality. In contrasted proof of the evident
assumption, I will adduce the ants, and our neighbors of the human
species, who live in a state of concubinage, to show that sexual
gregation begets a condition of brutal selfishness in the males,
causing them to use physical strength for the reduction of their
females to serve as bond slaves of passion and labor for
multitudinous production in kind. From their continued dalliance
after nightfall, I was pleased to learn that their habits were semi-
nocturnal in perceptive activity. When they finally retired for the
night to the shelter within their cell, I suffered retributive spasms
from the powerful mellific odors that pervaded the cell, which
caused protracted coughing and general relaxation, so that in my
extremity I was prompted to make my escape into the open air, but
the intense darkness and my weakness prevented me. As my air
passages became accustomed to the acrid irritation, I in sequence
suffered from mellific narcotism, and fell into a stuporic medium
between waking impressions and fantastic visions of instinct that
precede the waking dawn from sleep. These variations continued
until the bees’ emergence into the open air, in the morning, revived
me. After their matutinal salutations they rose in flight circles to their
bee line, but winged their course in an opposite direction from the
honeysuckle plot so memorable in their previous day’s experience,
probably attributing the cause of restraint to some inherent property
of the flowers.
“My elevation and swift passage through the air, reminded me, with
its bracing effect, that I had not taken food for a donsenack, so
feeling at ease I unstrapped my script and made a hearty meal, with
a zest that the words of our language will fail to express. Shortly
after I had closed my morning meal, the bees commenced their
circlings in downward descent, and ere long I discovered below, on
the rocky declivity of a hillside a growth of honeysuckles, the goal of
their attraction. In the circling support of their buzzing wings they
remained suspended over the flowers for some time, until their
safety had been tested by dronivas and humming-birds, then with
caution they ventured to settle upon the petals, and after some
hesitation, the female was loaded and dispatched with her first cargo
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!

ebooknice.com

You might also like