100% found this document useful (1 vote)
36 views76 pages

Concise Guide to Object Oriented Programming An Accessible Approach Using Java Undergraduate Topics in Computer Science 1st Edition Kingsley Sage - Download the ebook now and read anytime, anywhere

The document promotes the 'Concise Guide to Object-Oriented Programming' by Kingsley Sage, which provides an accessible introduction to coding and Object-Oriented Programming (OOP) using Java. It is designed for beginners with no prior coding experience and covers essential programming concepts, principles, and practical applications. The book is part of the Undergraduate Topics in Computer Science series, aimed at enhancing programming skills relevant to modern IT demands.

Uploaded by

arpytoyup
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)
36 views76 pages

Concise Guide to Object Oriented Programming An Accessible Approach Using Java Undergraduate Topics in Computer Science 1st Edition Kingsley Sage - Download the ebook now and read anytime, anywhere

The document promotes the 'Concise Guide to Object-Oriented Programming' by Kingsley Sage, which provides an accessible introduction to coding and Object-Oriented Programming (OOP) using Java. It is designed for beginners with no prior coding experience and covers essential programming concepts, principles, and practical applications. The book is part of the Undergraduate Topics in Computer Science series, aimed at enhancing programming skills relevant to modern IT demands.

Uploaded by

arpytoyup
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/ 76

Read Anytime Anywhere Easy Ebook Downloads at ebookmeta.

com

Concise Guide to Object Oriented Programming An


Accessible Approach Using Java Undergraduate
Topics in Computer Science 1st Edition Kingsley
Sage
https://ebookmeta.com/product/concise-guide-to-object-
oriented-programming-an-accessible-approach-using-java-
undergraduate-topics-in-computer-science-1st-edition-
kingsley-sage/

OR CLICK HERE

DOWLOAD EBOOK

Visit and Get More Ebook Downloads Instantly at https://ebookmeta.com


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

Algebraic Graph Algorithms A Practical Guide Using Python


Undergraduate Topics in Computer Science K. Erciyes

https://ebookmeta.com/product/algebraic-graph-algorithms-a-practical-
guide-using-python-undergraduate-topics-in-computer-science-k-erciyes/

ebookmeta.com

Discrete Mathematics and Graph Theory: A Concise Study


Companion and Guide (Undergraduate Topics in Computer
Science) K. Erciyes
https://ebookmeta.com/product/discrete-mathematics-and-graph-theory-a-
concise-study-companion-and-guide-undergraduate-topics-in-computer-
science-k-erciyes/
ebookmeta.com

Ethical and Secure Computing A Concise Module


Undergraduate Topics in Computer Science Joseph Migga
Kizza
https://ebookmeta.com/product/ethical-and-secure-computing-a-concise-
module-undergraduate-topics-in-computer-science-joseph-migga-kizza/

ebookmeta.com

Only The Stains Remain Ross Jeffery

https://ebookmeta.com/product/only-the-stains-remain-ross-jeffery/

ebookmeta.com
Anti Catholicism in Victorian England Routledge Library
Editions The Victorian World Norman

https://ebookmeta.com/product/anti-catholicism-in-victorian-england-
routledge-library-editions-the-victorian-world-norman/

ebookmeta.com

A Concise History Of International Finance From Babylon To


Bernanke 1st Edition Larry Neal

https://ebookmeta.com/product/a-concise-history-of-international-
finance-from-babylon-to-bernanke-1st-edition-larry-neal/

ebookmeta.com

Deconstructing Doctoral Discourses: Stories and Strategies


for Success 1st Edition Deborah L. Mulligan

https://ebookmeta.com/product/deconstructing-doctoral-discourses-
stories-and-strategies-for-success-1st-edition-deborah-l-mulligan/

ebookmeta.com

Xero : A Comprehensive Guide for Accountants and


Bookkeepers 1st Edition Amanda Aguillard

https://ebookmeta.com/product/xero-a-comprehensive-guide-for-
accountants-and-bookkeepers-1st-edition-amanda-aguillard/

ebookmeta.com

The Public Speaking Playbook 3rd Edition Teri Kwal Gamble

https://ebookmeta.com/product/the-public-speaking-playbook-3rd-
edition-teri-kwal-gamble/

ebookmeta.com
Architecture Patterns with Python 1st Edition Harry
Percival

https://ebookmeta.com/product/architecture-patterns-with-python-1st-
edition-harry-percival/

ebookmeta.com
Undergraduate Topics in Computer
Science

Series Editor
Ian Mackie
University of Sussex, Brighton, UK

Advisory Editors
Samson Abramsky
Department of Computer Science, University of Oxford, Oxford, UK

Chris Hankin
Department of Computing, Imperial College London, London, UK

Dexter C. Kozen
Computer Science Department, Cornell University, Ithaca, NY, USA

Andrew Pitts
William Gates Building, University of Cambridge, Cambridge, UK

Hanne Riis Nielson


Department of Applied Math and Computer Science, Technical University
of Denmark, Kgs. Lyngby, Denmark

Steven S. Skiena
Department of Computer Science, Stony Brook University, Stony Brook,
NY, USA

Iain Stewart
Department of Computer Science, Science Labs, University of Durham,
Durham, UK
Mike Hinchey
Lero, Tierney Building, University of Limerick, Limerick, Ireland

‘Undergraduate Topics in Computer Science’ (UTiCS) delivers high-


quality instructional content for undergraduates studying in all areas of
computing and information science. From core foundational and
theoretical material to final-year topics and applications, UTiCS books
take a fresh, concise, and modern approach and are ideal for self-study
or for a one- or two-semester course. The texts are all authored by
established experts in their fields, reviewed by an international
advisory board, and contain numerous examples and problems, many
of which include fully worked solutions.
The UTiCS concept relies on high-quality, concise books in softback
format, and generally a maximum of 275-300 pages. For undergraduate
textbooks that are likely to be longer, more expository, Springer
continues to offer the highly regarded Texts in Computer Science series,
to which we refer potential authors.
More information about this series at http://​www.​springer.​com/​
series/​7592
Kingsley Sage

Concise Guide to Object-Oriented


Programming
An Accessible Approach Using Java
Kingsley Sage
School of Engineering and Informatics, University of Sussex, Falmer,
East Sussex, UK

ISSN 1863-7310 e-ISSN 2197-1781


Undergraduate Topics in Computer Science
ISBN 978-3-030-13303-0 e-ISBN 978-3-030-13304-7
https://doi.org/10.1007/978-3-030-13304-7

Library of Congress Control Number: 2019931822

© Springer Nature Switzerland AG 2019

This work is subject to copyright. All rights are reserved 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 Springer imprint is published by the registered company Springer


Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham,
Switzerland
Preface
The twenty-first century continues to experience the relentless
expansion of the IT revolution into our daily lives. We consume
services, do our shopping on-line, listen to music streams and watch
movies on demand. The impact of social media has had a profound
impact on our society and has changed fundamentally the way we
obtain and consume news, information and ideas. There is little sign of
a slowdown in this dramatic shift in our relationship with technology.
Vast research budgets are being applied to the development of
autonomous vehicles, and in applying Artificial Intelligence to change
the way we live. But it has also changed the demand for skills within
our workforce. The demand for manual skills is in decline, and the
demand for IT and programming skills is rising at an unprecedented
rate.
In comparison to the industrialists of the nineteenth and twentieth
centuries, the twenty-first-century entrepreneurs are experts in IT,
programming, software design and development, and developing
practical applications using concepts such as Artificial Intelligence for
our daily lives. With this profound paradigm shift has come a need for
the workforce of many industrialised nations to evolve. Governments
recognise the need for a huge increase in the workforce with
programming skills. In the United Kingdom, and in many other
industrialised nations, core coding skills are now a part of the
secondary school curriculum. Learning to program is no longer
considered to be just a part of the traditional journey of the Computer
Science undergraduate, but a broader skill that underpins an IT literate
workforce for the modern age.

What is the Purpose of This Book?


When I was first approached to write this book, it was suggested that
its purpose was to provide an accessible introduction to coding and the
world of Object Oriented Programming (OOP). Standard texts on the
subject often fall between those that provide only a very lightweight
treatment of the subject (“a little knowledge can be a frustrating
thing”), and those that run to 500 pages or more that are rather better
suited as reference texts or as support on a lengthy period of study in
depth. The challenge for this book is to provide an accessible
introduction to the world of coding and OOP in a way that is helpful to
the first-time coder and allows them to develop and to understand their
knowledge and skills in a way that is relevant and practical. The
examples developed for this book are intended to show how OOP skills
can be used to create applications and programs that have everyday
value, rather than examples that have been synthesised solely to
demonstrate an academic point.
The reader should be able to use this book to develop a solid
appreciation of OOP and how to code. The programming language used
throughout is Java. Java has been chosen as it can be used across all
computing platforms, because it has a commercial skill that has a clear
on-going value derived from its adoption as a core language for
smartphone applications on the Android platform, and as the language
at the heart of the Java EE 8 Jakarta Enterprise scale framework. The
book focusses on the core Java language and does not consider
smartphone or EE 8 coding, as these require skills over and above what
this book is about. However, a knowledge of core Java coding and some
of the related issues also discussed in this book would form an
appropriate pre-requisite for the further study of these topics.
Although this book uses Java as its illustrative programming
language, many of the ideas may be translated directly into other OO
languages such as C++, C# and others. Throughout this book,
programming in Java is demonstrated using the BlueJ Integrated
Development Environment (IDE). BlueJ is a well-established IDE for
learning BlueJ and is widely used in schools and Universities. Eclipse is
the closest product to an industry standard for the development of Java,
but it is often found too complex for the task of teaching and learning.
Who is This Book Aimed at?
As someone with over 20 years of teaching experience from level 3
through to postgraduate, from traditional University teaching to adult
education, I have never been able to identify satisfactorily what defines
the ability of an individual to learn to program. Suffice to say, all that is
really needed is an interest in the subject and time. The aim of this book
is to provide an accessible entry into the world of Object Oriented
Programming (OOP).
The book does not assume any prior knowledge of coding, or any
prior knowledge of software engineering or OO, not does it require any
prior exposure to mathematics. Whilst such prior knowledge is not
unhelpful, it is not essential to learn to program. Instead, this book
takes a more everyday experience to the subject, drawing on examples
from everyday experience to explain what OO is and why it is relevant
in the modern programming experience. As such, the book is aimed at
those who are coming to OO programming for the first time. It is
therefore likely to be useful as a one-semester book introducing the
topic to those new to the study of computer science at the
undergraduate and postgraduate levels, and those who are just learning
for the purpose of self-improvement or professional development.
Whilst the book is aimed at those with no prior coding experience, it
does explore broader topics surrounding coding. This with some prior
knowledge may opt to skip some of the early chapters. That does not
impact the usefulness of this book in terms of learning to code in Java.

What’s in the Book?


Chapter 1 starts with an overview of what programming and coding is
all about. It includes some useful historical perspective on the
development of programming languages and the core ideas that
underpin all programming languages. It introduces the idea of a
computing machine and concepts such as a compiler. This section is
helpful to those who have no prior experience of computing as it helps
subsequent understanding of some of the core coding processes and
terminology. The chapter then continues to discuss how the need for
OOP arose in the period from the end of the 1970s to the present day,
and a discussion of why it is considered important to help us solve
modern-day programming problems.
Chapter 2 provides a short introduction to programming in Java
using BlueJ. It is intended to provide just enough knowledge and skills
to create and execute a single-class Java program under BlueJ. This is
significant as it then facilitates discussion of the core principles of
procedural and structured programming, such as loops and conditional
statements. Those with prior experience of coding using languages
such as C and Python may opt to skip this chapter, as they would
undoubtedly be familiar with much of the content. I chose to organise
the book this way as the basic procedural and structured coding
constructions are common to almost all programming (or at least those
that owe their syntactic ancestry to C), and getting these constructions
understood at this stage allows for a more specific focus later on the
principles of OO.
Chapter 3 gets into the details of what OO really is and how it can be
applied to solve modern programming challenges. We start with a
discussion of what classes and objects are, and how the construction
and execution of an OO program parallels the way that human
organisations such as a large office operate. Such analogies are
invaluable in appreciating the true benefits of the OO paradigm. In this
chapter, we develop a set of small multi-class Java applications and
consider the cornerstone issues in OO design of class cohesion and
coupling.
Chapter 4 considers a range of Java library objects and packages
such as the String and the ArrayList , and introduces the idea of
the Application Programming Interface (API). This enables the reader
to start building more complex applications involving simple linear
collections of objects. These ideas are developed using a set of simple
programs that can be enhanced in many different ways as an exercise
for the reader.
Chapter 5 delves further into the OO paradigm and considers how
OO design forms an essential part of producing a useful solution to a
problem. The chapter introduces the idea of class polymorphism (super
and sub-classes) and how this can be used to create a program with a
structure that more closely mirrors an underlying domain. The chapter
also looks further into the idea of selecting classes that are suited to
solving specific problem and so also has elements of software
engineering principles and practice.
Chapter 6 considers what to do when code encounters an error
condition. Software systems are not immune to errors either at the
coding or at the run time phases, and modern software systems need to
be built in a robust manner so that they behave in a predictable manner
when something goes wrong. The exception handling mechanism is
introduced, along with steps on laying out a program to assist in
debugging it. This chapter also considers practical measures that are
adopted in defensive coding.
Chapter 7 digs deeper into the work of arrays and collections,
notably fixed length arrays, the HashMap and HashSet , and shows
how different collection types can be used to effectively model different
real-world collections of data. This chapter also includes some
background on the underlying ideas for these collection types, such as
the hash table.
Chapter 8 provides an introduction to building a Graphical User
Interface (GUI) using Swing. Although some may consider Swing a
relatively old library for the development of a GUI, the key ideas are
relevant across a range of other libraries such as JavaFX, and Swing
forms more of a core element of the Java landscape. The development of
GUIs is a large topic in its own right, so this chapter can only ever serve
as an introduction. In this chapter, we also consider the concept of a
design pattern, specifically the idea of Model View Controller (MVC)
architecture, and how a Java application can be constructed in a well-
recognisable design configuration.
In the final Chap. 9 , two complete applications are presented, from
conceptual design to implementation to help cement the ideas
presented in the previous chapters. One is a text-based application with
no Graphical User Interface (GUI). The other is a small GUI-based
application to give a sense of how to build a GUI on top of an underlying
application.
All the code examples used in this book and the two example
projects described in Chap. 9 are available as on-line resource
accompanying this book.
It is my hope that this book will inspire the reader to learn more
about the world of OO and coding. As such, it represents the start of a
learning journey. As with all endeavours, clarity will improve with time
and effort. Few will write an award-winning book at their first attempt.
Few artists will paint their defining masterpiece at the outset of their
career. Programming is no exception and your skills will improve with
effort, time, reflection and experience. But every learning journey has
to start somewhere. For many, the story starts with the codebreakers of
Bletchley Park in the United Kingdom during WWII, but we shall start
our story in early nineteenth-century France …
Kingsley Sage
Falmer, UK
January 2019
Contents
1 The Origins of Programming
1.​1 The Stored Digital Program is not a New Idea
1.​2 The Birth of the Computing Age
1.​3 The Origin of Programming Languages
1.​4 The Object Oriented Revolution
1.​5 The Java Language
1.​6 Tools of the Trade
2 Procedural Programming Basics in Java
2.​1 First Program and Workflow
2.​2 Primitive Data Types
2.​3 The Procedural Programming Paradigm
2.​4 Sequence
2.​5 Alternation
2.​6 Repetition
2.​7 More on Methods
2.​8 Bringing It All Together
3 Getting into Object Oriented Programming
3.​1 Object Oriented in a Social Context
3.​2 Introducing the OO Class
3.​3 The Anatomy of a Class
3.​4 Creating Objects at Run Time
3.​5 Accessor and Mutator Methods
3.​6 Choosing the Right Classes
4 Library Classes and Packages
4.​1 Organisation of Java into the Core and Packages
4.​2 Using Library Classes
4.3 The String Class
4.​4 Application Programming Interfaces (APIs)
4.​5 Using Javadocs in BlueJ
4.6 The ArrayList Class
4.​7 The Wrapper Classes
5 Modelling the World the Object Oriented Way
5.​1 Hierarchies in the Real World
5.​2 Introducing Super and Sub-classes
5.​3 Adding Constructors
5.​4 Rules of Inheritance and Over-Riding
5.​5 Method Polymorphism
5.​6 Static and Dynamic Type
5.​7 Abstract Classes
5.​8 Interfaces
5.​9 Class Variables and Static Methods
6 Dealing with Errors
6.​1 The Nature of Errors
6.​2 Coding Defensively
6.​3 Using the Debugger Tool
6.​4 Unit Testing
6.​5 System Testing
6.​6 The Basics of Exception Handling
6.​7 More Advanced Exception Handling
7 Deeper into Arrays and Collections
7.​1 Fixed Length Versus Dynamic Length Arrays
7.​2 Fixed Length Arrays of Primitive Types
7.​3 Fixed Length Arrays of Objects
7.​4 Multi-dimensional Arrays
7.​5 Sorting Data
7.​6 Hash Functions
7.7 The HashMap Class
7.8 The HashSet Class
7.​9 Iterating Through Collections
8 Adding a Graphical User Interface
8.​1 The Model View Controller MVC Design Pattern
8.​2 Introducing Swing and AWT
8.​3 The Taxonomy of a GUI
8.​4 A Simple First Swing Application
8.​5 Event Handling
8.​6 Centralised and Distributed Event Management
8.​7 Applying the MVC Design Pattern
8.​8 Adding Menus, Text Fields, Text Areas and Images
8.​9 Layout Managers
9 Example Applications
9.​1 Software Engineering Process Models
9.​2 The Good Life Foods Project
9.​3 The Guessing Game Project
9.​4 Final Thoughts
Index
About the Author
Dr. Kingsley Sage is a Senior Teaching Fellow in Computing Sciences
in the Department of Informatics at the University of Sussex, Brighton,
UK, and a Senior Fellow of the Higher Education Academy (SFHEA). He
has more than 20 years of teaching experience, from the level of
further/continuing education through to postgraduate-level teaching,
in both traditional university teaching and adult education.
© Springer Nature Switzerland AG 2019
Kingsley Sage, Concise Guide to Object-Oriented Programming, Undergraduate Topics
in Computer Science
https://doi.org/10.1007/978-3-030-13304-7_1

1. The Origins of Programming


Kingsley Sage1

(1) School of Engineering and Informatics, University of Sussex,


Falmer, East Sussex, UK

Kingsley Sage
Email: [email protected]

In this first chapter we explore what a programming language is, and


something of the history of their development leading up to the Java
language. This will help us understand some of the most basic
terminology used in the process of creating programs. The history of
programming, and computing in general, does not have a universally
agreed timeline and shared sense of significance of contributions.
Nonetheless, computer science has progressed and innovated to bring
us a world that we may scarcely consider without its plurality of
systems with software, data and programs at their core.

1.1 The Stored Digital Program is not a New Idea


Whereas the digital electronic computer is a 20th century concept, the
idea of digital control goes back much further. Digital control simply
refers to the idea of a system controlled by a sequence of instructions
that are either 1 or 0, “on” or “off”. One of earliest notable examples of
such a system that used stored digital instructions was the Jacquard
weaving loom . In the early 1800s, Joseph-Marie Jacquard (1752–1834)
developed an automated weaving loom using a series of punched paper
cards to control the head of the loom to raise and lower different
threads to permit a wide range of fabric designs to be mass produced.
Any design could be expressed by the set of punched cards that were
fed to the machine.

Sources https://​commons.​wikimedia.​org/​wiki/​File:​Book_​Illustration,_​
Jacquard_​Weaving_​and_​Designing,_​Falcon_​Loom_​of_​1728,_​Figure_​12,_​
1895_​(CH_​68766143).​jpg (public domain) https://​commons.​
wikimedia.​org/​wiki/​File:​Jacquard.​loom.​cards.​jpg (public domain)
Jacquard’s ideas were a step innovation of previous work by Jacques
de Vaucanson (1709–1782) and others, but Jacquard is usually credited
with creating a commercial scale automated weaving loom that made
use of stored digital data. This idea proved inspirational for others in
the development of computer science. For example, Charles Babbage
used punched cards as a means of input and output for his designs for
the analytical engine—an early calculating device. As all data, whether
numeric, text, image or audio, can be formulated into an equivalent
binary representation, such cards provided a convenient means of
storing data. For example, the number 19 in denary (base 10) can be
converted into binary (base 2).

16 8 4 2 1
1 0 0 1 1
Here 19 = 1 + 2 + 16. Individual letters can be assigned to numeric
values (i.e. the ASCII code set) and thus text can be converted into a
sequence of numbers, and thus binary data. Continuous data can be
“sampled” at regular intervals and those samples can be converted to
numbers and subsequently to binary data.

1.2 The Birth of the Computing Age


Pioneers such as Charles Babbage (1791–1871) strove to create
mechanical calculating devices such as the Difference Engine (1830s)
and the rather more general purpose Analytical Engine (unfinished in
Babbage’s lifetime). The latter is recognisable by design in many
respects as a computer, as it featured a set of instructions stored on
punched cards, a memory that could remember results, and elements of
sequential control. However, Babbage was ahead of his time in that the
engineering challenges posed in building his mechanical machines
were substantial. But many of his ideas laid dormant until new forms of
technology emerged from the new sciences of electricity and
electronics.
In 1936, the British mathematician Alan Turing (1912–1954)
published his seminal paper “On Computable Numbers”. In it, he
describes an abstract computing apparatus called a “Turing machine
”—a type of universal machine that Turing was able to demonstrate,
using mathematics, could compute all computable things.
Source https://​en.​wikipedia.​org/​wiki/​Alan_​Turing (public domain)
The machine consisted of a paper tape of infinite length that
enabled read and write operations to be performed. Depending on the
symbol observed on the tape, the tape can be made to move forwards
and backwards. Turing is actually describing the underlying
requirements of a modern computer and a programming language—a
feat given that in 1936 the technologies needed to realise such devices
barely existed.
Turing and others would later realise electronic implementations of
Turing machines using electronic valve and later transistor technology,
allowing the realisation of general purpose “electronic digital
computers”. Turing is also widely credited for popularising the term
“Artificial Intelligence ” as he believed that one day such digital
computers would rival humans for computing and analytical ability.
The onset of World War 2 brought opportunities for Turing and
others in the form of the Allied effort to decipher Nazi Germany’s
secretive Enigma codes, particularly in respect of minimising shipping
losses to U-boats on the North Atlantic supply route (the “Battle of the
Atlantic”). U-boat command used Enigma machines, a type of modified
electronic typewriter, to convert plain text messages to cipher text that
was then broadcast by radio to the U-boats. Recovering the original
plain text required another Enigma machine with identical settings to
the original. The design was such that there were billions of
combinations of settings and it was statistically unlikely they could be
discovered by chance. A group of scientists, including Turing, worked at
the Bletchley Park site in England to build a range of machines, such as
Turing’s Bombe and later the Colossus device, that could sift through
millions of settings in just a few hours to find the correct one.

Source https://​en.​wikipedia.​org/​wiki/​File:​Wartime_​picture_​of_​a_​
Bletchley_​Park_​Bombe.​jpg (public domain) https://​en.​wikipedia.​org/​
wiki/​Colossus_​computer (public domain)
This was the start of the era of cryptoanalysis. Colossus is regarded
by many as the world’s first semi programmable electronic computer,
and a faithful recreation of the machine can be viewed today at the UK’s
National Machine of Computing at Bletchley Park.
The post-war years were less kind on Turing, with events leading to
his suicide in 1954. But the development of electronic computers
continued apace in the UK and the US, with the development of
machines such as the Manchester Mk 1 (UK, 1949) and ENIAC (US,
1945). 1952 heralded the arrival of the Ferranti Mk 1 , the world’s first
commercially available general-purpose computer.

1.3 The Origin of Programming Languages


By the 1950s, computer hardware was a reality. But as with all
technologies, the question arose of what it should be used for. ENIAC
was initially developed to produce artillery firing tables for the US army
—a repetitive and time-consuming task suited to a machine. The
Manchester Mark 1 was used for tasks including searching for prime
numbers and investigating the Riemann hypothesis.
The issue was the relatively low amounts of computing power
combined with the fact that there was only a small group of experts
who truly understood how to program the machines. Initially machines
were programmed using binary and very near binary “assembly
languages” supported by mnemonic aids. Creating programs at such a
low level required a great deal of time and intellect.
The idea of a higher-level view of a computing problem is widely
credited to Ada Lovelace (1815–1852), who collaborated with Charles
Babbage and wrote notes on the design of algorithms for Babbage’s
machines. Whilst not programs, these algorithms represented a higher-
level way of thinking about what a computing device could do.
The key development was to provide a means for programs to be
written in a higher level, more human centric manner, that could then
be translated into the lower level binary instructions that a computer
could process. The earliest programming languages included “Short
Code ” (John Mauchly 1950) and “Autocode ” (Alick Glennie and Ralph
Brooker 1954). These languages allowed a source code file to be
created with the high-level instructions, that were then “compiled ” or
“interpreted ” into the lower level instructions that the computer could
execute:

Compiled languages made the translation one-time and then stored


the resulting machine code for execution many times over. Interpreted
languages made the translation “on the fly” for immediate use. This
distinction is still very much in evidence today, with languages such as
C and Java belonging to the compiled group, and scripting languages
such as JavaScript and PHP belonging to the interpreted group. The
interpreted group has become particularly significant in the world of
web computing.
1954 saw the development of FORTRAN by a team lead by John
Backus at IBM. This was a very significant innovation as FORTRAN was
the first widely adopted general purpose programming language and it
still exists today, although it has long since fallen from wide use. Other
notable languages include COBOL (for business related programming
tasks) (Grace Hopper, 1959) and LISP (for symbolic computing)
(Russell, Hart and Levin, 1958). Nearly all these early languages are
now a matter of historical note, but 1972 brought a significant
milestone with the arrival of C (Bell Labs, Dennis Ritchie). C was
significant as it brought a consistent syntax, provided a range of high
and low level instructions and operations, was designed to encourage
cross platform support, was (and still is) the subject of international
standardisation. C was used to write the UNIX 4 operating system (still
very much in use today). C is also significant in that many
contemporary programming languages (including Java) owe their
syntactic history to it. C has also seen a reboot in the form of the object
oriented C++. Now a wide range of people could write programs using
high-level abstraction rather than needing to understand the detailed
internal operation of the host computer.

1.4 The Object Oriented Revolution


As computers became cheaper, more widespread and powerful, the
range of applications that they were put to increased. In the 1950s,
computers were mainly used for mathematical and scientific tasks, by
the 1970s they were in wide use in business data management, and
with the explosion of personal computing in the 1980s, they reached
out into every aspect of modern lives. That expansion of ambition for
creating ever new and more innovative program applications came
with its own challenges—the size and complexity of codebases was
increasing:

Typical codebase size


1950s 10s of lines
1960s 100s of lines
1970s 1000s of lines
1980s 100,000s of code
Now In some cases > 10,000,000 lines (e.g. Linux)
The challenge here is not technological, it’s human. By the 1970s, a
significant number of software development projects were failing (i.e.
required substantial or complete write-down of their costs due to
failure to deliver a working product) as they were becoming too
complex for teams to develop and manage using the programming
languages and techniques available. This period saw the birth of
software engineering as an academic discipline to try to counter this.
The problem lay in the fact that they kind of data employed by
programming languages was based in mathematical and fundamental
terms like characters, integers and pointers. These are not the atomic
elements that were needed to build something like a graphic computer
game, or a word processor. Humans don’t think of most problem
domains in atomic terms. We think of them in terms of entities like
“Player”, “Paragraph” and a “Spell checker” and so on.
So there was a basic mismatch between the programming concepts
on offer and the problem domains that developers wanted to address.
Furthermore, a program written for one computer would not
necessarily execute on another. By the 1980s there was a proliferation
of competing brands of computer, with little or no interoperability
between them.
In 1967, the Simula language (Dahl, Nygaard) was the first Object
Oriented (OO) language. In 1980, Smalltalk-80 (Kay, Ingalls and
Goldberg) was released, drawing heavily on Simula for inspiration.
These languages were developed part in response to the challenges
faced by ever expanding code base sizes and part by the need to
express solutions in a human centric manner. Smalltalk is significant in
the programming language development timeline as it directly
influenced the design of a generation of OO languages such C++ ,
Flavors and Java . Smalltalk had at its centre the concept of a “class ” as
an organisational unit of a program, capable of describing a meaningful
entity that formed part of the problem domain. Instances of these
classes (“objects ”) could then message each other to work together to
solve some collective problem, much as a team of people would
communicate and cooperate to solve a problem. The world has never
looked back, and the OO paradigm is now an established cornerstone of
our modern programming landscape.
1.5 The Java Language
The Java language had its 1990s origins in a language called Oak
intended for use in interactive television set top boxes. Initially
developed by James Gosling, Michael Sheridan and Patrick Naughton,
the aim was to produce an OO language to build applications that could
run on any interactive television, regardless of the underlying hardware
that any individual unit had. Although Oak was not successful, it
developed further into the Java 1.0 released by Sun Microsystems
promising “Write Once, Run Anywhere” (WORA ) code. This was a
major innovation that arrived at a time where there was a demand for
lower cost development capable of producing applications that could
run in a range of machines, and on the fast-paced range of new web
browsers that were emerging.
At the heart of this innovation was the idea of the Java Virtual
Machine (JVM) . The JVM was an abstract implementation of a general-
purpose microprocessor, with a corresponding low-level byte code
language specification. Although this abstract microprocessor did not
actually exist, it was similar in design to the vast range of commercial
microprocessors available, so the “last leg” translation of the JVM byte
code to actual machine code for a specific microprocessor was a simple,
speedy and low-cost task. Any Java compiler just needed to translate
the Java source code to JVM bytecode, and the code could then execute
on any device equipped with a JVM.
Software developers soon provided JVMs for all popular platforms.
This idea of a virtual machine or “sand box” has been widely adopted in
other software engineering applications and frameworks as it offers
flexibility with very little loss of efficiency. It’s how Macs can pretend to
be PCs, and how systems can be built with components written in
different languages.
Java received a particular boost resulting from the emergence of
mobile computing platforms. Manufacturers of smartphone and tablet
devices faced the same challenges as the earlier developers of
interactive television set top boxes—the need to run the same code on
different underlying devices. So, Java was a natural choice as the
implementation language for the Android operating system (Google,
2007) and its applications.
Java has continued to evolve and was acquired by the Oracle
Corporation following their acquisition of Sun Microsystems in 2010
and continues to be free to use. It is available as a run time only package
(JRE ) and as a development toolkit (JDK ). As at 2018, Java is in version
SE 11 and there is an Enterprise Edition EE 8 (known as Jakarta EE ). A
separate version of the JVM (Android Runtime and, before that, Dalvik )
and a branch of the language exist for mobile development.
So, Java is a modern OO compiled language that relies on the virtual
JVM for execution of its byte code. It owes its syntactic ancestry to C and
draws on Smalltalk-80 for inspiration. It is, and has always been, free to
use and embodies the “WORA” principle.

1.6 Tools of the Trade


To create Java programs, you will need to download some tools. They
can all be downloaded from reputable sources for free:
The Java Development Kit ( JDK ): choose the latest version
appropriate for your development machine. All major platforms are
supported. For this book, we assume you are using a desktop
development environment rather than a mobile platform. The JDK
contains the Java compiler and several other tools to help you
develop, debug and document your work. Ensure that your download
the Java Development Kit (JDK) rather than the Run Time
Environment (JRE)—your computer likely has the latter installed
already.
An Integrated Development Environment (IDE) : this is a toolset
to help you edit and manage the code that you produce. There are
many popular IDEs available. The professional market leaders are
Eclipse and Netbeans which are rich in features, but overly complex
for learning and teaching. This book, and many others, uses the BlueJ
IDE that can be freely downloaded for all major platforms. BlueJ was
developed specifically for teaching and learning and offers just the
right set of features to enable you to develop code easily.

All the code examples used in this book are available freely in the on-
line package that accompanies this book.
With that knowledge, it’s time to start writing some programs.
© Springer Nature Switzerland AG 2019
Kingsley Sage, Concise Guide to Object-Oriented Programming, Undergraduate Topics
in Computer Science
https://doi.org/10.1007/978-3-030-13304-7_2

2. Procedural Programming Basics in


Java
Kingsley Sage1

(1) School of Engineering and Informatics, University of Sussex,


Falmer, East Sussex, UK

Kingsley Sage
Email: [email protected]

In Chap. 1 we learned some of the key concepts and terminology


around programming. In this chapter it’s time to jump in and start to
create our first programs in Java using the BlueJ Integrated
Development Environment (IDE). The first programs that we shall
consider will be necessarily simple., and are intended to introduce the
reader to the basic workflow necessary to write, compile, execute and
debug a Java program, and to the elements of procedural programming
that constitute core programming knowledge applicable not just to
Java, but a wide range of other procedural and Object Oriented (OO)
languages. At this stage, we will not focus on the OO elements of Java—
that subject is explored in depth Chap. 3. Instead we shall master some
basic procedural programming elements that make up an essential
component of the broader landscape of coding.

2.1 First Program and Workflow


The traditional first program in many textbooks is “Hello World ”, so we
shall start there. To create a Java program using BlueJ, first start the
BlueJ program and under the Project menu tab select “New Project”.
Give the project a name. The project name will be used to create a
directory on your PC/Mac. A BlueJ project is effectively a set of files
contained within a directory. That set of files will ultimately consist of
source code ( .java files) , compiled Java byte code ( . class
files) and other files that, taken together, constitute your Java
application. Once you have done that you should have a screen that
looks like this:
The precise appearance and layout may vary slightly depending on
which version of BlueJ you have installed on your machine. There are
some key controls to appreciate:
Menu bar: where you will find key operations such as saving and
opening projects.
Central panel: the large panel on the top right where organisational
chunks of code will ultimately be represented.
Workbench: the panel at the bottom of the screen where you will be
able to monitor your completed program as it executes.
The left-hand side key controls panel: where you will find buttons
to create a “New class” and “compile” your programs.

To create a Java program, the workflow is as follows:


Create a project: A project is a collection of files that make up a
program or application.
Create one or more “classes”: A class is an organisational unit of a
Java program. We shall consider this is much more depth in Chap. 3.
For now, we just need to understand that a Java program is built from
one or more organisational units of functionality. At this stage we
shall build a program from just one class, and that class will contain
all the code that we need.
Compile the class into Java byte code: this may require several
attempts at editing the code using the BlueJ source code editor.
Create an instance of the class: again, this terminology will become
clearer in Chap. 3. For now, we can think of this as “creating a
functioning incarnation of our program on the Java Virtual Machine”.
Call a method: summoning some aspect of the instance of the class
to make the program “do something useful”.
If there are problems, we may also need to go back and fix
errors: this is the process (some would say art) of “debugging”.

So, we start by creating a class. To do this, press the “New Class” button
on the left-hand panel. Your will be asked for a Class Name. Provide an
alphanumeric name. By convention, Java classes start with a capital
(upper case) letter. They should not start with a number, and there
should not be any spaces in the name. Many experienced programmers
use the “camel caps” style of naming where capital letters are used at
the start of key words e.g. “ MyFirstClass ”, or “ My1stClass ”.
The Class Type should be left as “Class” and this is the BlueJ default.
The BlueJ source code editor will open. Once you have done this an
orange box will appear in the central panel with a hatched marking
through it.

A class (an organisational unit of a Java program) is represented in


BlueJ by an orange box in the central panel. Double click on a class to
invoke the BlueJ source code editor.

If a class is shown with a hatched marking through it, then it has not
yet been compiled into Java byte code. Pressing the Compile button
will start that process.

If a class is shown in solid orange, then it has been compiled


successfully and is ready for use.

Note that BlueJ does produce some sample code when a class is
created. This sample code is not particularly useful, so we will delete
most of it. Just leave the skeleton of the class definition as shown below:

Note carefully the type of curly brackets (often called “braces ”) that
are used in the definition of the class. We will be making a great deal of
use of two types of brackets:
Braces: { and } used in the definition of chunks of code.
Round brackets: ( and ) used in the definition of statements and
method calls.
Now we will add some useful source code to make our first working
program:

This example is a complete definition of the MyFirstClass class.


The class definition is contained within a pair of braces. Everything
inside that pair of braces is a part of the class definition. To help us
remember what we are doing, we add comments to our source code.
Comments do not form part of the compiled byte code—they are there
for our benefit, and for the benefit of others reading our code.
Comments come in two types.

Multi line comments: starting with the symbol pair /* and


ending with the symbol pair */ . Any text can appear between those
pairs and can run over many lines. Here we have used a multi-line
comment to provide information about who has written the
program.
Single line comments: start with the symbol pair // . Any text
after this symbol pair up to the end of the line are treated as text
comments.

Inside the class definition we have a public method called


myFirstMethod() . A method is one of the component parts of a
class definition and represents something that the class can do (a
behaviour ). If you have previous experience of procedural
programming (e.g. using C) you will recognise this as the concept of a
function (however there is a difference between a function and a
method that we explore in Chap. 3). Note that by convention method
names start with a lower-case letter so that we can easily distinguish
them from classes. Note also that the method has a pair of round
brackets after it.
In the case of both the class and the class’ method definitions, the
keyword public simply means that the functionality is openly
accessible. We will return to the importance of the keyword void later
when we delve further into the concept of a method.
System.out.println () is a pre-defined library method that
displays text on the console. As we have not created any kind of
Graphical User Interface (GUI), our output will be simple text on the
console window. BlueJ will cause the console window to open as
required when we execute the code. You will notice that System starts
with a capital letter. This is because it refers to a class.

The System class is a programmatic representation of the Java


Virtual Machine. As Java was created as a platform independent
language, it does not readily provide any means of addressing the
underlying hardware that your program is running is running on.

If you need to communicate with the host PC, for example to display
something on the screen, or open a file, you do so by interacting with
the System class. There is only ever one System object, and you
do not need to do anything to bring it into existence. You can think of
the System object as a proxy for the JVM.

The final thing to note is the semi-colon at the end of a line of code.
This marks the end of a complete statement of Java code, a bit like the
full stop that we put at the end of a sentence when writing in English.
If you have written everything correctly, you can now press the
Compile button and the source code will be translated into Java byte
code. If you have made an error, the compiler will produce an error
message (a syntax error) and you will need to fix the problem and try to
compile again. When the source code is free from syntax errors and
compiled, you will see the message “Class compiled—no syntax errors”.
Now it’s time to run our first program. To run the program, you will
need to create an instance of MyFirstClass . To do this, right click
the solid orange box on the central panel and select new
MyFirstClass . You can then give the instance of the class a name.
Just use the default name for now. Once you have done that you a red
box will appear on the BlueJ workbench.
The red box is a Java object built from the MyFirstClass class
definition.

A Java class is a definition of an organisational unit of a Java


program. They appear as orange boxes on the BlueJ central panel.

A Java object is an instance of a Java class. An object is “instantiated”


from a Java class. We can instantiate many Java objects from the
same Java class definition.

Now that we have created a Java object, we have a functioning


program working in the memory of our machine. Now all we need to do
is to tell the object what we want to do. The object only has one thing
that it can do. We need to invoke the myFirstMethod() chunk of
code. To do this, we right click on the object on the workbench and
select the void myFirstMethod() . This will cause the console
window to open and your message will appear. Well done, you have
created and executed your first Java program!

2.2 Primitive Data Types


Now that we have looked at the basic workflow for creating and
executing a Java program, we can now delve deeper into the basics of
the procedural aspects of programming. Our first program just
displayed some text on the console window. More useful programs will
do rather more, and in particular, will allow us to store and manipulate
data. By data, we mean any type of information including, although not
limited to, numeric data, logical data, text and objects. We can view the
purpose of a program as a means of doing some useful work on data.
Data is stored in the form or variables. We start by considering the
most basic kind of data, called “primitive data ”. The term “primitive”
here is used to distinguish between data that is atomic (in the sense
that it cannot be broken down into any smaller useful units) and that
does not have the status of an object, and objects. We consider much
more about objects in Chap. 3. Java has 8 primitive types in total, 6 for
numeric data, 1 for single character data and 1 for logical or boolean
expressions. Each is characterised by a range of values that a variable of
that type can hold and the number of bytes in memory that it occupies.
The 8 primitive types are:

Type Description Size Example value


boolean True or false 1 bit true, false

byte Integer 1 byte (8 bits)


char Unicode character 2 bytes 'a', '\u0030'

short Integer 2 bytes − 3, − 2, − 5


int Integer 4 bytes − 3, − 2, − 5
long Integer 8 bytes − 3L, 0L, 4L
float Floating point 4 bytes 1.2f, − 1.2e03f

double Floating point 8 bytes 1.2, − 1.2e03


The choice of integer and floating-point types simply reflects the
range of values that each type can accommodate. In Java, all numeric
types are signed, meaning that they can take on positive and negative
values (there is no distinction between signed and unsigned types as
there is in languages such as C).
Primitive data is stored in the form of variables. To use a variable we
must declare it first. This ensures that the compiler knows how much
memory to set aside to store each variable. Java is a strongly typed
language , meaning that we must always state what kind of data
something is before we can use it. This declaration happens only once.
We can store values in the variables and manipulate those values as our
needs dictate. Note that the primitive data type keywords start with
lower case letters to remind us that they do not have the status of a
class. Primitive variables also have default values (0 for the numeric
ones and false for boolean ones).
Here are some example of primitive variables being declared and
then given some values:
You can also combine a declaration with setting an initial value:

You can manipulate variable values using an expression. Here are


some examples of valid expressions using a range of mathematical
operators .
For an expression, the right-hand side of the equals sign is evaluated
and used to set the variable on the left-hand side. Many programmers
do not care for the x = x + 2 way of writing “add two to 2”
as it resembles an impossible equation. But in practice it does not
matter—just use a style that works for you. Note that all expressions
end with the semi-colon. You can also see the quite popular “side style”
of commenting.
Variables must be declared before they are used. Failure to do so
will result in the compiler reporting an error. However, it is important
to understand that where we place the declarations of variables
determines their “ownership” under the “rules of scope ”. Variables can
be declared within the scope of a class, or within an individual method,
or indeed part of a method. The first two cases are relevant at this
stage.

A variable that is declared within the class definition, but outside the
scope of any method within that class is referred to
(interchangeably) as an instance variable , a class attribute , and a
field of a class . However, the term “class variable” is not
appropriate. We shall see in a later chapter that class variable refers
to something different. Such a variable is accessible at any point in
the source code within that class. We say that it has scope of the
class.

A variable that is declared within an individual method within a


class definition is referred to a method variable . It is accessible
only within the code for that method. When the method is not
actively executing, the variable cannot be accessed and does not
exist. We say that it has the scope of the method.

Unlike other programming languages, there is no concept in Java of


a global variable. All variables must belong to some organisational unit
of your program. We can use built in methods such as
System.out.println() to display the current value of any
variable in the console window. Here is an example method that does
exactly that:
Note the use of the + symbol in the call to
System.out.println() . Here the + symbol is called the
“concatenation operator ”. Concatenation simply means to place one
thing after another

2.3 The Procedural Programming Paradigm


Now that we know about the primitive data types, we turn our
attention to the fundamental concepts of procedural programming .
Java is an Object Oriented language, but it also has the procedural
programming concepts as its core, as do many other programming
languages. The term “procedural programming” is not entirely well-
defined, and is contentious for some academics. In the broadest terms,
it refers to a style of programming where a problem is broken down in
a set of smaller procedures, also called functions and, in Java’s case,
methods. But the term is also used to include a set of programming
code constructions (structured programming ) that deliver the minimal
requirements of a general-purpose programming language. These
constructions themselves arise from the pioneering work of Alan
Turing and his abstract Turing machine mentioned in Chap. 1.
Rather than dwell on the detailed mathematical treatments that
many purists attach to programming paradigms, we will instead
describe what is required of a general-purpose programming language
in rather more everyday terms. Suffice to say that it can be
demonstrated that a programming language is general purpose (i.e. can
perform any computable calculation) provided it exhibits 3
characteristics:
Sequence : processes one instruction after another, until all
instructions have been executed.
Alternation (also called selection ): selects one execution path
from a set of alternatives.
Repetition (also called iteration ): repeatedly executes some code
whilst some condition persists.
All general-purpose languages exhibit these three characteristics.
They may do so in different ways, and they may have other features
besides. But these other features are present only to make the language
easier to use, and they are not actually a pre-requisite for the language
being general purpose. As Java is a general-purpose programming
language, it provides (a variety of) means of delivering these core
characteristics.

2.4 Sequence
The notion of sequence from structured programming is simply the
idea that instructions are executed in a given reliable order i.e. from
start to finish. It is up to the programmer to determine what the correct
sequence is to achieve the intended result. This idea contrasts with the
concept of declarative programming, where the user simply states what
their requirements are, and the order of these declarative statements is
unimportant.
The only additional aspect of sequence comes from the procedural
programming paradigm, that adds the notion of a “call stack ”. This
reflects the idea that a larger program can be broken down int smaller
pieces—methods in the case of Java. One method can then call upon
another. This is also the concept behind the program design philosophy
of “task decomposition ” where a large task is broken down into a set of
smaller tasks, until each task is sufficiently simple to be understood and
implemented.
When a method calls upon another method, execution of the calling
method is parked whilst the called method is executed. Once the called
method has completed execution, control passes back to the calling
Exploring the Variety of Random
Documents with Different Content
of a general system of education. I would therefore
recommend that further grants of land be made for that
object, and wherever the lands reserved for the use of schools
are found to be valueless, that the proper officer of the state
be authorized to select others in lieu of them. * * *
"With great respect, your obedient servant,
"JAMES H. PIPER,
"Acting Commissioner.
"HON. ROBERT J. WALKER,
"Secretary of the Treasury."
House Ex. Doc. 9, Vol. II, Twenty-ninth Congress, Second
Session.
12 Ex. Doc., First Session, Thirtieth Congress, Vol. 1, 1847–
48.
13 This statement that congress "granted Oregon two school
sections" calls for explanation. It was only in the Northwest
Territory, subject to the ordinance of 1787 by compact, that
these sixteen sections belonged, as Woodbridge of Michigan
contended, to the states formed out of that territory. Where
other states received them it was by grant of congress.
14 The Secretary urged other reasons for the additional
grants. "Even as a question of revenue," he says, "such grants
would more than refund their value to the government, as
each quarter township is composed of nine sections, of which
the central section would be granted for schools, and each of
the remaining eight sections would be adjacent to that
granted. Those eight sections thus located and each adjoining
a school section, would be of greater value than when
separated by many miles from such opportunities, and the
thirty-two sections of one entire township, with these benefits,
would bring a larger price to the government than thirty-five
sections out of thirty-six, where one section only, so remote
from the rest, was granted for such a purpose. The public
domain would thus be settled at an earlier period, and yielding
larger products, thus soon augment our exports and our
imports, with a corresponding increase of revenue from duties.
The greater diffusion of education would increase the power of
mind and knowledge, applied to our industrial pursuits, and
augment in this way also the products and wealth of the
nation. Each state is deeply interested in the welfare of every
other, for the representatives of the whole regulate by their
votes the measures of the union, which must be more happy
and progressive in proportion as its councils are guided by
more enlightened views, resulting from more universal
diffusion of light and knowledge and education."—Ex. Doc.,
Second Session, Thirtieth Congress, Vol. II, 1848–49.
15 Gwin's Autobiography, Mr. Bancroft's Hist. Cal. VI, 298.
16 I must be pardoned if I once more call attention to the
willful perversion of truth by the talented but unscrupulous J.
Quinn Thornton. In the transactions of the Pioneer Association
for 1874, speaking of the Oregon bill and the school-land
grants: "Up to the time of the passage of this bill, congress
had never appropriated more than the sixteenth section for the
support of common schools; and the late Nathan Dane, LL. D.,
had labored long before he succeeded in inducing the
government to appropriate that portion of the public lands."
The italics are mine: the word "late," to call attention to the
fact that Doctor Dane had been dead for thirty-nine years,
having passed to his reward in 1835, after a useful and
honorable life; the word "that," because in another place
Thornton claims himself to have induced the government to
make this appropriation. It is difficult to deal with such
constant shuffling with the intention to deceive. A different
unintentional error occurred in the course of my investigations,
when, in 1882, I wrote to the Department of the Interior for
information as to the first act of congress reserving the thirty-
sixth section in each township for school purposes, and was
informed by the commissioner that "the act was approved
March 3, 1849 (U. S. Statutes, Vol I, page 154), entitled an act
to establish the Territorial Government of Minnesota." He had
overlooked the fact that the organic act of Oregon, which
passed on the fourteenth of August, 1848, contained the same
appropriation. This was probably because it was in 1849 that
the affairs of the land office were turned over to the interior
department, and he had not searched the previous records.
17 Act of Congress of September 4, 1841.
18 The canal and locks at Oregon City were built out of the
first proceeds of the five hundred thousand acres, when it was
converted to the school fund to prevent its appropriation to
local schemes of minor importance.
19 By act of July, 1864, congress granted to the State of
Oregon, to aid in the construction of a military wagon road
from Eugene to the eastern boundary of the state, alternate
sections of the public lands designated by odd numbers, for
three sections in width on each side of the road, the United
States to share in it as a military post road. The land was to be
sold in quantities at one time of thirty sections on the
completion of ten miles, and within five years, failing which,
the land reverted to the United States. The grant amounted to
one thousand nine hundred and twenty acres per mile for a
distance of four hundred and twenty miles—or more than all
given to the state on its admission by one hundred and fifty
thousand acres. The company was allowed a primary sale of
thirty sections with which to begin surveying. A road was
opened from Eugene to and over the mountains in 1867, which
was little used or useful. In 1873 the land grant was sold to a
San Francisco company, and this immense government gift
passed to private ownership in another state.
GLIMPSES OF LIFE IN EARLY
OREGON.
As we travel through the Willamette Valley with the dispatch and
comfort of a well-equipped railway service, we are quickly forgetting
how our fathers and grandfathers journeyed. Pioneer experiences
and hardships are memories of long ago; another century is
dawning, and we say that "the new is better than the old."
In the early days of the settlement of this state the horse was
the only means of travel, unless one's course lay along the
Willamette, and then it was the canoe with paddles that carried
trappers, explorers, and occasional Hudson's Bay officials on their
journeys. The native grasses were luxuriant and abundant, the
climate mild, and every settler's door stood hospitably ajar.
Journeying was by easy stages and not irksome. It is pleasant to
remember that there was a time when one had time to be leisurely
and greet one's friends in a kindly, simple fashion. Civilization was
gathered within the four walls of Fort Vancouver, on the Columbia
River. Our greatest friend, John McLoughlin, was the chief factor of
all the Hudson's Bay Company's establishments west of the Rocky
Mountains, and children who have been born in the original Oregon
Territory may well "rise up and call him blessed."
The good "old doctor," as he was respectfully and affectionately
called, cheered the hearts of thousands of immigrants by his deeds
of gracious humanity. With a generous hand he furnished provisions,
clothing, cattle, grain, and farming implements, taking in return the
immigrant's word that he would ever be repaid; the word was
sometimes kept and oftentimes broken. Doctor McLoughlin
conducted life at Fort Vancouver as feudal lords of old, and that, too,
with strict military discipline; the coming and going regulated by the
ringing of the great bell. The members of this large household
breakfasted and supped by their own firesides, but dinner was
served in the hall for gentlemen and visitors. All stood while the
doctor said grace, and men of humble birth "sat below the salt."
Distinguished men gathered at this board. Foremost among them we
reckon Douglas, the botanist, to whom the doctor furnished escort
and transportation. As he took his way through the Willamette
Valley, and on to the Rogue River, it became a journey of months.
His investigations covered a wide stretch—the lowly flower by the
trail, the myriads of brilliant blooms on the breeze-swept prairies,
the shrubs and vines of hillside and canyon, and towering
evergreens on lofty mountain heights. In order to study plant life he
watched it from the bursting bud in April showers, through sunny
summer weather, to the autumn maturing of the seed. Be it
remembered that Douglas first made the world acquainted with the
three kingliest products of our forests—the giant spruce of the
Oregon wilderness, the solemn fir of the cloud-drift region, and the
sugar pine of the Sierras. This clever man met with a tragic death in
the Sandwich Islands, for he fell into a pit dug for wild cattle and
was gored to death by a bull.
Geologists searching the distant field, and titled gentlemen
traveling for pleasure, shared the doctor's hospitality, and were given
escort through the beautiful pastoral country. With the ingress of the
Americans Oregon City became the place of importance next to Fort
Vancouver, and when Doctor McLoughlin was called there on
business, he set out in a bateau, manned by French-Canadian
voyageurs, who, clad in their gay national dress, sang gay Canadian
boating songs to the rhythm of the paddles. The doctor sat aloft in
the stern, erect and dignified, dressed in a long blue-cloth coat, with
brass buttons, buff waistcoat and dark trousers, and a gray beaver
hat. The garments were fashioned in London, and the making of
beaver hats has been a lost art these many years. When the doctor
reached Oregon City he clambered up the rocky path and paced the
single street, carrying a gold-headed cane, and with his brilliant blue
eyes and flowing white locks, his was a face and figure never to be
forgotten. This great-hearted man and friend of the pioneers lies by
the side of his wife in consecrated ground, within sound of the Falls
of the Willamette.
We can understand what a sore deprivation the absence of
books and papers was to the pioneers of the "forties." One man in
the Yoncalla Valley, who had accumulated several hundred dollars,
called his children about him and asked if he should build a house to
replace the log cabin, or buy "Harper's Complete Library," consisting
of many volumes bound in "12mo." Be it to their lasting credit, the
books were purchased, carefully read and remembered, and
preserved for succeeding generations.
Another man, troubled lest his children be cut off from civilizing
influences in their frontier life, built and furnished a house at great
expense and in a style that was not equaled for many years nor
within many miles. He lived to see his lands and house swept from
him, through the dishonesty of another, but not before the attractive
home surroundings had served their purpose. This brave man spent
the declining years of trouble and sorrow on the mountain-side
overlooking the fair valley, where once lay his own broad acres, and
no man had ever been turned from his door. The letters written
through all the years of this man's life in Oregon are marvels of style
and composition, and greatly treasured by their fortunate owners.
Especially so are those of his later years, when riper experience and
a keener insight into men and events lent greater force to his pen,
so that a man of great culture and polish once said: "They sound as
if written from a baronial castle, whereas they come from a log
cabin."
On the western slope of the Willamette there was another where
all books and papers were most carefully preserved, so that the third
generation of descendants is now able to read a file of the Oregon
Spectator, published in 1846 and 1847. The paper was placed over a
string stretched across the cabin, until they were all carefully laid by.
An English gentleman, accompanied by a guide and traveling in
pursuit of game and pleasure, once craved food and shelter at the
cabin door. He was cheerfully bidden to enter and partake of the
unvarying fare of boiled wheat and possibly beef, and the earthen
floor and a buffalo robe served as a bed. The gentleman met his
host and hostess in Washington afterward, and when the latter
spoke of the meager entertainment in Oregon, he said: "Ha, but you
gave me the best you had; the Prince of Wales could do no better."
A roomy, comfortable house replaced the log cabin, and its door, too,
stood ajar, and all were welcomed to the kind and simple hospitality.
Young officers from West Point, on first frontier duty, passing to
remote mountain garrisons and out again for brief glimpses of
civilization, had cordial greeting. Some of these died like brave
soldiers on the battle-fields of the civil war. Others attained rank and
distinction in the service, and two at least won the highest honors
ever conferred by an appreciative country.
Every governor and senator of Oregon has claimed the welcome
extended, unless it be the present incumbents, and though the
master and his gentle wife have passed out for the last time, those,
too, would be kindly greeted beneath the old roof. Preacher and
circuit-rider, humbly following in the footsteps of their divine Lord,
students and distinguished statesmen gathered about this fireside.
Best of all were the times when the earliest pioneers honored it with
their presence, and the quaint telling of tales of adventure, privation
and Indian warfare lasted far into the night, and the logs burned low
on the hearth.
The lack of schools was deeply deplored by many of these hardy
pioneers, men and women, though some were more fortunate. Many
remember with affection and respect one who came from her New
England home and most conscientiously taught the fortunate
children entrusted to her care. School days under her wise and kind
guidance, and ofttimes in most picturesque spots, are bright and
happy memories of many men and women today. One family spent
years of happiness and contentment on a lonely sea shore, and were
taught by a governess, while the play-time was spent among the
beautiful groves and watching the waves so full of interest and
mystery. A peaceful happy life, but in their longing for
companionship they fed sugar to two house flies on the window-sill
in stormy weather,—for house flies were not then a pest.
Sometimes the housewife was of another nationality, and
claimed a prior right to this beautiful valley. A judge once traveling
across Tualatin Plains in the winter was belated by a storm and
asked shelter at a trapper's door. He was given a place by the
blazing hearth, and the dusky housewife, busy about the evening
meal, placed before them potatoes, deliciously roasted in the ashes,
venison, bread, butter, milk and tea, while the host interestingly told
of having known Captain Bonneville and his party on the plains, as
well as members of the Rocky Mountain Fur Company. In his
journeys he knew the watershed of the Columbia and Missouri by
heart, and in one night had set traps in both rivers.
One of Oregon's most polished and charming of her earlier
pioneers, was entertained at a frugal board, and in graceful
acknowledgment sent the hostess some soup plates from the
Hudson's Bay store, and a daughter of the house exhibited them to
him forty years afterward. Although he returned to New England to
spend many of the last years of his life, his interest in Oregon never
waned, and during his visits here his reminiscences of early days
were a delight to those who were so fortunate as to hear them.
The first school opened in the original Oregon country for
American children was by Doctor Whitman at the Waiilatpu Mission,
on the Walla Walla River. The school was attended by the children of
missionaries, those who were left orphans, and the children of
immigrants who were belated by winter storms and kept from
entering the Willamette Valley.
Eliza Spalding was born at Lapwai Mission in 1837, and at ten
years of age was sent to Whitman's station in charge of a trusty Nez
Perce woman. These two journeyed alone on horseback three days,
and camped as many nights by the trail. The air was cold on the
table land adjacent to the Snake River, but the child was tenderly
cared for by this faithful woman. Eliza was interpreter, owing to her
thorough knowledge of Nez Perce, but her school-time at the
mission was brief. Fifty years afterward she told of the awful tragedy
that ended the life-work of a great and good man and his wife, and
those others who shared their fate. Half a century had not
obliterated the traces and impression of the horrible crime from the
sensitive mind of her who was a child at the time of the massacre.
A little school established in Polk County, early in the forties laid
claim to the ambitious title of institute. Whether in the spirit of true
democracy, or as a deserving tribute to the great mind that
conceived the possibilities of this western land, and with marvelous
foresight planned the Lewis and Clark expedition, this little log
school house bore the name of the Jefferson Institute. The man who
presided there remembered the lore of earlier years, and equally
well had he treasured the books of that more fortunate time.
Men and women are living who owe a debt of gratitude to John
E. Lyle, and remember with deep affection and respect that he first
pointed out the narrow path that led far afield in the great world of
study and literature of today.
The theme is endless, when we begin to recall the men and
events of other days; much has been written and preserved, and
much lost to the world because the demands of later times were
great, and those who might have recorded faithfully and well went
out into the great beyond without having benefited Oregon's story
by handing down such a record.
MRS. WILLIAM MARKLAND MOLSON.
NOT MARJORAM.
The Spanish Word "Oregano" not the Original of Oregon.

The textbooks in the hands of our children in the public schools


continue to furnish them with the erroneous information that the
name of the State of Oregon was derived from the word "oregano,"
the Spanish name for the plant that we call marjoram. This is mere
conjecture, absolutely without support. More than this, it is
completely disproved by all that is known of the history of the name.
There is nothing in the records of the Spanish navigators, nothing in
the history of Spanish exploration or discovery, that indicates even in
the faintest way that this was the origin of the name, or that the
Spaniards called this country or any portion of it by that name.
There is marjoram here, indeed; and at a time long after the
Spaniards had discontinued their northern coast voyages it was
suggested that the presence of marjoram (oregano) here had led
the Spaniards to call the country "Oregon."
From the year 1535 the Spaniards, from Mexico, made frequent
voyages of exploration along the Pacific Coast towards the north.
The main object was the discovery of a passage connecting the
Pacific and Atlantic oceans. Consequently the explorers paid little
attention to the country itself. After a time, finding the effort to
discover a passage fruitless, they desisted for a long period. But
after the lapse of two centuries they began to establish settlements
on the coast of California; and then voyages towards the north were
resumed by some of their navigators. In 1775 the mouth of the
Columbia River was seen by Heceta, but, owing to the force of the
current, he was unable to enter. The fact here to be noted is that the
Spaniards of that day did not call the country Oregon, or, if they did,
they have left no record of it.
But even before the discovery of the Columbia River by Heceta
the name of Oregon appeared in another quarter. Jonathan Carver,
of Connecticut, who had served as a captain in the colonial war
against the French, set out from Boston in 1766 and proceeded by
way of the Great Lakes to the region of the Upper Mississippi, now
forming the States of Wisconsin, Minnesota and Iowa. He returned
to Boston in October, 1768, and then went over to England, where
his "Travels" were published. From that journey to the Upper
Mississippi region he brought back the name of Oregon, which he
says he obtained from the Indians there. "From these nations," he
says, "together with my own observations, I have learned that the
four most capital rivers of the Continent of North America, viz., the
St. Lawrence, the Mississippi, the Bourbon (flowing into Hudson's
Bay), and the Oregon, or River of the West, have their sources in the
same neighborhood. The waters of the three former are within thirty
miles of each other; the latter, however, is rather farther west."
Carver, of course, had a geographical theory, and was seeking to
verify it. This is the first mention of the name of Oregon that has yet
been discovered. Carver either invented the word, or produced it
from imitation of some word spoken by the Indians. There certainly
was no "oregano," or marjoram, about it.
The word "oregano," it may be noted, has curious usage in
Spanish authors. One of Sancho's proverbs, literally translated, runs
thus: "Pray God, it may prove marjoram, and not turn out caraway
for us." It is said to be unexplainable why marjoram and caraway in
Spain should have been taken as types of the desirable and
undesirable. In another place Sancho says: "I would not have him
marjoram (oregano), for covetousness bursts the bag, and the
covetous governor does ungoverned justice." Here the word is used
in the sense of "eager for gain."
Others have professed or proposed to derive the name of
Oregon from the Spanish word "oreja," the ear—supposing that the
Spaniards noted the big ears of the native Indians and named the
country from the circumstance. But the Spaniards themselves have
left no record of the kind; nor has it been noted, so far as we are
aware, that the ears of our Indians were remarkably large. The word
"orejon" is nearer our form; it signifies "slice of dried apple," we may
suppose from its resemblance to the form of the ear. Many years ago
Archbishop Blanchet, of Oregon, while in Peru, noted a peculiar use
of this word "orejon" in that country, which he ingeniously
conjectured might throw some light on the origin of the name of
Oregon.
But it is unnecessary to formulate any fanciful theory. The name
of Oregon first appears in Carver's book of "Travels" in the Upper
Mississippi region in 1766–67. Did he invent the name? Probably. Did
he get it from the Indians? Possibly something like it. But it never
has been discovered among the Indians of that country since
Carver's time, nor anything like it. There remains a possible
supposition that French travelers who had passed through that
country some years before, and had proceeded on their westward
journey far toward the Rocky Mountains, and then returned, had
been making inquiries among the Indians as to the great western
river that all geographers had postulated, and had spoken a word
that the Indians had tried to imitate—possibly "Aragon"—knowing
that the Spaniards had explored the western coasts, and intimating
that the country by discovery might belong to Spain. But all these
are fruitless conjectures.20 We know where we find the name of
Oregon first written, when it was written, and by whom; and the
circumstances completely disprove the "oregano" and the "orejon"
theories. A notable fact it is that a slight incident of Carver's career,
so slight that he thought nothing about it—the creation of a name,
or the casual use of a name hitherto unknown—has immortalized his
own name upon the tongues of men dwelling in the region of his
"River of the West." But Minnesota has not neglected him. She does
justice to him in her records and historical transactions, and has not
forgotten to name a county for him. He died in poverty and misery in
London, January 31, 1780.
H. W. SCOTT.
20 Professor John Fiske, in his "History of the United
States," says that Oregon "may perhaps be the Algonquin
Wau-re-gan, 'beautiful water.'"
REMINISCENCES OF LOUIS
LABONTE.
By H. S. Lyman.

Louis Labonte (or Le Bonte), son of Louis Labonte of the Astor


expedition, who accompanied Hunt across the continent in 1811–12,
is still living at Saint Paul, Marion County, Oregon. He is now eighty-
two years old, and is in good health. His remembrance of earlier
experiences and life is still fresh and his mind seems very vigorous
for one of his age. He says, however, that his recollection of the
Indian languages that he once knew has now largely slipped away.
These were the Clatsop or Chinook, the Tillamook, Tualatin and
Calapooya, of which he says he knew a few words, and the Spokane
which he understood almost perfectly. Besides these, he talked
fluently in the Indian jargon and in French and English.
He was born at Astoria in 1818, his mother being a daughter of
Chief Kobayway, and an older sister of Celiast, or Mrs. Helen Smith.
Three years of his early life, about 1824 to 1827, were spent at
Spokane Falls, and the three years succeeding at Fort Colville. Then
two years, probably 1830 to 1833, were spent on French Prairie. His
father had removed to that place and was engaged in raising wheat
on a piece of land owned by Joseph Gervais, whose wife was a sister
of his mother. From this place he accompanied the family to the farm
of Thomas McKay on Scappoose Creek near Sauvie's Island, where
he spent three years. In 1836 he removed with the family to a
location on the Yamhill River near Dayton. In 1849, being then a well
matured man, he accompanied a party headed by William McKay to
the gold mines of California, returning the same year. During the
Indian war of 1855–56 he was a member of the Oregon Volunteers
in the company of Robert Newell, which was stationed at Fort
Vancouver to hold in check the Cascade Indians and the Klickitats to
the north.
His reminiscences are important on the following: First, as to his
father, Louis Labonte; second, earliest French Prairie; third,
experiences at Scappoose; fourth, Spokane Indians and Indian
myths; fifth, the names of Indian places and persons; sixth, the
primitive Indian articles of food; seventh, on some of the Indian
tribes and customs and traditions; and eighth, of the original white
men.

I.
LOUIS LABONTE Senior.

Concerning his father, he says that this member of the Astor


expedition was born in Montreal, and was about eighteen years old
when he came out to Saint Louis, and was there engaged as an
employee of the American Fur Company for four years; at the age of
twenty-two he was engaged by Wilson P. Hunt of the Pacific Fur
Company to come to Oregon, and arrived in the following winter.
Upon the disruption of that company in 1814, Labonte took service
with the Northwestern Fur Company, which was in 1818 absorbed
into the Hudson's Bay Company. He had in the meantime become
acquainted with and married at Astoria the daughter of Chief
Kobayway of the Clatsop Indians, and it was in the year 1818 that
the son was born. Labonte Sr. took six years for the Hudson's Bay
Company, and spent three years at Spokane and three at Colville. He
then returned to Fort Vancouver and his service terminated some
time near 1828, when he asked to be dismissed and allowed to
remain in Oregon. This was directly against the policy of the
Hudson's Bay Company, who wished none of their trappers to
become settlers or free laborers in their territory, and it was the rule
that all of their servants must be dismissed at the place where they
were enlisted. But Labonte was an astute Frenchman and contended
that as he had enlisted in Oregon and was not brought here by the
Hudson's Bay Company, it was no infraction of this rule, but rather in
compliance with it that he should be dismissed here.
Notwithstanding, his request was refused and no dismission was
allowed unless he returned to Montreal. Accordingly, he made the
trip to Canada, starting in March, and receiving his regular papers
certifying to the ending of his term of service. But he immediately
began the journey back and arrived here again in November of the
same year—which may have been 1830. This shows him to have
been an independent and determined man, and a good husband and
father. It may also have had much more bearing than has yet been
credited as to the settlement of Oregon.

II.
EARLIEST FRENCH PRAIRIE.

After having terminated his service with the Hudson's Bay


Company, Labonte evidently made up his mind to become a settler
in Oregon, the country of his wife, and with which he was
undoubtedly well pleased as a home. Several of his comrades who
belonged to the old Hunt party were already contemplating this step,
and some had actually begun settlement. Etienne Lucier had first
taken a place at the site of East Portland, but, as Labonte
remembers, having been informed by McLoughlin that he himself
wished to occupy this location, was now removing to French Prairie.
Joseph Gervais, however, was already at French Prairie, having laid a
claim at Chemaway, a point on the bank of the Willamette River
about two and a half miles south from Fairfield at present. Labonte
Sr. moved to the place of Gervais and engaged with him in raising
wheat, and, among other improvements, built a barn; but did not
complete a location of his own.
Louis, the son, remembers more particularly the boyish
occupations of the region, of which hunting was the most important.
He describes a method of hunting the deer (jargon, Mowich;
Calapooya, Ahawa-ia) which, perhaps, has never been placed in
print. The deer were very abundant in primitive times, and during
the breeding season the bucks were pugnacious. In order to come
near to them the Indians would take the head of a deer, including
also the hide of the neck, properly prepared, which was placed over
the head of the hunter; and he then, stooping over so as to keep the
mouth of the deer head off the ground, as if grazing, would creep up
on the lee side of the herd. He would also, so as to more closely
imitate the action of a deer, occasionally jerk the head from side to
side, as if nabbing flies.
Presently a buck from the herd, observing the suspicious
stranger, would begin to stamp and snuff, and bridle with anger; or,
possibly, shaking with excitement, would edge nearer, challenging
the supposed intruder for a fight, browsing and approaching, or
maneuvering for a position. The hunter, in the meantime, would
keep up his own maneuvers until the victim was near, and then let
fly the fatal arrow; though Labonte says that before the use of guns,
the Indian himself, if he chanced to miss his mark, was sometimes
so viciously attacked by the deer as to be badly gored or trampled,
or possibly killed. Young Labonte always used a gun at this sport.
He recalls also seeing two grizzly bears on French Prairie, one of
which was in connection with a hunting party one foggy morning.
Grizzlies were not unknown in the Willamette Valley, though they
were not abundant. The Chinook jargon name for the grizzly was
eshayum, quite distinct from the name of the common black bear,
itch-hoot. Both these words are evidently primitive Indian terms (S.
B. Smith) and thus show that the grizzlies were a well recognized
species in the Willamette Valley during the period of Indian
occupation.
Labonte Jr. has recollections of earliest French Prairie which are
very valuable, and give a new, or at least a clearer understanding of
settlement here, than ever seems to have been published, and
shows Chemaway on the Willamette River about twelve miles above
Champoeg to have been the first nucleus of settlement. According to
these recollections, which should of course be subjected to close
examination before being used as the basis of a final conclusion, it
was Joseph Gervais and the remnants of the Astor company, or
Hunt's part of it, who were the original pioneers of French Prairie,
and thus of Oregon. These were Joseph Gervais, Etienne Lucier,
Louis Labonte, Wm. Cannon, Alexander Carson, (Alex. Essen) and
Dubruy. Whether the fact that they had been with an American
company made them any more independent and more disposed to
settle for themselves, may be questioned; but at any rate, they
formed a little company of comrades and became the first group of
independent Oregon people.
Joseph Gervais was the first, and when the Labontes arrived in
about 1831, he had been upon his place at Chemaway at least three
years, and had made considerable improvements. Chemaway is
situated on the bank of the Willamette River at a somewhat abrupt
point over the water and became afterwards the location of Jason
Lee, and the Methodist Mission. It is not to be confounded with
Chemawa, the location of the United States Indian Training School
on the line of the Southern Pacific Railroad,—though this is a
mispronunciation of the old name, in which both a's are long, with a
strong tendency toward long e, making the name Chemaewae.
Gervais had substantial buildings, and Labonte's description of
his house and barn is very interesting. The house was about 18 ×
24, on the ground, and was constructed of square hewed logs, of
rather large size. There were two floors, one below and one above,
both of which were laid with long planks or puncheons of white fir,
and probably adzed off to a proper level. The roof was made of
poles as rafters, and the shingling was of carefully laid strips or
sheets of ash bark, imbricated. Upon these were cross planks to hold
them in place. There were three windows on the lower floor of about
30 × 36 inches in dimensions, and for lights were covered with fine
thinly dressed deer skins. There was also a large fireplace, built of
sticks tied together with buckskin thongs, and covered with a stiff
plaster made of clay and grass. The barn was of good size, being
about 40 × 50 feet on the ground, and was of the peculiar
construction of a number of buildings on early French Prairie. There
were posts set up at the corners and at the requisite intervals
between, in which tenon grooves had been run by use of an auger
and chisel, and into these were let white fir split planks about three
inches thick to compose the walls. The roof was shingled in the
same manner as the house, with pieces of ash bark. There was a
young orchard upon the place of small apple trees obtained from
Fort Vancouver.
At the time that the Labontes came to Chemaway, Etienne Lucier
had not yet taken his own place, about three miles above
Champoeg, at Chewewa, but was living, or camping, upon the place
of Gervais, probably looking around the country and making
arrangements for a permanent home. Lucier, therefore, was not the
first settler upon French Prairie, but this honor belongs to Joseph
Gervais, who must have gone there, according to Labonte's
recollections, about 1828.
William Cannon was a millwright, being an American by birth,
from Pennsylvania, and at the time the Labontes came to French
Prairie, was at Vancouver, building the gristmill. He afterwards built
the Champoeg gristmill, as stated by Willard H. Rees.
Dubruy settled subsequently about two and one-half miles south
of Champoeg.
Alexander Carson (Alex Essen, as pronounced by Labonte), was
a trapper, and spent much of his time in the Yamhill country. He
seems to have been a very independent man, but finally lost his life
at a certain butte on the North Yamhill River (still called Alec's Butte)
by the Twhatie (Tualatin) Indians, probably with the simple object of
possessing themselves of his rifle and trappings.
As to Champoeg, the historic point in Oregon history, this was
originally a camping and council ground of the Indians. It was near
the north boundary of the Calapooyas, and here various tribes came
to trade, to play games of chance and skill, and not infrequently to
intermarry.
One great sport was diving. The water of the Willamette River
off the bluff was very deep, and it became a great contest for the
young men to see who could dive deepest and remain under water
longest. Some of the bolder ones even not rising until the blood
began to burst from their noses or mouths.
Labonte recalls with great vividness the wedding ceremonies
which he often witnessed, and that were frequently celebrated here
between contracting parties of the different tribes. It was quite an
intricate ceremony. The tribe of the groom would assemble on one
side and that of the bride on the other. The groom, placed in the
forefront of his people, was dressed in his best, and seated upon the
ground. He was then approached by members of his own tribe, who
began removing his outer garments, article by article. After this was
done, members of the bride's tribe came and reclothed him with
different garments and placed him in readiness to receive his wife.
The bride, in the meantime, was placed in the forefront of her
people, but was covered entirely, face and all, with a blanket. When
ready to be presented, she was carried by women of her tribe, and
brought within a short distance of the groom, but here her bearers
halted to rest. Then, probably indicating the desire of both peoples
that the ceremony should proceed, and that all were friendly, a
shout or hallo was raised by all parties, which is given as follows:
"Awatch-a-he-lay-ee. Awatch-a-he-lay-ee." After which she was
taken the rest of the way and presented, while the same cry of
applause and approbation was again raised.
A bride was purchased, and the presents were numerous and
valuable. In case that the groom and bride were descendants of
chiefs, presents were made between the whole tribes. These
presents were of all sorts, and consisted of horses (cuiton), blankets
(passissie), guns (mosket), slaves (eliatie), haiqua shells, or, as the
small haiqua shells were called, cope-cope, which is a kind of
turritella, kettles (moos-moos), tobacco (ekainoos), powder
(poolallie), bullets (kah-lai-ton), knives (eop-taths), or other articles.
The name Champoeg, says Labonte, is not derived from Le
Campment Sable, the French name, but is purely Indian. "Cham,"
the hard ch, not sh, is of the same character as the universal Che
prefix of the Calapooyas; as Chehalem, Chewewa, Chemaway,
Chamhokuc, or Chemeketa; and the latter part, "poeg," or poek, was
for a certain plant or root found there by the Indians, and called po-
wet-sie. That this is the true derivation, and it is not from the French
term, meaning the sandy camp, is evidenced by its similarity to the
other Indian names just given above.

III.
AT SCAPPOOSE.

When young Labonte was about sixteen, and after spending


about two years at Chemaway, the family was employed by Thomas
McKay to take charge of his farm on Scappoose Plains, across the
Willamette Slough, or Multnomah, from Sauvie's Island—McKay
being one of the most energetic and intrepid captains of the
Hudson's Bay Company, and being at that time detailed for special
service in the Snake River country, where competition with American
companies was setting in with much vigor. On this farm the Labontes
raised wheat, oats, peas, potatoes, and various garden products,
and had cattle and hogs, but no sheep. On the farm with the
Labontes there was a Frenchman named Antoine Plasier.
It was during this period that Wyeth—whom Labonte recalls as
White, from a mixture of the English aspirate and the French non-
aspiration of th—made his second visit to the Columbia. It was,
however, more with the trim brig May Dacre that the lad had to do.
He remembers that he was at that time just as tall as a musket,
which he indicates would reach about to his chin as a man. On this
craft, which lay anchored in the stream not far from the farm, he
was often invited to go visiting, particularly Sundays, and was well
treated by the sailors and Captain Lambert. He remembers once
being asked by the captain whether he could climb a mast, and he
immediately proceeded to show that he could, and ascended to the
topmast on the bare pole, climbing hand over hand. It happened to
be a windy day, and the brig was rolling somewhat in the swell, and
when the boy looked down from his lofty elevation, he was made
almost dizzy by observing how small the vessel below him looked in
the wide stream. But upon reaching deck again, he was
complimented by both sailors and captain as being made of stuff fit
for a sailor.
Indeed, Lambert seems to have been very well pleased with
him, and offered him a passage on his ship to Boston, and a return,
either by land or sea, and to this his parents were almost persuaded
to give their consent, but at the last moment could not quite bring
themselves to do this. Sometimes he was invited by the captain to
take dinner, and amused the officers by his sturdy refusal to take
anything to drink—perhaps as much from suspicion as from set
conviction—though the better class of men on the Columbia at that
time greatly deprecated the use of intoxicants and were largely
temperate, and the boy very likely had imbibed these ideas.
He remembers Lambert as large and powerful, and full bodied;
of dark hair and complexion, and "a good man." Nathaniel Wyeth,
whom he also saw, was florid, light-haired and blue-eyed, but also
large, and perhaps even finer looking than Lambert.
Game at Scappoose and on the ponds of Sauvie's Island was
very abundant, consisting of deer, elk and bear, and panthers and
wildcats; and beaver were still plentiful; but the waterfowl of the
most magnificent kind, at their season of passage, and, indeed,
during much of the year, almost forbade the hunter to sleep.
Labonte remembers one winter season in particular when there was
a snowfall of about sixteen inches, and in the early morning he went
forth to hunt swan. These splendid birds of the white species, like
the innumerable ducks and geese, assembled at the island ponds to
feast upon the abundant wapatoes. On this particular morning the
youth soon discovered his flock of swans upon the surface of a
shallow lake, eating the roots, and being such an immense flock that
they were not to be disturbed even by the immediate presence of
the hunter. Then, disrobing to his shoulders,—for the water was too
deep to reach the flock otherwise,—he simply waded in, bringing
down two or three birds to a shot, until he soon had as many as he
could carry. Indeed, the lake was so covered by the flock as almost
to conceal the water. However, upon reaching home he was rather
chided for his performance by his father, who told him that by such
cold bathing he would be likely to get the "rheumatism," which was
his first acquaintance with that term.

IV.
SPOKANE INDIANS AND INDIAN MYTHS.

When taken to Spokane Falls, Labonte was a small boy of about


six years. His parents made their residence there from about 1824 to
1827.
He was much with the Indians, and learned their language like a
native, and was often present at their religious services, and heard
them tell their myths. One of their meetings he describes as follows:
At the lodge of the greatest chief there was a picture, from whom
obtained he does not know, but in all probability from some member
of the Hudson's Bay Company. When worship was held, this picture
was spread out on the floor, and, kneeling before it, the chief began
a prayer to the Great Spirit, or the Hyas Ilmihum, who was
addressed also by the name of Creator; the expression "Quilen-
tsatmen," meaning Creator, or, more exactly, "He made us." The
prayer was a petition to be made pleasing to God, to be kept under
His care, to be taken to Him at last, and to be kept from the "Black
fellow." After the chief had finished, others also followed, kneeling
down and uttering a shorter petition until all at last took their place
and followed along in an orderly manner. Those who had any
offerings left them before the picture. Then they began a hymn or
chant, and after that was finished, all joined in a dance.
Labonte recollects the names of some the Spokane chiefs:
Ilmicum Spokanee, or the chief of the moon; Ilmicum Takullhalth,
the chief of the day; and Kahwakim, a broken shoulder. He also
recollects a Colville chief, whose name was Snohomich, a white-
headed old man.
The Spokane Indians had the legends of the coyote, or Tallapus,
but his name was Sincheleep. In his breast he carried certain
knowing creatures, which were his spirits, or wits, and when he
wished to take council with himself, he would call them forth. They
gave him the answers he needed, and then went back into his
breast. Sincheleep, the coyote, was quite different from the fox,
Whawhaoolee, though the fox was also a knowing beast. The big
gray wolf was Cheaitsin; the grizzly bear, Tsimhiatsin, and the black
bear, N'salmbe.
A story of Tallapus, or Sincheleep, that Labonte remembers was
the same in substance as that of Tallapus and the cedar tree;
although Spokane is almost a thousand miles from the region of the
story of Tallapus. This illustrates to what a wide extent the folklore
of the primitive Indians extended. Sincheleep was once traveling and
was not entirely certain how he should obtain his meals upon the
way. However, in order to look as well as possible he decided to
dress up nicely; to comb his hair, and paint his face becomingly. In
the course of time he was met by two women who carried baskets in
which they had some camas bread and other Indian dainties. He
came forward and addressed them and said very pleasantly, "Sit
down, sisters; sit down. I will sing to you and tell you stories." So
they sat down while he sang and told them stories, and they
enjoyed his society so much that when at length he remarked
casually, "What have you in your baskets, sisters?" they very kindly
opened their stores and treated him; which, of course, he enjoyed,
and began at once to contrive for another treat. He bade them
good-bye and went on, but when out of sight took a circle about and
coming to a stream washed himself and painted another way, and
also combed his hair differently, and met the two women again. He
addressed them as before, saying, "Sit down, sisters; sit down, and I
will sing and tell you stories." This they did, and were again so
charmed that they opened their baskets and treated him as before.
He then went on, but circled about again so as to meet them once
more, being now combed and painted still differently. He sang and
told stories and was again treated. But about the fifth or sixth time
that this happened, the women began to suspect that the cunning
creature was no other than Tallapus, and when he saw that he was
discovered, he bade them a final good-bye, and went off to the
wooded hills. Then began the story of the tree, which as told by
Labonte, runs as follows: "He saw a tree with a crotched root,
leading to a hollow within, and thinking this a fine resting place,
went inside. He then asked the tree to close, and it did so
obediently. This was some time along in the fall. After it was closed,
he asked it to open, and it did this also. Then he asked it to close
and it was closed. It opened or shut whenever he asked it to, but by
and by when he asked it to open, it would not. Then he was very
sorry and sat down inside the tree and cried. But he was compelled
to remain there all winter."
Some time along in the early spring the birds came at his
request to peck him out; but the first, the second, and many others
that tried only broke their bills and were unable to make even a
small hole, until this was done by a woodpecker; and through the
opening Tallapus was able to gaze abroad and see the blooming
flowers and the green grass.
But still he could not go through the opening, and finally
concluded that the only way was to take himself to pieces and put
himself out, piece by piece. His eyes were the first parts that he thus
placed on the outside, but they were seized upon by a raven who
carried them away. Finally the various sections of his body were all
out and collected and put together properly, except that his eyes
were gone and he was blind. But he smelled the scent of flowers
and felt around until he found some of the flowers, which he placed
in each eye. Then, feeling his way along laboriously, and staring
about as if seeing everything, was at length directed by smelling
smoke. Following this odor, he was led to a lodge where there were
some women. By these his misfortune was ridiculed, and they
engaged in laughter as he felt for the door; but he answered, "I am
only measuring your house." He was moving around in the
meantime and trying to find a place to sit down, which only
increased their merriment; but he answered, "I see; I see; but I am
only measuring the ground."
Then one of the women said, "Can you indeed see?"
Then he, staring off, replied, "Do you see that fire?"
"Where?" they asked.
"Far off," he answered, and described the distance as far away,
beyond the limit of their vision.
"No," they confessed, "that is too far for us."
Then he answered, "I can see what you do not." By which one
of the women was so impressed with the strength of his sight that
she immediately wished to swap eyes, and he promptly accepted the
proposition; as a result of which he could see even better than
before, while she became blind. He then transformed her, for her
folly, into a snail, which even to this day feels its way along the
ground.
The following are some of the Tallapus stories, which Labonte
remembers, found in the Willamette Valley:
According to the Calapooyas, who occupied this valley from near
the Pudding River southward, Tallapus came originally from the
Rocky Mountain country and went down the Columbia River, and
thence southward along the coast and finally over the coast
mountains into the Willamette Valley; though his exact birthplace or
origin is still a matter of doubt.
Arriving by the Willamette River, he found the tribes of that
region in very unhappy circumstances; chiefly from the absence of
any good place for catching fish, and also, owing to the depredations
of certain gigantic skookums. In order to remedy the first evil, he
determined to make a fall in the Willamette River where the salmon
would collect and be easily captured. He found a place at the mouth
of Pudding River, the Indian name of which is Hanteuc, and here he
began erecting the barrier, but finding it not suitable, went further
down, leaving only a small riffle. At Rock Island, he began in
earnest, but upon further investigation found this also unsuitable,
and leaving here a strong rapid, went down to the present site of
the Willamette Falls, where he completed his task and made the
magnificent cataract which is not only a scene of beauty, but a
model fishing place.
After having provided the fishery, he decided to invent a
remarkable trap which would obviate the labor of fishing. He
succeeded and produced a marvelous machine which not only
caught the fish, but also had the power to talk, and would cry out,
"Noseepsk, noseepsk," when it was full.
Determining to try his invention for himself, Tallapus set the trap
and went immediately to his camping place to build a fire in order to
cook the fish. But scarcely had he begun when the trap cried out,
"Noseepsk! Noseepsk!" and going down he found it full of fish sure
enough. Then, returning, he began once more to prepare his fire;
but the trap called out again, "Noseepsk! Noseepsk!" He obeyed its
summons and found it full, and went back once more to start his
fire; but the trap called for him again, and now, out of patience with
its promptness, he said to it crossly, "Wait until I build a fire, and do
not keep calling for me forever." But by this sternness the trap was
so much offended that it instantly ceased to work, and the
wonderful invention was never used by men, who were obliged as
before to catch the salmon with spears or nets.

THE STORY OF THE SKOOKUM'S TONGUE.

However, in the course of time the Indians became very


prosperous, and a large village was built on the west side of the
river. But while they were thus prospering, a gigantic skookum that
lived upon the Tualatin River began to commit fearful depredations.
His abode was on a little flat about two miles from the Indian village,
but so long was his tongue that he was in the habit of reaching it
forth and catching the people as he chose. By this, of course, the
village was almost depopulated, and when, after a time, Tallapus
returned, he was very angry to see that the benefits of his fishery
had gone, not to the people, but to the wicked skookum. He
therefore went forth to the monster and cried out to it, "O, wicked
skookum; long enough have you been eating these people." And
with one blow of his tomahawk cut off the offending tongue, and
buried it under the rocks upon the west side of the falls; after which
the people flourished. But so persistent is Indian superstition that
even yet some of the old Indians say that when the canal was cut
around the falls, that this was nothing more than laying bare the
channel made for the tongue of the skookum.

THE SKOOKUM AND THE WONDERFUL BOY.

On the east side of the falls at about the site of Oregon City the
Indians also made a large village, being nourished by the fishery,
and had among them a great chief. But from the mountains on the
east there came a frightful skookum, who destroyed the entire
village and even the old chieftain and all the people, except the
chief's wife and her unborn son.
The woman desiring that her son should be great and strong,
took him after his birth to the various streams or lakes that were
haunted by Tomaniwus spirits, and bathed him in the waters. From
these he absorbed the strength of the water and of the spirits, and
in consequence, grew prodigiously. In the course of time, he
returned to the old village where he found his mother, and looking
about the lodge, he began to ask her what were the various articles
that he saw. She replied: "This is the spear with which your father
used to catch the salmon; and this is the tomahawk with which he
used to kill his enemies or to cleave wood; and this is the bow with
which he used to shoot arrows." Taking the tomahawk in his hand,
the boy went out to look abroad but was almost immediately met by
the skookum returning. Thereupon driving his tomahawk into a
gnarly log of wood so as to make a crack, he cried out to the giant,
"If you are so strong, hold this crack open while I take another
stroke;" and into the opening the witless skookum placed his fingers,
but the tomahawk being instantly withdrawn and the crack closing,
was held fast, after which he was easily killed by the boy. Then
taking his father's bow, the youngster went forth and shot an arrow
into the sky, calling out at the same time, "As the arrow falls let
those who died come to life;" and this also was done. Scarcely had
the arrow fallen before the old chief and all his people were seen
coming up the river in their canoes; and landing at the rocks, they
began fishing as if nothing had happened. The wonderful boy being
rejoiced to see his father, whom he had never looked upon before,
went down among the fishermen; but when he was seen by the old
chief, was accosted rudely with the question "Who are you? I am
chief here." And the old chief not knowing his son, accompanied his
rough language with an even rougher blow.
By this the wonderful boy was greatly affected, and thinking that
he could benefit his tribe no more, retired to the rocks above the
falls, and began weeping; and, indeed, wept so copiously that his
tears falling on each side of the falls wore two great holes in the
solid rock, which may be seen there to this day. Finally deciding that
he would no longer live as a man, the boy changed himself into a
fish in order that he might rest in the quiet waters. But he was
disturbed by the roaring of the river to such an extent that he swam
upward as far as the Tualatin. But neither here could he rest on
account of the roaring of the water. He proceeded thence to the
mouth of the Molalla, and of the Pudding River, and of the Yamhill,
successively, but had no resting place, until finally he reached the
clear Santiam. Here he found what he desired, and went to sleep in
a still pool; but being discovered by Tallapus, was changed into a
rock, having the form of a salmon. And this accounts, say the
Indians, for the fact that no salmon that ascend the falls at Oregon
City ever turn aside into any of the streams until they reach the
Santiam; but there seeing the rock, they take a circle and swim near,
and then saluting it with a flip of their tail proceed up the crystal
clear river until they reach the pebbly bars suitable for their
spawning grounds.

THE HAUNTED LAKE.


In addition to the above, Labonte tells an Indian story of a
haunted lake in the hills to the northward of Newburg. The waters of
this lake are exceedingly deep and still, and it has the name of the
skookum water.
Long ago, said the Indians, there was one man who, although
he knew that this was a tomaniwus water, determined recklessly to
reach it in his canoe, and disturb its placid surface with the strokes
of his paddle. Making his way thither, in his little craft in which he
also had his dog as his sole companion, he at length came to the
shadowy lake. He directed his strokes toward the center, which he
had scarcely reached before the water grew darker and became
greatly disturbed. Finally, it began revolving round and round, and
the man with his canoe and dog were whirled along in the stream
until a vortex was developed and opened, into which all sank. Then
the lake was pacified, and again became serene. But even at the
present time, upon a foggy morning, if one gazes over the rocks
upon Skookum Lake, he will see a white object whirling round and
round on the surface of the water, and may, perhaps, hear whines
and cries; this is the spirit of the dog, which thus returns.

You might also like