Download Full Python for the Busy Java Developer: The Language, Syntax, and Ecosystem 1st Edition Deepak Sarda (Auth.) PDF All Chapters
Download Full Python for the Busy Java Developer: The Language, Syntax, and Ecosystem 1st Edition Deepak Sarda (Auth.) PDF All Chapters
com
https://textbookfull.com/product/python-for-the-busy-java-
developer-the-language-syntax-and-ecosystem-1st-edition-
deepak-sarda-auth/
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-loucas/
textboxfull.com
https://textbookfull.com/product/microorganisms-for-green-revolution-
volume-2-microbes-for-sustainable-agro-ecosystem-1st-edition-deepak-g-
panpatte/
textboxfull.com
https://textbookfull.com/product/java-ee-development-with-eclipse-1st-
edition-vohra-deepak/
textboxfull.com
https://textbookfull.com/product/java-quick-syntax-reference-second-
edition-olsson/
textboxfull.com
Haskell Quick Syntax Reference: A Pocket Guide to the
Language, APIs, and Library 1st Edition Stefania Loredana
Nita
https://textbookfull.com/product/haskell-quick-syntax-reference-a-
pocket-guide-to-the-language-apis-and-library-1st-edition-stefania-
loredana-nita/
textboxfull.com
https://textbookfull.com/product/c17-quick-syntax-reference-apocket-
guide-to-the-language-apis-and-library-2-edition-edition-olsson/
textboxfull.com
https://textbookfull.com/product/c17-quick-syntax-reference-a-pocket-
guide-to-the-language-apis-and-library-third-edition-olsson/
textboxfull.com
https://textbookfull.com/product/c-7-quick-syntax-reference-a-pocket-
guide-to-the-language-apis-and-library-mikael-olsson/
textboxfull.com
Deepak Sarda
Python for the Busy Java Developer
Deepak Sarda
Singapore, Singapore
iii
Table of Contents
Classes�������������������������������������������������������������������������������������������������������������� 34
Inheritance�������������������������������������������������������������������������������������������������� 37
Polymorphism���������������������������������������������������������������������������������������������� 38
Getting Dynamic!����������������������������������������������������������������������������������������� 39
Protocols����������������������������������������������������������������������������������������������������������� 42
Organizing Code������������������������������������������������������������������������������������������������ 45
Importing code�������������������������������������������������������������������������������������������� 45
The main() Method�������������������������������������������������������������������������������������� 48
Summary���������������������������������������������������������������������������������������������������������� 57
iv
About the Author
Deepak Sarda has been working as a software
developer for more than twelve years, in
multiple business domains and in a variety of
technologies. He has worked on several high-
performance, server-side applications written
in Java, and has done web development and
systems automation work in Python.
He lives in Singapore with his lovely wife
and their adorable daughters. He can be found
online at antrix.net or @antrix on Twitter.
He’d love to hear what you’ve to say about this book. Please email him
at deepak@antrix.net.
v
About the Technical Reviewer
Chaim Krause is an expert computer
programmer with over 30 years of experience
to prove it. He has worked as a lead tech
support engineer for ISPs as early as 1995,
as a senior developer support engineer with
Borland for Delphi, and has worked in Silicon
Valley for over a decade in various roles,
including technical support engineer and
developer support engineer. He is currently
a military simulation specialist for the US
Army’s Command and General Staff College, working on projects such as
developing serious games for use in training exercises.
He has also authored several video training courses on Linux topics
and has been a technical reviewer on more than 20 books, including
iOS Code Testing by Abhishek Mishra (Apress, 2017), Android Apps for
Absolute Beginners by Wallace Jackson (Apress, 2017), and C# and XML
Primer: XML Essentials for C# and .NET Development by Jonathan Hartwell
(Apress, 2017). It seems only natural that he would be an avid gamer
and have his own electronics lab and server room in his basement. He
currently resides in Leavenworth, Kansas, with his loving partner, Ivana,
and a menagerie of four-legged companions: their two dogs, Dasher and
Minnie, and their three cats, Pudems, Talyn, and Alaska.
vii
Acknowledgments
I’d always heard it being said, but only now do I truly realize it: writing a
book is hard work! It would have been harder still had it not been for the
support from my family and friends.
I wish to especially thank Hitesh Sarda, Rohit Sharma, and Srijith Nair
for the incredibly detailed and thoughtful feedback that they provided as I
wrote this book. I owe many thanks to them.
I must also acknowledge the constant encouragement that I received
from my wife, Sonika. I can’t thank her enough for her patience and
support as I took time out to write this book.
ix
Introduction
Hello There!
If you are reading this book, then chances are that you are a busy Java
developer who is interested in learning Python. If so, I hope that by the
time you are done reading this short book.
This book is not for the beginner programmer. I assume that you
are comfortable programming in Java (or a similar language like C#),
and hence, I will not bore you with explanations of basic concepts like
variables, functions, and classes.
• The Language
• The Syntax
• The Ecosystem
In the first chapter, we take a brief look at the Python language and
learn what it has to offer. Next, we’ll get down to the details of the syntax
before wrapping up with a look at the wider ecosystem surrounding the
Python language.
xi
CHAPTER 1
The Language
Let’s start our Python journey by first gaining an understanding of what
Python has to offer that’s different from Java. I’ll then help you get setup
with Python before we dive into the language’s syntax in the next chapter.
What Is Python?
Python is an “open source, general-purpose programming language that is
dynamic, strongly typed, object-oriented, functional, memory-managed,
and fun to use.” Those are a lot of adjectives for one sentence! Let’s unpack
them one at a time.
Python is distributed under an open source, BSD-style license called the
Python Software Foundation License Agreement. It is a very permissive
license that allows great flexibility in how Python can be used. Python’s
development is done in the open by a large and diverse community of
volunteers.
Python is general purpose in that you can use it to build a variety
of applications running the gamut from simple scripts and command-
line tools to desktop and web applications, network servers, scientific
applications, and more.
We know that Java is a statically typed language; that is, the types are
checked and enforced at compile time. In contrast, Python is dynamic,
which means that the types are checked only at runtime. But Python is
also strongly typed, just like Java. You can only execute operations that are
supported by the target type.
Another way to think about this is that in Java, both variables and
objects have types associated with them; whereas in Python, only objects
have types, not the variables that they are bound to. In Java, when we
declare
The obj variable is declared of type MyType and then the newly
instantiated object of type MyType is assigned to it. In contrast, in Python,
the same declaration would read
obj = MyType()
Ignoring the missing new keyword (which Python doesn’t have), obj is
simply a name that is bound to the object on the right, which happens to
be of type MyType. We can even reassign obj in the very next line—obj =
MyOtherType()—and it wouldn’t be a problem. In Java, this reassignment
would fail to compile1 while in Python, the program will run and will only
fail at runtime if we try to execute an operation via obj that is incompatible
with the type assigned to it at that point in time.
Python is object oriented and supports all the standard OOP features
that Java has like creation of types using classes, encapsulation of state,
inheritance, polymorphism, and so forth. It even goes beyond Java and
supports features such as multiple inheritance, operator overloading,
meta-programming, and so forth.
Python also supports a rich set of functional programming features
and idioms. In Python, functions are first-class objects that can be created,
manipulated, and passed around just like any other object. While its
emphasis on functional programming might not be as focused as say
1
Unless MyOtherType happens to be a subclass of MyType.
2
Chapter 1 The Language
H
istory
Python is the brainchild of a Dutch programmer named Guido van
Rossum. He started working on it when he got frustrated with the ABC
language in the late 1980s and after some years of private development,
he released the first version of Python in 1994. This actually makes
Python older than Java, the first version of which was released in 1996,
a full two years later! A comparison of the two languages is shown in
Table 1-1.
2
Even after the introduction of lambdas in Java 8.
3
Chapter 1 The Language
Java Python
Note I’ll use this tabular format to compare and contrast Python
and Java whenever it makes sense.
Since then, the language has continued to refine and evolve, with
Python 2.0 being released in 2000. As of this writing, the 2.x versions are
the most widely deployed.
In version 3.0, the language designers decided to break backward
compatibility in order to clean up some of the accumulated language
warts. Although this has been good from a language perspective, it has
been a significant hindrance to those upgrading from 2.x to 3.x. Imagine
if Sun had decided to introduce generics in Java 5 without type erasure,
thus breaking backward compatibility. The Java language would’ve been
much nicer today but the transition period would’ve been difficult, to say
the least. That is the kind of transition the Python user community is going
through right now.
4
Chapter 1 The Language
Note Since 2.x is still the most widely used version of Python,
this book will cover Python 2.x features and syntax, calling out any
differences with 3.x from time to time.
From the outset, Python’s development has been done in the open
with a community of volunteers contributing to the language and the core
libraries. Any language changes are proposed and discussed through a
process called PEP (Python Enhancement Proposals), with Guido having
final say in deciding the outcome. For his stewardship and continuous
involvement in the development of Python, Guido is affectionately called
the “Benevolent Dictator For Life.” He also periodically writes a Python
History blog3 chronicling the evolution of various language features.
I nstallation
This book is full of example code, and the best way to follow along is to
actually try these examples by yourself. To do this, you’ll obviously need to
install Python on your system. But an easier way is to check if you already
have access to a system with Python installed! Almost all systems running
Linux should have Python preinstalled. Recent versions of Mac OS X also
come with Python preinstalled. Just open a command shell on either of
these two systems and type in python. If you get a Python shell prompt,
you are all set! The version of Python installed may be a bit outdated but it
should be sufficient to get started.
3
http://python-history.blogspot.com/
5
Chapter 1 The Language
T ools
Python source code is organized in files with a .py extension. The python
executable interprets the source code and translates it into a Python
language–specific bytecode that is stored in .pyc files. This bytecode is
then executed by the Python virtual machine, which is also invoked by the
same python executable. Although this sounds like two steps, in reality, it
is just one step with the bytecode generation happening on the fly.
This is in contrast to Java (see Table 1-2), where the responsibilities for
the parsing and compilation of source code and the actual execution of
the compiled bytecode are split between javac and java respectively. In
Python, the python executable handles both steps. In fact, .pyc files are,
in effect, just intermediate caches to hold the translated bytecode. They
are not strictly necessary for execution. If you deleted the .pyc files, they’d
simply be regenerated the next time you ran the .py files.
.java .py
.class .pyc
Java.exe + javac.exe python.exe
IntelliJ IDEA PyCharm
Eclipse JDT PyDev
Java 9 JShell REPL
6
Chapter 1 The Language
There are multiple IDEs available for writing Python code. PyDev,
based on the Eclipse framework, and PyCharm, based on the IntelliJ IDEA
framework, are two of the more popular choices. While having an IDE is
nice, it is perfectly feasible to write Python code using a plain text editor
such as Vim4 or Sublime Text.
One interesting feature of Python that’s missing in Java is the REPL,
short for Read Eval Print Loop. A quick demo would be useful here. If
you’ve got access to a Python installation (follow the instructions in the
“Installation” section of this chapter), go ahead and launch a python shell,
as follows:
antrix@dungeon:~$ python
Python 2.7.5+ (default, Feb 27 2014, 19:39:55)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>>
>>> 10 + 10
20
>>>
4
Yes, Emacs is fine too.
7
Chapter 1 The Language
We typed in 10 + 10 at the prompt and hit the Enter key. The Python
REPL read this value, evaluated it, and printed the result. Then it went back
to the prompt to wait for our next input. Let’s try the following variable
assignment:
>>> x = 10
>>>
In this case, we didn’t see any output because what we entered was just
a statement, not an expression. But it did modify the state of the python
shell. If we query for x again, we’ll find this:
>>> x = 10
>>> x
10
>>>
>>> help(x)
>>>
8
Chapter 1 The Language
The full documentation view for an object can be quite verbose. If you
just want a quick overview of what attributes an object supports, use the
dir function.
>>> dir(x)
>>>
>>> x.numerator
10
>>> x.denominator
1
>>> x.conjugate
<built-in method conjugate of int object at 0x9e9a274>
9
Chapter 1 The Language
>>> x.conjugate()
10
You can also use the dir() function without any argument to get a list
of built-ins.
>>> dir()
>>> dir(__builtins__)
10
Chapter 1 The Language
>>>
This gives a list of functions and other objects that are built-in and do
not have to be imported from other packages. This is analogous to how
everything defined in the java.lang package is available everywhere in
Java without having to explicitly import it.
Tip The dir and help functions are extremely useful when doing
exploratory development in a Python interactive shell.
There’s one last thing I wish to show before we wrap up this section.
Let’s create a new file named hello.py with the following contents:
11
Chapter 1 The Language
Summary
In this chapter, we learned that Python is not just a scripting language but a
general-purpose programming language with a long history behind it. We
then got familiar with the python executable, the Python counterpart of the
java and javac executables.
We also looked at the Python REPL environment, which is a great way
to interactively try out Python. If you still don’t have the REPL set up, I urge
you to do so now because the next chapter makes extensive use of it as we
dive into the nitty-gritty details of the language’s syntax!
12
CHAPTER 2
The Syntax
This chapter is the heart of the book. It is a deep dive into Python language
features. I explain them using short code fragments that you can easily try
out yourself.
We start by introducing the basic data types and built-in collections
such as dictionaries and sets, with a special emphasis on lists. We’ll then
dive into functions and discover their power as a first-class language
feature.
Moving on to classes, we’ll find out how flexible Python is as an
object-oriented language, especially compared to Java. We’ll then explore
protocols, which extend the language’s syntax to your own types.
Finally, we’ll discuss the concepts of modules and packages as a means
of organizing Python code.
As you can see, it is going to be a long chapter. So grab some coffee and
let’s get started!
H
ello World
>>> print "Hello World"
Hello World
>>>
Tip In Python 3, the print keyword has been replaced with the
print() function.
Basic Constructs
Here’s a bit of Python code that, well, I don’t have to tell you what it
does, do I? Most Python code is like this: eminently readable and almost
pseudo-code-like.
You must have noticed a few things, such as the lack of semicolons as
statement separators. Let’s work through this code one line at a time to see
what else is new and different compared to Java.
14
Chapter 2 The Syntax
15
Chapter 2 The Syntax
Basic Types
Some of the basic data types in Python are numbers, strings, and
collections.
Numbers
Numbers come in the following variety.
int 1000
long 1000L
float 1000.12
complex 1000 + 12j
Although int and long are different data types, in practice, you only
need to worry about them when declaring literal values; that is, literal
longs need to be declared with a L suffix. During arithmetic operations,
Python automatically converts int values to long values as needed. This
also prevents overflow-related bugs.
16
Chapter 2 The Syntax
Strings
As in Java, strings are immutable in Python. String values can be wrapped
in either single or double quotes. To differentiate between vanilla ASCII
strings and Unicode strings, Python uses the u prefix to denote the latter.
Unicode strings provide additional operations related to encoding/
decoding from various character sets.
str 'apple'
unicode u'äþþĺė'
str r'C:\temp'
A third type of string is the raw string denoted by the r prefix. This is
just an indication to the Python parser to not apply any backslash escaping
rules to the string. Here’s a quick example that illustrates the difference.
17
Chapter 2 The Syntax
As you can imagine, raw strings are extremely useful when denoting
file system paths or regular expressions.
Collections
The built-in Python collections come in four varieties.
Tip While tuple and list may look similar, the distinction is that
a tuple is immutable.
18
Chapter 2 The Syntax
Apart from single element access, what sets apart Python lists is the
ability to extract element ranges from lists. This is accomplished using the
slice syntax. Here’s how.
>>> numbers[0:4] ①
[0, 1, 2, 'three']
>>> numbers[:4] ②
[0, 1, 2, 'three']
19
Chapter 2 The Syntax
>>> numbers[4:] ③
[4, 5, 6, 7, 8, 9]
>>> numbers[2:-2] ④
[2, 'three', 4, 5, 6, 7]
>>> numbers[0:9:2] ⑤
[0, 2, 4, 6, 8]
>>> numbers[::2] ⑥
[0, 2, 4, 6, 8]
>>> numbers[::-1] ⑦
[9, 8, 7, 6, 5, 4, 'three', 2, 1, 0]
20
Exploring the Variety of Random
Documents with Different Content
just so will the most highly trained men in the future outdistance all
others in endurance.
Navy. We now come to the consideration of the Navy. The Navy
will use gas both in its guns and in smoke clouds, and in some form
of candle that will float. The toxic smokes that in high enough
concentrations will kill are extraordinarily irritating in minute
quantities—so minute they cannot be seen or felt for a few moments.
Every human being on a ship must breathe every minute just as
every human being everywhere must breathe every minute or die. A
gas that gets into the ventilating system of a ship will go all through it
and the Navy realizes it.
The Navy is studying how to keep the gas out of their own ships,
and how to get it into the enemy’s ships. The toxic smokes may be
dropped from aeroplanes or turned loose from under water by
submarines. In either case they will give off smokes over wide areas
through which ships must pass. Any defects will let these toxic
smokes in and will force every man to wear a mask. Aeroplane
bombs will come raining down on the ship or alongside of it either
with toxic smokes or other terrible gases. White phosphorus that
burns and cannot be put out wet or dry will be rained on ships. Yes,
chemical warfare materials will be used by the Navy.
Gas Against Landing Parties. The use of gas against landing
parties or to aid landing parties has come up in many ways. Our
studies to date indicate that gas is a greater advantage to the
defense against landing parties than to the offense. Mustard gas and
the like may be sprinkled from aeroplanes, and while it will not float
long on the water, it will float long enough to smear any small boats
attempting to land. It can be sprinkled over all the areas that landing
parties must occupy. Mustard gas may be placed in bombs or drums
around all areas that are apt to be used as landing places and
exploded in the face of advancing troops.
Storing Reserve Gases in Peace. And a word here about how
long gases may be stored. One of the statements made by
opponents of chemical warfare was that gas is a purely war time
project and could not be stored up in peace. We have today at
Edgewood Arsenal some 1,400 tons of poisonous gases not
including chlorine. Those gases have been manufactured, practically
every ounce of them, for three years, and are yet in almost perfect
condition. Our chemists believe they can be kept in the future for ten
years and perhaps longer. Our gas shells then will have the life
almost of a modern battleship, while the cost of a million will be but a
fraction of the cost of a battleship. What I have just said applies
particularly to liquid gases such as phosgene, chlorpicrin, and
mustard gas. We know that many of the solids may be kept for far
longer periods.
Storing Gas Masks. Our masks, too, we believe can be kept for
at least ten years. Experience to date indicates that rubber
deteriorates mainly through the action of sunlight and moisture that
cause oxidation or other change in the crystalline structure of cured
rubber. Accordingly, we are putting up masks today in hermetically
sealed boxes. It is thus evident that we can store a reserve of masks
and gases in peace the same as other war materials.
Use of Gas by Gas Troops. Now we come to the use of gas by
special gas troops. In the war, Gas Troops used 4-inch Stokes’
mortars and 8-inch Livens’ projectors and in a very short time would
have used a new portable cylinder for setting off cloud gas, using
liquid gases, such as phosgene. They will use these same weapons
in future wars. All of these are short-range weapons, but since the
Livens’ bomb or drum contains 50 per cent of its weight in gas while
the artillery shell contains 10 per cent, they have an efficiency away
beyond that of artillery or any other method of discharging gas
except cloud gas. They will, therefore, produce more casualties than
any other method known for the amount of material taken to the
front. These short-range weapons were developed by the British for
trench use and not for open warfare, and yet our troops developed
methods with the Stokes’ mortars that enabled them to keep up with
many of the Infantry divisions.
Phosphorus and Thermit Against Machine Gun Nests. The
use of phosphorus and thermit against German machine gun nests
by the Gas Troops is well known. How effective it was is not known
to so many. Phosphorus and thermit were so used from the early
days of the Marne fight in the latter part of July, 1918, to the very
close of the war. There is no recorded instance where the Gas
Troops failed to silence machine gun nests once the machine guns
were located. In the future Gas Troops will put off the majority of all
cloud gas attacks even with toxic smoke candles.
Necessity for Training in Peace. This is an outline of the
subject of chemical warfare. As stated in the beginning, the
fundamental underlying principles for the successful use of
poisonous gas is necessarily the same as for any other war
materials. The necessity for continuous training in peace is just the
same with chemical warfare as with the rifle, the machine gun, with
field artillery or any other weapon of war. Indeed it is more so
because the use of gas is so perfectly adaptable to night work. Men
must be taught to take precautionary measures when so sleepy, tired
and worn out that they will sleep through the roar of artillery.
How Chemical Warfare Should be Considered. We ask you
only to look at the use of chemical warfare materials as you look at
the use of the artillery, infantry, cavalry, tanks or aeroplanes.
Measure its possible future use; not simply by its use in the World
War, but by considering all possible developments of the future.
Remember that its use was barely four years old when the war
closed, while the machine gun, the latest type of infantry weapon,
had been known for more than one-third of a century. Chemical
warfare developments are in the infant stage. Even those on the
inside of chemical warfare when the Armistice was signed can see
today things that are certain to come that were undreamed of at that
time. This is bound to be so with a new weapon.
To sum up, gas is a universal weapon, applicable to every arm
and every sort of action. Since we can choose gases that are either
liquid or solid, that are irritating only or highly poisonous, that are
visible or invisible, that persist for days or that pass with the wind, we
have a weapon applicable to every act of war and for that matter, to
every act of peace. But we must plan its use, remembering there is
no middle ground in war, it is success or failure, life or death.
Remember also that training outruns production in a great war, that
5,000,000 men can be raised and trained before they can be
equipped unless we with proper foresight build up our essential
industries, keep up our reserve of supplies, and above all, keep such
perfect plans that we can turn all the wheels of peace into the wings
of war on a moment’s notice.
CHAPTER XXIII
THE OFFENSIVE USE OF GAS
Technical Nature
Chemical warfare, besides being the newest, is the most
technical and most highly specialized Service under the War
Department. There is no class of people in civil life, and no officers
or men in the War Department, who can take up chemical warfare
successfully until they have received training in its use. This applies
not only to the use of materials in attack, but to the use of materials
for defense. Ten years from now perhaps this will not be true. It is
certainly hoped that it will not be. By that time the entire Army should
be pretty thoroughly trained in the general principles and many of the
special features of chemical warfare. If not, chemical warfare cannot
be used in the field with the efficiency and success with which it
deserves to be used. Furthermore, it is believed that within ten years
the knowledge of the gases used in chemical warfare will be so
common through the development of the use of these same
materials in civil life, that it will not be so difficult, as at the present
date, to get civilians who are acquainted with Chemical Warfare
Service materials.
Effectiveness of Gas
Chemical warfare materials were used during the war by
Chemical Warfare Service troops, by the Artillery and by the Infantry.
In the future the Air Service and Navy will be added to the above list.
Chemical warfare, even under the inelastic methods of the Germans,
proved one of the most powerful means of offense with which the
American troops had to contend. To realize its effectiveness we need
only remember that more than 27 out of every 100 casualties on the
field of battle were from gas alone. Unquestionably many of those
who died on the battlefield from other causes suffered also from gas.
No other single element of war, unless you call powder a basic
element, accounted for so many casualties among the American
troops. Indeed, it is believed that a greater number of casualties was
not inflicted by any other arm of the Service, unless possibly the
Infantry, and even in that case it would be necessary to account for
all injured by bullets, the bayonet, machine guns and hand grenades.
This is true, in spite of the fact that the German was so nearly
completely out of gas when the Americans began their offensive at
St. Mihiel and the Argonne, that practically no gas casualties
occurred during the St. Mihiel offensive, and only a very few until
after a week of the Argonne fighting. Furthermore, the Germans
knew that an extensive use of mustard gas against the American
lines on the day the attack was made, and also on the line that
marked the end of the first advance a few days later, would have
produced tremendous casualties. Judging from the results achieved
at other times by an extensive use of mustard gas, it is believed that
had the German possessed this gas and used it as he had used it a
few other times, American casualties in the Argonne would have
been doubled. In fact, the advance might even have been entirely
stopped, thus prolonging the war into the year 1919.
Humanity of Gas
A few words right here about the humanity of gas are not out of
place, notwithstanding the Army and the general public have now so
completely indorsed chemical warfare that it is believed the
argument of inhumanity has no weight whatever. There were three
great reasons why chemical warfare was first widely advertised
throughout the world as inhumane and horrible. These reasons may
be summed up as follows:
In the first place, the original gas used at Ypres in 1915 was
chlorine, and chlorine is one of a group of gases known as
suffocants—gases that cause death generally by suffocating the
patient through spasms of the epiglottis and throat. That is the most
agonizing effect produced by any gas.
The second reason was unpreparedness. The English had no
masks, no gas-proof dugouts, nor any of the other paraphernalia that
was later employed to protect against poisonous gas. Consequently,
the death rate in the first gas attack at Ypres was very high, probably
35 per cent. As a matter of fact, every man who was close to the
front line died. The only ones who escaped were those on the edges
of the cloud of gas or so far to the rear that the concentration had
decreased below the deadly point.
The third great reason was simply propaganda. It was good war
propaganda to impress upon everybody the fact that the German
was capable of using any means that he could develop in order to
win a victory. He had no respect for previous agreements or ideas
concerning warfare. This propaganda kept up the morale and
fighting spirit of the Allies, and was thoroughly justifiable upon that
score, even when it led to wild exaggeration.
The chlorine used in the first attack by the German is the least
poisonous of the gases now used. Those later introduced, such as
phosgene, mustard gas and diphenylchloroarsine are from five to ten
times as effective.
The measure of humanity for any form of warfare is the
percentage of deaths to the total number injured by the particular
method of warfare under consideration.
American Gas Casualties. The official list of casualties in battle
as compiled by the Surgeon General’s office covering all cases
reported up to September 1, 1919, is 258,338. Of these 70,752, or
27.4 per cent, were gas casualties. Also of the above casualties
46,519 resulted in death, of whom about 1,400 only were due to gas.
From these figures it is readily deduced that while 24.85 per cent of
all casualties from bullets and high explosives resulted in death, only
2 per cent of those wounded by gas resulted in death. That is, a man
wounded on the battle field with gas had twelve times as many
chances of recovery as the man who was wounded with bullets and
high explosives.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com