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

Download full Simple and Efficient Programming with C# : Skills to Build Applications with Visual Studio and .NET 2nd Edition Vaskaran Sarcar ebook all chapters

The document promotes the ebook 'Simple and Efficient Programming with C#' by Vaskaran Sarcar, highlighting its second edition which aims to enhance programming skills using Visual Studio and .NET. It outlines the book's structure, including topics on object-oriented programming, design principles, error handling, and practical case studies. Additionally, it provides links to download the ebook and other related digital products from ebookmeta.com.

Uploaded by

kunauneven1o
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
208 views

Download full Simple and Efficient Programming with C# : Skills to Build Applications with Visual Studio and .NET 2nd Edition Vaskaran Sarcar ebook all chapters

The document promotes the ebook 'Simple and Efficient Programming with C#' by Vaskaran Sarcar, highlighting its second edition which aims to enhance programming skills using Visual Studio and .NET. It outlines the book's structure, including topics on object-oriented programming, design principles, error handling, and practical case studies. Additionally, it provides links to download the ebook and other related digital products from ebookmeta.com.

Uploaded by

kunauneven1o
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Get the full ebook with Bonus Features for a Better Reading Experience on ebookmeta.

com

Simple and Efficient Programming with C# : Skills


to Build Applications with Visual Studio and .NET
2nd Edition Vaskaran Sarcar

https://ebookmeta.com/product/simple-and-efficient-
programming-with-c-skills-to-build-applications-with-visual-
studio-and-net-2nd-edition-vaskaran-sarcar/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Simple and Efficient Programming with C#: Skills to Build


Applications with Visual Studio and .NET 1st Edition
Vaskaran Sarcar
https://ebookmeta.com/product/simple-and-efficient-programming-with-c-
skills-to-build-applications-with-visual-studio-and-net-1st-edition-
vaskaran-sarcar-2/
ebookmeta.com

Simple and Efficient Programming with C#: Skills to Build


Applications with Visual Studio and .NET 1st Edition
Vaskaran Sarcar
https://ebookmeta.com/product/simple-and-efficient-programming-with-c-
skills-to-build-applications-with-visual-studio-and-net-1st-edition-
vaskaran-sarcar/
ebookmeta.com

Simple and Efficient Programming with C# Vaskaran Sarcar

https://ebookmeta.com/product/simple-and-efficient-programming-with-c-
vaskaran-sarcar/

ebookmeta.com

The January 6th Report The Report of the Select Committee


to Investigate the January 6th Attack on the United States
Capitol 1st Edition Bennie Thompson
https://ebookmeta.com/product/the-january-6th-report-the-report-of-
the-select-committee-to-investigate-the-january-6th-attack-on-the-
united-states-capitol-1st-edition-bennie-thompson/
ebookmeta.com
Clinical manual of psychopharmacology in the medically ill
2nd Edition Stephen J. Ferrando

https://ebookmeta.com/product/clinical-manual-of-psychopharmacology-
in-the-medically-ill-2nd-edition-stephen-j-ferrando/

ebookmeta.com

Ollie Goes the Distance All About Electric Cars Claire


Winslow

https://ebookmeta.com/product/ollie-goes-the-distance-all-about-
electric-cars-claire-winslow/

ebookmeta.com

Methods for the Analysis of Asymmetric Proximity Data


Giuseppe Bove Akinori Okada Donatella Vicari

https://ebookmeta.com/product/methods-for-the-analysis-of-asymmetric-
proximity-data-giuseppe-bove-akinori-okada-donatella-vicari/

ebookmeta.com

Dieting Overweight and Obesity Self Regulation in a Food


Rich Environment 2nd Edition Wolfgang Stroebe

https://ebookmeta.com/product/dieting-overweight-and-obesity-self-
regulation-in-a-food-rich-environment-2nd-edition-wolfgang-stroebe/

ebookmeta.com

Crown and Cinder (The Austen Fairy Tales #2) 1st Edition
Kendra E. Ardnek

https://ebookmeta.com/product/crown-and-cinder-the-austen-fairy-
tales-2-1st-edition-kendra-e-ardnek/

ebookmeta.com
Conquering JavaScript: D3.js Sufyan Bin Uzayr

https://ebookmeta.com/product/conquering-javascript-d3-js-sufyan-bin-
uzayr/

ebookmeta.com
Vaskaran Sarcar

Simple and Efficient Programming with


C#
Skills to Build Applications with Visual Studio and
.NET
2nd ed.
Vaskaran Sarcar
Kolkata, West Bengal, India

ISBN 978-1-4842-8736-1 e-ISBN 978-1-4842-8737-8


https://doi.org/10.1007/978-1-4842-8737-8

© Vaskaran Sarcar 2021, 2023

This work is subject to copyright. All rights are solely and exclusively
licensed by the Publisher, whether the whole or part of the material is
concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in
any other physical way, and transmission or information storage and
retrieval, electronic adaptation, computer software, or by similar or
dissimilar methodology now known or hereafter developed.

The use of general descriptive names, registered names, trademarks,


service marks, etc. in this publication does not imply, even in the
absence of a specific statement, that such names are exempt from the
relevant protective laws and regulations and therefore free for general
use.

The publisher, the authors, and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.

This Apress imprint is published by the registered company APress


Media, LLC, part of Springer Nature.
The registered company address is: 1 New York Plaza, New York, NY
10004, U.S.A.
I dedicate this book to the programming lovers of C#.
Introduction
It is my absolute pleasure to write the second edition of Simple and
Efficient Programming with C#: Skills to Build Applications with Visual
Studio and .NET. You can surely guess that I got this opportunity
because you liked the previous edition of the book and shared your
feedback with us. So, once again I’m excited to join you and help you to
learn more. This time I present a further simplified, better organized,
and more content-rich edition to you.
Let me remind you of the key goals of this book. I wrote about them
in the first edition as well. C# is an object-oriented programming (OOP)
language. You may already know C# keywords or even some interesting
features. You may also know how to write simple programs in C#. You
can learn these things from an introductory book or an online tutorial.
These are useful things to know, but they are not sufficient to
understand an enterprise codebase. This is why a novice programmer
often finds it difficult to understand an expert’s code. They may wonder
why an experienced programmer wrote the program in a particular
way. It may appear to the novice that the expert could have used an
easier approach to solve the problem. But there are reasons why an
experienced programmer might follow a different approach. The word
experienced indicates that these programmers have more experience in
programming and know the pros and cons of different approaches.
They know how the C# features can be used in the best possible way to
develop an application. So, the applications they make are usually
powerful. What do I mean by a powerful application? For me, a
powerful application is robust, extensible, and easily maintainable, but
simple to use. This book is an introductory guide for developing such
applications. This was the core aim of this book.
To write better-quality programs, senior programmers follow
experts’ footprints. They learn from the collective wisdom and recorded
experience of the past. So, instead of attempting an entirely new
solution, you should first consider this knowledge base, which will help
you produce better-quality code. It is always better if you know about
why you should or shouldn’t follow any specific guideline.
Malcolm Gladwell, in his book Outliers (Little, Brown and Company),
discussed the 10,000-hour rule. This rule says that the key to achieving
world-class expertise in any skill is, to a large extent, a matter of
practicing the correct way, for a total of around 10,000 hours. I
acknowledge that it is impossible to consider all experiences before you
write a program. Also, sometimes it is OK to bend the rules if the return
on investment (ROI) is nice. So, keep in mind the Pareto principle, or
the 80-20 rule. This rule simply states that 80 percent of outcomes
come from 20 percent of all causes. This is useful in programming too.
When you identify the most essential characteristics of top-quality
programs and use them in your applications, you also qualify yourself
as an experienced programmer, and your application will be robust,
flexible, and maintainable. In this book, I share with you these
important principles using some case studies, which will help you write
better programs. Some of these principles you may know already, but
when you see them in action and compare these case studies, you’ll
understand their importance.
So, what is new in this second edition? Well, the first thing I want
to tell you is that this edition maintains the same goals that were
mentioned in the first edition. Second, you can easily guess that it is a
further simplified, enlarged, and polished version. This time you see the
use of top-level statements throughout the book. You may know that
top-level statements have been supported since C# 9.0. In addition, the
.NET 6+ project template for C# console apps uses top-level statements.
At the time of this writing, C# 11 is not released, but you can test the
preview features. I have taken this opportunity to use some of them,
particularly raw-string literals. I talk about static abstract interface
members too. I used many preview features in my other book, Test Your
Skills in C# Programming. But for this book, not all of them are required.
Additionally, this is an expanded edition. Two new chapters in Part
IV, Chapter 10 and Chapter 11, talk about handling errors in a better
way. Particularly, you’ll see a discussion of organizing exceptions and
handling null values with different case studies.
How Is the Book Organized?
The book has five major parts, which are as follows:
The first three chapters form Part I, in which there is a detailed
discussion of polymorphism and the use of abstract classes and
interfaces. Here, code comments will be examined, and you will learn
when to use them effectively. These are the fundamental building
blocks for the rest of the book.
In the world of programming, there is no shortage of programming
principles and design guidelines. Each of these suggestions has its
own benefits. To become a professional programmer, you do not need
to learn everything at the same time. In Part II, I discuss six design
principles, which include the SOLID principles and the DRY principle.
These are the foundation of well-known design patterns.
The best way to learn is by doing and analyzing case studies. So, in
Part III of the book, you will see interesting applications that use
some well-known patterns. This part gives you hints about how a
professional coder develops an enterprise application.
Handling errors is an unavoidable part of programming. Particularly,
runtime exceptions are dangerous, and often they appear in the form
of NullReferenceException in C#. Part IV focuses on them,
discusses different case studies with easy-to-understand examples,
and provides useful suggestions about possible improvements.
There is no end to learning. So, Part V includes some interesting
topics such as how to prevent memory leaks, how to choose between
a static method and an instance method, and some common terms
from software development that are not discussed in detail in this
book. A quick overview of these topics will help your future learnings
and experiments.
You can download all the source codes for the book from the
publisher’s website. I have a plan to maintain the “errata,” and, if
required, I can also make some updates/announcements there. So, I
suggest you visit those pages to receive any important corrections or
updates.

Prerequisite Knowledge
This book is intended for those who are familiar with the common
language constructs of C# and have a basic understanding of pure
object-oriented concepts such as polymorphism, inheritance,
abstraction, encapsulation, and, most importantly, how to compile or
run a C# application in Visual Studio. This book does not invest time in
easily available topics, such as how to install Visual Studio on your
system, how to write a “Hello World” program in C#, how you can use
an if-else statement or a while loop, etc. This book is written using
the most basic features of C# so that for most of the programs herein
you do not need to be familiar with advanced topics in C#. The
examples are simple, and I believe that they are written in such a way
that even if you are familiar with another popular language such as
Java, C++, and so on, you can still easily grasp the concepts in this book.
Who Is This Book For?
In short, you can pick up this book if the answer is “yes” to the
following questions:
Are you familiar with basic constructs in C# and object-oriented
concepts such as polymorphism, inheritance, abstraction, and
encapsulation?
Do you know how to set up your coding environment?
Have you completed at least one introductory course on C# and now
are interested in writing better programs?
Are you also interested to know how a professional programmer
designs their applications?
You probably shouldn’t pick this book if the answer is yes to any of
the following questions:
Are you absolutely new to C#?
Are you looking for advanced concepts in C#, excluding the topics
mentioned previously?
Are you interested in exploring a book where the focus is not on
standard design principles?
Do you not like Windows, Visual Studio, and/or .NET and want to
learn and use C# without them?

Guidelines for Using This Book


To use this book more effectively, consider the following:
This book works best if you’ve gone through an introductory course
on C# and are familiar with the common terms, such as
polymorphism, and have heard about abstract classes and interfaces.
If this is not the case, please read about these topics before you start
reading this book.
I suggest you go through the chapters sequentially. This is because
some fundamental design techniques may have been discussed in a
previous chapter, and I have not repeated those techniques in later
chapters.
I started this book using Microsoft Visual Studio Community 2022
in a Windows 10 environment. This community edition is free of
charge. When I started the book, I started with the latest versions of
C# that were available at that time. You can easily guess that version
updates kept coming, so I kept updating my code repository. When I
finished my first draft, I had the most recent version of Visual Studio
Community 2022 (version 17.3.3). Almost in every case, my target
framework was .NET 7.0, which supports C# 11.
In this context, it is useful to know that nowadays the C# language
version is automatically selected based on your project’s target
framework(s), so you can always get the highest compatible version
by default.
For example, C# 11 is for .NET 7 and later versions. Similarly, C# 10 is
supported only on .NET 6 and newer versions. C# 9 is supported only
on .NET 5 and newer versions. C# 8.0 is supported only on .NET Core
3.x and newer versions. If you are interested in the C# language
versioning, you can go to this link:
https://docs.microsoft.com/en-
us/dotnet/csharp/language-reference/configure-
language-version.
The fact is that these version updates will come continuously, but I
strongly believe that these version details should not matter much to
you because I have used the fundamental constructs of C#. So, the
code in this book should execute smoothly in the upcoming versions
of C#/Visual Studio as well. Though I also believe that the results
should not vary in other environments, you know the nature of
software—it is naughty. So, I recommend that if you want to see the
exact same output, you mimic the same environment.
If you do not use the Windows operating system, you can use Visual
Studio Code, which is also a source-code editor developed by
Microsoft to support Windows, Linux, or Mac operating systems. This
multiplatform IDE is also free.
You can download and install the Visual Studio IDE from
https://visualstudio.microsoft.com/downloads/. You
will the screen shown in Figure I-1.
Note At the time of writing, this information is correct. But the
link and policies may change in the future.

I have also installed the class designer component in Visual Studio


2022 to draw class diagrams for my programs. They’ll help you
understand the code better.

Figure I-1 Download link for Visual Studio 2022 and Visual Studio Code

Conventions Used in This Book


All the output and code of the book follow the same font and structure.
To draw your attention to some places, I have made them bold. For
example, consider the following code fragment and the lines in bold
(taken from Chapter 4 when I discuss the LSP):

// The previous codes are skipped

// Instantiating two registered users


RegisteredUser robin = new("Robin");
RegisteredUser jack = new("Jack");
helper.AddUser(robin);
helper.AddUser(jack);

GuestUser guestUser1 = new();


helper.AddUser(guestUser1);

// Processing the payments using


// the helper class.
// You can see the problem now.
helper.ShowPreviousPayments();
helper.ProcessNewPayments();

// The remaining codes are skipped

Final Words
You are an intelligent person. You have chosen a subject that can assist
you throughout your career. As you learn about these concepts, I
suggest you write your own code; only then will you master this area.
There is no shortcut to true learning. In a similar context, can you
remember Euclid’s (the ancient Greek mathematician who is often
considered the father of geometry) reply to the ruler? If not, let me
remind you of his reply: “There is no royal road to geometry.” Similarly,
in programming, there is no shortcut. So, study and code; understand a
new concept and code again. Do not give up when you face challenges.
They are the indicators that you are growing better.
I believe that this book is designed for you in such a way that upon
its completion, you will develop an adequate knowledge of the topic,
and, most importantly, you’ll know how to go further. Lastly, I hope that
this book can provide help to you and that you will value the effort.
Any source code or other supplementary material referenced by the
author in this book is available to readers on GitHub
(https://github.com/Apress). For more detailed information, please
visit www.apress.com/source-code.
Table of Contents
Part I: Fundamentals
Chapter 1:​Flexible Code Using Polymorphism
Recap of Polymorphism
Initial Program
Demonstration 1
Output
Analysis
Better Program
Demonstration 2
Analysis
Useful Notes
Summary
Chapter 2:​Abstract Class or Interface?​
Recap of Abstract Classes and Interfaces
Initial Program
Demonstration 1
Better Program
Demonstration 2
Output
Analysis
Summary
Chapter 3:​Wise Use of Code Comments
Recap of Code Comments
Initial Program
Demonstration 1
Other documents randomly have
different content
"I know," Dorning laughed. "He does drive like a comet. But—er—I'm a
regular snail at the wheel. If Rodrigo doesn't mind——"

"He doesn't," Rodrigo cut in rather sullenly.

John turned eagerly toward her, and she said gayly, "Very well, Mr.
Dorning, and you may drive just as slowly and carefully as you know how."

"Fine," returned John. "We'll take a turn in the park on the way. It's a
wonderful afternoon." He hurried to open the door for her.

"Good afternoon, Count Torriani, the tea was delicious," she said
suavely, dark, ironic eyes upon his grave face. He glanced at the undisturbed
tea things upon the little taboret, shrugged his shoulders, and bent over her
hand. Vexed as he was with her, he could not kiss her hand without feeling a
little emotion within him.

He watched her disappear into the hall. To John Dorning, following her,
he called suddenly, "John, you'll need your hat, won't you?" John
shamefacedly returned for it. Rodrigo handed it to him with a smile.

Rodrigo sank down into a comfortable chair, lighted a cigarette, and


thoughtfully poured himself a cup of the neglected tea.

It was an hour later that John returned, flushed by the wind and
something that had nothing to do with the elements. Rodrigo was still in the
chair, trying to read.

"You didn't mind my running off with Miss Van Zile?" John asked, with
a strange indication in his voice that he didn't care whether his friend minded
or not. He was excited, eager to confide.

"Not at all," returned Rodrigo, "but John——"

John had lighted a cigarette and was walking around the room. "She's
wonderful, isn't she, Rodrigo?" he said suddenly. "A very remarkable and
very beautiful girl. She's never been to New York before, she says. She's
frightened with the city, but eager to see the sights. I've made several
engagements with her to show them to her."
Rodrigo was silent.

John enthused on. "Rodrigo, if I fell in love, it would be with that kind of
a girl—frank, unspoiled, sweet and lovely. She has something Eastern
women utterly lack. They are all so sophisticated and blasé. You could never
imagine such a woman marrying me for my money, for instance."

Rodrigo wondered if he was a coward. He ought to warn John that he


was playing with dynamite, that this girl was everything that his friend
thought she was not. But John was so utterly absorbed in her. And he,
Rodrigo, had promised Henry Dorning to show his son something of worldly
women. Here was John's opportunity to secure an education. Probably with
no serious results. Elise must be playing with Dorning, and it couldn't last.
She could have no serious intentions toward John. He was exactly the
opposite of the type of man that interested her. Rodrigo, with no sense of
self-flattery, even suspected shrewdly that she had played up to John with
the object of making John's room-mate jealous.

And so, he decided, for the time being, that he would keep silent.

CHAPTER XI

Rodrigo attended a private auction of Flemish art the next morning and
did not reach the office until noon-time. Having glanced through his mail, he
thrust his head into John's office to tell him of the purchases he had made.
He was quite well pleased with himself and was looking forward to
Dorning's commendation on his bargains. Mary Drake was alone in the
office.

"Good-morning, Mary," called Rodrigo. "Has John gone to lunch


already?"

He saw with a little uneasiness that something of the usual warmth with
which she greeted him had fled from her eyes and voice. "Yes, he is lunching
with a Miss Van Zile at the Plaza."

Rodrigo frowned. His high spirits were somewhat quenched. He entered


and walked over toward Mary and sat down. He looked at her a moment,
hesitated, then said abruptly, "Mary, if your best girl friend was attracted to a
chap who you knew was no good, what would you do about it?"

She regarded him seriously and said rather pertly, "I would make very
sure first that my opinion of the man's unworthiness was correct."

"And if you had made sure—then what?"

She gave a little helpless gesture. She was so serious that he was on the
point of asking her what was troubling her. "How can you make sure?" she
asked gravely. And went on, "I used to think that first impressions of people
were instinctively the right ones. That everything after that just had the
effect of clouding things, of leading to wrong judgments. Recently I changed
my mind. I decided that what a person has been in the past has nothing to do
with the present. I thought people could change, could find themselves, and
become new men—or women. Now—I don't know."

He tried to take her delicate, white hand, but it eluded his. "Mary," he
asked softly, "are you thinking of me when you say these things about—first
opinions?"

He took her troubled silence for an affirmation.

"Has someone been talking to you since about me?" he queried


intuitively.

Mary, who was never one for groping about in the dark, replied, "A girl
by the name of Sophie Binner was in this morning. She asked for you. When
she found you weren't here, she grew quite loud and troublesome, and Mr.
Madison referred her to John. I couldn't help but hear some of the
conversation between them, though I left when I discovered its private
nature."

"Sophie Binner?" he repeated, screwing his forehead into a frown. "But I


haven't seen her for several months. She is an actress I knew in England—
and, for a short time, here. But she has been on the road with her company,
and I haven't even written to her."

"You must have written to her some time or other."

"Why, what do you mean, Mary?" He had never seen the usually calm
and capable Mary agitated so. It agitated him in turn. Sophie was not above
making trouble, he knew, especially after the unfriendly manner of their last
parting.

"I don't want you to question me any further, Rodrigo," said Mary
nervously. "I have told you quite all I know. You will have to get the rest
from John. Probably he won't mention it to you. He hates trouble of all kinds
—particularly sordid troubles—and he will be anxious to shield you. And I
think you shouldn't allow yourself to be shielded, in this case."

"Certainly not. I'll ask him what happened at once."

But Rodrigo did not have the opportunity to broach the subject of Sophie
to his partner during the remainder of the day. John did not return from his
luncheon engagement until after three, when he hurried in breezily, a
carnation in his buttonhole and a flush upon his face that caused the
employees out in the gallery to look significantly at each other and smile
approvingly. The head of the concern had never looked so happy. John
closeted himself at once with a couple of art buyers who acted in the
capacity of scouts for Dorning and Son. By the time Rodrigo judged
Dorning was free and went in search of him, John had again disappeared,
this time, Mary said, to dress for dinner.

Rodrigo found John in their apartment, arrayed in his evening clothes,


administering the final touches to his necktie. The Italian told himself a little
ironically that Elise Van Zile had reversed the social order of the day in their
lodgings—now it was John who was donning festive attire almost every
evening and setting out upon social expeditions, and Rodrigo who was left
home to settle in a chair with a book. Formerly it had been the reverse.
Rodrigo remarked banteringly about this.
"But I have such a wonderful reason for deserting you," John cried.
"How she ever happened to decide to like me, when you were available,
Rodrigo, I don't know. She is such a beautiful creature—she could have the
pick of all the men in the world. And she's just as sweet as she is beautiful.
You don't think that I deliberately went out to oust you from her affections,
do you, Rodrigo?" John spoke so earnestly that Rodrigo gave a short laugh
of reassurance. But there was a note of anxious pity in it also. Poor old John.

"I understand that you saw another friend of mine to-day, also," Rodrigo
said, lighting a cigarette and flicking the match into the open grate.

John dropped his thin fingers from his tie and replied quietly. "Did Mary
tell you? I asked her not to."

"She evidently thought it better that I should know, and I think she is
right, as usual. What did Sophie Binner want of me—and you?"

John walked over to his friend and put his hands upon Rodrigo's
shoulders. He suggested, "Please don't ask me any more about her, Rodrigo.
You'll never see or hear from her again. Why not let it go at that?"

Rodrigo replied impatiently, "I'm not a baby, John, I know more about
women like Sophie than you do. What was she up to?"

John shrugged his shoulders and decided to make a clean breast. "She
looked like the devil—thin and badly dressed. She said her show had failed,
left the whole company stranded out in Pocatello, Idaho. Christy and the
company manager skipped and went back to England. Sophie pawned her
jewels and clothes and just scraped together enough money to get her to
New York. So she came to you for help."

Rodrigo relaxed with relief. "Fair enough," he admitted. "I'll stake her to
a trip home. Why didn't you tell her to go away and come back again when I
was there?"

John hesitated. "She insisted upon some money at once. She had—some
letters from you. I read a couple of them, and they were really pretty serious
stuff, Rodrigo. You were never a calm letter-writer. And writing letters to a
certain type of woman is very had business in this country. There are always
shyster lawyers around ready to pounce upon them and turn them into
money. And she said—well, that you were in her apartment the night her
show opened. She mentioned a colored elevator man whom she could
summon as a witness, if necessary. But, damn it, I don't believe you were,
Rodrigo." John looked at his friend anxiously.

"I was just there for a minute, and it was perfectly harmless," Rodrigo
said at once. "It didn't mean a thing and she probably played it up merely to
give me a black eye with you. As a matter of fact, I recall that the elevator
boy did ride us up and wasn't there when I came down the stairs later. I had a
fearful row with her and she's probably out for revenge. But what's Sophie's
game anyway—blackmail? She can't get away with it."

John replied, "She threatened to sue you for breach of promise to marry
her, said you had jilted her in London once before. She wanted five thousand
dollars to call it off. I knew she didn't have a case, but I thought it was just as
well to keep her quiet. So I gave her two thousand dollars. Then I stopped in
at the apartment house address she gave me and for a fifty dollar bill
persuaded the colored elevator boy that you had never been there."

Rodrigo shook his head and smiled. Was there ever a friend like this
innocent-wise John Dorning?

"You're a prince, John," Rodrigo said sincerely. "But you shouldn't have
done it. You should have let me face the music." He turned almost fiercely
and paced the floor a moment. Returning, he faced John and cried, "I don't
know why you have such a sublime faith in me, John. God knows I've given
you no reason for it. I was in trouble when you first met me. And that wasn't
the first time, as you must have known. And yet you accepted me as a friend
and you gave me a start that's resulted in the happiest time of my life. Now,
damn it, I throw you down again. I guess I'm just bad."

John laid his hand on the Italian's shoulder. "No, I won't have you
condemning yourself. You've been strictly business since you've been over
here, I know. This Binner affair is a carry-over from the past. Your letters
didn't mean anything, even though they sounded pretty intimate. And that
episode in her apartment was just a peculiar combination of circumstances, I
can see that."
"Oh, don't make me out a saint, John," Rodrigo cried impatiently. "If
those crooks in the hall hadn't jolted it out of my head—oh, well, what's the
use. Once a weakling, always a weakling."

"Not at all," John retorted. "I'll admit there's one kink in your character I
don't understand. I don't see why a chap who is as unselfish, straightforward
and worldly wise as you are, can—well, make a fool out of himself with a
certain type of woman. It's uncanny."

"It's in my blood. I'll never be able to be absolutely sure of myself,"


Rodrigo flung out hopelessly. His hands were nervously fingering the table
against which he was leaning. He was thinking neither of Sophie nor of
Rodrigo. He was seeing the white, disappointed face of Mary Drake, and he
knew now what had been troubling her. It did not occur to him to be thrilled
that she should care enough about him to be troubled. He was afraid, afraid
for his love and his happiness, because he was his own worst enemy. His
nervous, groping fingers closed upon a marble figurine, an exquisite carving
of a hooded cobra, head raised and ready to strike at a tiger. The tiger, about
to spring, had paused and stood, eyes upon the snake, as if fascinated. It was
among his art treasures that he had brought from Italy.

"You'll be sure of yourself," John was saying, "when the right girl comes
along." He smiled, and Rodrigo realized with a pang that John was thinking
of his right girl, Elise Van Zile.

"What chance will I ever have with the right sort of girl when the wrong
sort may come along first?" And Rodrigo too was thinking of Elise. He
suddenly realized that his fingers were digging into something hard until
they hurt. He looked down at the figurine, and lifted it.

"Here I am!" he cried. "I'm this tiger! I never told you why I brought this
figurine with me, why I've always cherished it, have I? Well, one reason is
because my father gave it to me when I was a boy as the memento of a very
exciting afternoon. It happened in India when I was about fourteen years old.
We were riding on an elephant, and we could see over a high wall into a sort
of a lane that led to an enclosure where a chap who used to make a business
of capturing wild animals for museums and circuses kept his stock. He let
the beasts roam around in there, and my father would take me to the other
side of the wall to see them.

"Well, on this afternoon, a big, silky tiger came walking down the lane.
Suddenly, when he was just about opposite us, he stopped short—like this
statue—his head down. He stared at something. We followed his shining
eyes. A cobra had slipped out of the box in which the chap kept his snakes.
The tiger stared as if paralyzed, fascinated, a yard from the snake's head. A
cobra! That's the wrong kind of a girl—a cobra. Mind you, this tiger could
have killed the thing with one blow of his paw. He could have killed a lion,
or scattered a regiment. Yet he stood there, his eyes held by the eyes of the
cobra. All at once he tossed his head up and took a step backward—and the
cobra struck."

"Struck! Did he kill the tiger?"

"I don't know. I felt sick. My father saw how white I was, and we left at
once. Several months later he saw this figurine in a shop in Calcutta and
bought it. He gave it to me."

John looked at him and said slowly, "Perhaps a cobra can't really kill
anything as big and strong as a tiger."

"It can make it bad for him, though. I can remember Dad cursing that he
didn't have a gun with him. A gun! That's you, John. When I've been
walking lately, I've usually had you along, and I've been pretty safe from
cobras."

"It's safer not to go walking at all."

"Well, even a tiger has to have some diversion," Rodrigo tried to lighten
up the serious turn the conversation had taken. As John walked over to the
mirror and resumed his adjusting of his cravat, Rodrigo said suddenly, "And
guns too, John—sometimes guns don't act as they should, very good guns,
too. And cobras raise the dickens with them too."

But John had hardly heard him, much less gotten the meaning of his
friend's cryptic speech. And Rodrigo was instantly glad. John was so
infatuated with Elise that mere words would never undeceive him. It must be
something stronger than words. Likewise, Rodrigo must make very sure that
Elise Van Zile was what he had described to John as the cobra type of
woman.

After John left, Rodrigo sat down and tried to interest himself in a large,
profusely illustrated volume on interior decoration. But he was in no mood
to concentrate upon the hopelessly conventional illustrations and the dry,
prosaic text. He flung the book down at length, and, lighting his pipe,
walked nervously about the apartment. He was thinking of John and Elise
Van Zile, and of himself. His feeling toward the sudden infatuation of his
friend for Mrs. Palmer's niece and Elise's sudden interest in John contained
not one atom of jealousy. Had she been the girl John thought she was,
Rodrigo would have been delighted and would have rendered the match
every assistance.

But Elise, Rodrigo kept telling himself, was the girl he thought she was.
This business to-day of Sophie Binner, this tale of the cobra he had related to
John, this whole raking up of his past had had a depressing effect upon him.
The world looked awry that evening.

He confessed, after fifteen minutes of aimless walking about, that he was


perhaps seeing things through a glass darkly. But of this much he was quite
certain: Elise Van Zile was clever. Though John Dorning was not the type of
man who appealed to her, she might decide to marry him for his money.
Married or single, she would always be selfish, unscrupulous. She wanted a
rich, safe husband.

If the husband were John Dorning, this would bring tragedy.

Having arrived at this conclusion, Rodrigo tried to denounce the whole


thing as nonsense and, catching up his hat, departed from the apartment in
search of something to eat, though he wasn't in the least hungry. He wanted
to get out, get away from himself, get where there were people, noise,
laughter.

He walked over to Broadway and deliberately chose a cheap restaurant


where race-track touts, vaudeville and burlesque actors and actresses,
theatrical agents and motion picture press agents absorb indigestible food.
But the gum-chewing waitresses and clattery crockery failed to divert him.
He hardly touched his food. Rising, he paid what the muscular waitress had
punched on his ticket, and walked back to the apartment through the surging
tide of the Broadway theatre traffic.
Back in his living-room, he settled down with his book again. But he
could not read. He fell to brooding again. And out of his brooding came
finally a mad plan to save John Dorning. As well have the game as the name,
Rodrigo laughed ironically. He had done so many foolish things for his own
pleasure. God might now forgive this last one if it were done unselfishly, to
save a saint. For John Dorning was almost a saint to Rodrigo. Their
friendship was a thing almost sacred. But it was better to kill even this
sacred thing, Rodrigo reasoned solemnly, than to hurt John Dorning.

So the following afternoon he called Elise Van Zile on the telephone


from his office and, putting into his voice all the mellow intimacy that he
knew so well how to convey, he said, "I have missed you so much, Elise.
John interrupted our last little chat just when it was becoming so interesting,
and took you away. I'd so much more to tell you. We have such a great deal
in common, as you were good enough to say. I'm wondering when I may see
you again."

There was silence for a moment, and then her smooth tones came over
the wire, "Why, certainly. Aunt Helen and I will be delighted to see you any
time."

He lowered his accents. "Not, Auntie—you, you alone. You said you
would like to come again to our apartment. And this time I will promise we
won't be interrupted. Not even by John. I want so badly to see you—Elise.
Won't you come?"

After a long pause, her voice came noncommittedly, "When?"

"On Saturday afternoon at three?"

Another long pause, and then she said faintly, "I shall be there."

Rodrigo hung up the receiver and took a long, deep breath. Then he
walked into John's office and, taking advantage of Mary's temporary
absence, said, "John, I want you to promise me something."

"What is it, old man? And why the terrifically serious look on your
face?"
Rodrigo forced a smile. "I want you to stay away from the apartment
until three-thirty next Saturday afternoon," he said. "At that time I want you
to meet me there, and probably I'll have something very interesting to show
you?"

"But my birthday isn't until next month, Rodrigo?" John bantered. "Did
you go out and buy that Gainsborough original I fancied so much—or
what?"

"Please don't ask any questions, John. And believe that I'm deadly
serious. Three-thirty. Will you be there?"

"Why, of course—if you say so."

During the rest of the week, Rodrigo was like a man who has had the
date of his electrocution set. He could not work, eat, nor sleep. John
remarked about it. Mary Drake regarded him anxiously from behind his
back.

At noon the following Saturday, Rodrigo heard John leaving his office
and hastened to stop him. He had not reminded John of his engagement of
the afternoon, but now he said,

"You haven't forgotten about coming to the apartment at three-thirty,


have you, John!"

"Oh, I'll be there. You're so darned mysterious about it that you've


aroused my curiosity."

Rodrigo felt a grim satisfaction. He did not purpose to have his


electrocution bungled by the absence of the man who was to turn on the
electricity.

Having with some awkwardness and difficulty disposed of Mrs. Brink,


the housekeeper, who showed a disposition to dawdle at her work so that she
might gossip with him, Rodrigo, at three o'clock that afternoon, was trying
desperately to interest himself in a newspaper. He was arrayed in a purple
silken dressing-gown. Soft cushions were piled invitingly upon the divan.
The shades had been drawn discreetly, so that the room was in a semi-
shadow. Whisky and soda stood upon a slim taboret.

He waited impatiently for fifteen minutes. Then his nerves tingled as he


heard the elevator door outside roll open and someone stepped out into the
corridor. An instant later the apartment bell chimed. Rodrigo gravely arose.
His face broke into an excellent imitation of a smile of hearty welcome. He
opened the door. A freckle-faced, gawky messenger boy grinned on the
threshold, handed him two telegrams and pointed with a chewed stump of a
pencil where to sign in the book.

Rodrigo, mystified and disappointed, broke the envelope of one of the


telegrams. His face turned pale and his chin quivered, like a man suddenly
attacked with a chill, as he read:

Congratulate me. Elise and I married at Greenwich five


minutes ago. I am the happiest man in the world.

JOHN.

He walked falteringly over to the deep armchair and sat down before he
had the courage to open the other yellow container.

Sorry I had to miss our engagement. Just as well perhaps.


Forgive me for influencing John to break his date.

ELISE VAN ZILE.

For the first time in his life, Rodrigo cursed a lady. But mingled with his
resentment against her was a frank tribute to her cleverness. For he hadn't a
doubt in the world now but that Elise had seen through his stratagem and had
taken this decisive step to outwit him.
CHAPTER XII

One glorious morning, three weeks later, when the June sunshine bathed
Fifth Avenue in a benevolent light and the staff of Dorning and Son edged
over as near the doors and windows as possible and made lugubrious
remarks about their luck at being shut up from the paradise outdoors, the
door of Rodrigo's office was flung open and John Dorning burst in.

"Rodrigo!" he cried, and stood there near the door smiling happily and
blushing furiously, looking wonderfully well and boyish.

Rodrigo sprang up at once and congratulated him heartily.

"I'm the happiest man in the world," John repeated the words of the
fateful telegram, and, Rodrigo admitted, he looked it. His face was bronzed
and suffused with health, the result of many hours upon the golf links and in
the lake adjoining the elaborate Adirondack "lodge" where the Dornings had
been spending their honeymoon. A feeling of relief for the moment and
optimism for the future swept through Rodrigo. Perhaps, after all, he had
misjudged Elise. Though, he told himself, it is a very rare marriage that does
not at least survive the honeymoon.

"Sit right down and tell me how the elopement all happened," invited
Rodrigo gayly, "you old scoundrel."

"Well, to begin at the beginning," said John exuberantly, "I had an


engagement with Elise in the evening on that Saturday you wanted me to
come to the apartment in the middle of afternoon, do you remember?
Around noon-time Elise telephoned me and said she was sorry but she would
have to cancel the evening engagement. She had to go to some charity
committee meeting or other with her aunt. I insisted upon seeing her, and she
finally agreed that we would have luncheon together and go for a short ride
in my car. I told her of my mystery date with you, and we enjoyed a good
laugh about it, old man, though, of course, she insisted upon my keeping it.
And I assure you I had every intention in the world of doing so. But we got
out on the Post Road, and it was such a wonderful afternoon—well, anyway,
I guess I made love to her, and then miraculously she said she would marry
me. I said 'When?' and she replied, 'Oh, it would be so romantic to do it at
once.' She was set against a fussy wedding of any kind. Didn't even want to
let my dad or sister know. I agreed, of course, being darned lucky to get her
any way at all. So we stopped at Stamford. Afterward I telephoned Dad and
sent you a telegram, and we started on our honeymoon."

"Great stuff!" Rodrigo enthused. "John, for a lad who has always fought
shy of the ladies, you certainly put it over in whirlwind style. What are you
going to do now?"

John hitched his chair nearer, beaming with high spirits. "My luck has
kept right on rolling in, Rodrigo. I happened to meet a chap from home at
the place we were staying. He mentioned that Ned Fernald was putting his
new place on the market. It seems Ned isn't so well off as he's supposed to
be, and building the place and outfitting it has strapped him so completely
that now he's anxious to sell. It's a peach of a big house, with lots of ground,
in the Millbank section, a new development. I'm going to get in touch with
Ned, and Elise and I have agreed that if we can arrive at the proper price,
we'll buy it."

Rodrigo averred that it sounded excellent. "But where is the blushing


bride?" he added.

"She's on her way to Greenwich. I just said good-bye to her and her aunt
at Grand Central. She's going to stop with Dad and Alice in Greenwich until
we get a place of our own."

"She's never met your folks, has she?" asked Rodrigo. He wondered
what Henry Dorning would think of his daughter-in-law, whether his
experienced old eyes would penetrate to things in her that his infatuated son
had never dreamed of.

"I'm sure they'll love her as much as I do," John enthused. "They can't
help it. She's the greatest ever. Dad knows Mrs. Palmer, Elise's aunt, very
well, so I got her to go along up."
Two hours later, he came back into Rodrigo's office to announce that he
was leaving to subway down-town and seek out Edward Fernald, who was a
minor partner in a brokerage house on Nassau Street. John confided further
that he was, as yet, quite unable to settle down to the workaday problems of
Dorning and Son. He was still walking upon air.

"You'll have to put up with my incompetence for a while, till I get used
to the idea of being married to the world's greatest wife," he pleaded
smilingly with Rodrigo.

"Take your time," soothed the latter. "I'll be indulgent. We don't have a
marriage in the firm every day."

"I wish some nice girl like Elise would capture you," John offered
seriously.

Rodrigo laughed. "Oh, that's what all you newlyweds preach to us happy
old bachelors."

Nevertheless he dropped in to see what Mary thought of the returned and


changed Dorning, after John had left.

"Mrs. Dorning is very lucky," said Mary. "John is the sort who will
devote his whole life to making his wife happy."

She said it so positively that she put him a trifle on the defensive. "Any
normal husband would do that, wouldn't he?" he asked a little challengingly.

She was silent a moment, and then she said, evidently out of a troubled
mind and into her typewriter, "Some men aren't equipped to be normal
husbands."

He looked at her gravely, his eyes full of love for her. Some day soon he
was going to have it out with Mary, he told himself. He would have to.
Things couldn't go on with them as they had been. He had called upon her
many times now out of office hours, met her mother, taken Mary to the
theatre, to art exhibitions, and to concerts and the opera. Always he had
avoided making love to her, because he was desperately afraid of losing her
through having his intentions misunderstood. He had wanted, on many
occasions, to sweep her into his arms, to cover her face with kisses, to claim
her for his own, but he was afraid. He could not risk kissing Mary until he
was very sure she loved him. Before the Sophie Binner blackmailing
episode, he had been optimistic about Mary's feelings toward him. But
during the last few months the issue had been cast again into doubt.

Frequently he told himself almost bitterly that if Mary loved him she
would be willing to forget utterly anything that had happened to him in the
past. But this, in his more rational moments, he knew was asking too much.
She was not the sort of girl who rushes blindly into love. Her whole
character and training were influences in the opposite direction. Love must
come upon her gradually. She must be very sure. Americanized though he
was by this time, the very fact that Rodrigo was a man of another country
from her own, with other ideals and up-bringing, made the process of falling
in love with him for this serious-minded American girl groping and slow.
But, once he had won her, he knew that she would be his forever, utterly,
without question or regret. That was Mary Drake's way too.

Two weeks later John Dorning announced that he had bought the Fernald
house, and he eagerly discussed with Rodrigo furnishing the place according
to their high artistic standards. The Italian, on one pretext or another,
declined several invitations to go to Greenwich and look over the Fernald
property and the married Elise. John was insistent that Rodrigo rush up and
congratulate Elise in person, and then just try and deny that John was the
luckiest fellow ever born. Elise had been asking for Rodrigo, John said, had
urged John to invite him up. Rodrigo smiled benevolently, and declined. He
did not, for the time being, wish to face this clever, attractive, and
triumphant young lady.

But, at last, when the John Dornings had actually moved into the Fernald
house and the rare old furniture and objets d'art, which Rodrigo had helped
to select, were installed to the young householder's liking, Rodrigo could no
longer decline the invitation to spend a weekend with them without
offending his friend.

Elise met them at the Greenwich station in a trim new little sedan.
Rodrigo congratulated her heartily, and she gave him very pretty thanks. She
was looking exceptionally alluring, lending an exotic distinction even to the
tweedy sport clothes she was wearing.

"I am especially grateful to you, Rodrigo—I suppose I may call you that
now," she added, "because you were instrumental in bringing John and me
together." Rodrigo glanced at her a little sharply, wondering if there was a
double meaning in this. But her smile was serene, though those enigmatic
eyes were just a little narrower than normal.

"It is glorious out here. I love it," she tossed over her shoulder to him, as
he sat, unusually quiet in the tonneau of the moving car beside his bag and
golf sticks. And as she swept the car into the newly made driveway of their
artistic home of field-stone and stucco, "Aren't we lucky to get this place? It
is the first home of my own that I have ever had. I love every stone in it."

Rodrigo admitted to himself that she was giving an excellent imitation of


a very happy young bride.

John showed him through the house later, and Rodrigo was very sincere
in his praise of their dwelling and its broad, attractive surroundings. The
close-cropped lawn sloped down gradually to a small lake, surrounded by
willow trees, a body of fresh water that eventually found its way into the
neighboring sound. John explained that there was a concrete dam below,
with a private bathing beach of white sand and crystal-clear water. Millbank
was a new development, very much restricted and exclusive, with a fine
nine-hole golf course just across the lake. When Rodrigo cast pleased eyes
upon the links, John recalled that Warren Pritchard, on learning of Rodrigo's
coming, had immediately spoken for the guest's company on Sunday
morning at the Greenwich Country Club.

"I believe Ben Bryon and Lon Sisson are anxious for a revenge match on
account of the beating you and Warren gave them the last time," John
explained, indicating by his tone of voice that he didn't consider the
engagement so pressing as Warren evidently did, and that he would have
preferred to retain Rodrigo's company himself.

"That will be fine," Rodrigo enthused. "That is, if you haven't other plans
for me, John?" John shook his head in the negative.
He motored to Stamford that evening with his host and hostess and
attended the first night of a polite comedy, destined for its New York
premiere the following week. The play was not particularly interesting, and
Rodrigo paid more attention to the audience than to the stage. It was a mixed
crowd of typical small-towners, well dressed and highly sun-tanned people
from adjacent Long Island Sound resorts, and professionals from Broadway
who were either interested in the production or the players. He recognized
the producer of the piece, a jolly, corpulent individual whom he had met at
the Coffee House Club. They ran into each other in the outside lobby
between the first and second act, and the theatrical admitted blithely that he
had a "flop" and was debating whether to dismiss the company at once and
forfeit his deposit on the lease of the Broadway theatre or chance a
performance in New York.

To Rodrigo, walking down the aisle as the orchestra was playing the
unmelodious prelude to the second act, came the realization anew that Elise
was quite the most striking-looking woman he had ever known. Her creamy
white shoulders billowing up from her black evening dress, her raven hair
sleeked tightly against her skull, her dark eyes either feeling or feigning
vivacious interest as she inclined her head to listen to John's animated
conversation, she was easily the most beautiful person in front or behind the
footlights. He sensed the strong magnetism of her presence as he took the
seat on the other side of her, and she said smilingly to him, "I was telling
John how bad this play is, but he seems only to have noticed that the settings
are in atrocious taste."

"He's right," Rodrigo acknowledged, and, thinking this was rather curt,
added, "And so are you."

"You find the audience more interesting?" she asked shrewdly.

"Yes, part of it," he said quickly, without thinking, and then cursed
himself for betraying that she exerted some of her old spell over him. A
sudden enigmatic smile crinkled her eyes and mouth as she gazed full at him
an instant, then turned abruptly to John.

He played golf with John's brother-in-law and his two companions the
next morning and had the satisfaction of being largely responsible for
another victory for Pritchard and himself. The latter was as tickled as if he
had captured a championship. "Come again next week-end, Rodrigo, and
we'll give these birds a real ride," he proclaimed loudly for the defeated ones'
benefit. But Rodrigo would not promise.

In the afternoon he pleaded pressure of work and an unbreakable dinner


engagement as an excuse for leaving. John protested loudly, but his guest
was adamant. At about five o'clock, they drove him to the station. Elise took
the seat beside him in the tonneau and, just before they reached the station,
she asked, "When are we to see you again? I was in town two or three times
last week. Twice I telephoned John for lunch, and he was too busy or out or
something. The next time, I warn you, I am going to invite you to give me
luncheon, Rodrigo, and you mustn't refuse me." And as if to assure him that
her intentions were innocent, she repeated the same thing to John in a louder
voice. He laughed back and said, "Of course. I want you two to be great
friends."

"Isn't she the most wonderful wife in the world?" John whispered to him
as he grasped the step-rods of the train.

"Yes, she is a wonderful woman," Rodrigo replied sincerely, and looked


over John's head to return her languid wave of good-bye.

Going back in the train, he thought of her and John, and of their chances
for happiness. He recalled the conversation Warren Pritchard had hesitantly
started on the way to the golf links that morning, and then dropped.

"I say, Rodrigo," Warren had begun, after fumbling around obviously for
an opening, "I know it may sound caddish of me, and I shouldn't be talking
this way, but what really do you know of this lady whom my brother-in-law
has married?"

"Oh, I only know her slightly," Rodrigo had replied offhandedly. "She
comes of an excellent San Francisco family, I believe, connected with the
Palmers—your father-in-law knows the Palmers well."

"I wasn't thinking of her family. But will she make old John happy?"

"Why not?"

You might also like