91% found this document useful (11 votes)
4K views379 pages

Principles of Programming & Coding

Principles of Programming & Coding

Uploaded by

Daniel Florea
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
91% found this document useful (11 votes)
4K views379 pages

Principles of Programming & Coding

Principles of Programming & Coding

Uploaded by

Daniel Florea
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/ 379

Principles of Programming & Coding

VIEW THIS BOOK

ONLINE Principles of
https://online.salempress.com

Programming & Coding

4919 Route 22, PO Box 56


Amenia NY 12501 SALEM
Phone: 518-789-8700 | 800-562-2139 PRESS
Fax: 845-373-6360
www.greyhouse.com | [email protected]
www.salempress.com | [email protected]
Principles of
Programming &
Coding
Principles of
Programming &
Coding

Editor
Donald R. Franceschetti, PhD
The University of Memphis

SALEM PRESS

A Division of EBSCO Information Services


Ipswich, Massachusetts

GREY HOUSE PUBLISHING


Cover image: By monsitj (iStock)

Copyright ©2018, by Salem Press, A Division of EBSCO Information Services, Inc., and Grey House Publishing, Inc.

All rights reserved. No part of this work may be used or reproduced in any manner whatsoever or transmitted in
any form or by any means, electronic or mechanical, including photocopy, recording, or any information storage
and retrieval system, without written permission from the copyright owner. For permissions requests, contact
[email protected].

∞ The paper used in these volumes conforms to the American National Standard for Permanence of Paper for Printed
Library Materials, Z39.48 1992 (R2009).

Publisher’s Cataloging-In-Publication Data


(Prepared by The Donohue Group, Inc.)

Names: Franceschetti, Donald R., 1947- editor.


Title: Principles of programming & coding / editor, Donald R. Franceschetti, PhD.
Other Titles: Principles of programming and coding
Description: [First edition]. | Ipswich, Massachusetts : Salem Press, a division of EBSCO Information Services, Inc. ;
[Amenia, New York] : Grey House Publishing, [2018] | Series: Principles of | Includes bibliographical references
and index.
Identifiers: ISBN 9781682176764 (hardcover)
Subjects: LCSH: Computer programming. | Coding theory.
Classification: LCC QA76.6 .P75 2018 | DDC 005.1—dc23

First Printing
Printed in the United States of America
CONTENTS
Publisher’s Note. . . . . . . . . . . . . . . . . . . . . . . . . . . . vii Device drivers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Editor’s Introduction. . . . . . . . . . . . . . . . . . . . . . . . . ix Diffusion of innovations . . . . . . . . . . . . . . . . . . . . . 89
Contributors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv Digital divide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Digital forensics. . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
3D printing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Digital libraries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Digital native . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
American Standard Code for Information Digital photography. . . . . . . . . . . . . . . . . . . . . . . . . 98
Interchange (ASCII) . . . . . . . . . . . . . . . . . . . . . . . . . 6 Digital signal processors (DSP). . . . . . . . . . . . . . . . 99
Android OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Digital watermarking. . . . . . . . . . . . . . . . . . . . . . . 101
Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Disk operating system (DOS). . . . . . . . . . . . . . . . 103
Autonomic computing . . . . . . . . . . . . . . . . . . . . . . 14 Drone warfare . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Avatars and simulation. . . . . . . . . . . . . . . . . . . . . . . 16 Drones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

Binary hexadecimal representations . . . . . . . . . . . 19 E-banking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110


Boolean operators. . . . . . . . . . . . . . . . . . . . . . . . . . 23 E-learning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Branching logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Electronic circuits . . . . . . . . . . . . . . . . . . . . . . . . . 113
Electronic communication software. . . . . . . . . . . 115
Characters and strings. . . . . . . . . . . . . . . . . . . . . . . 28 Encryption. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Cloud computing. . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Error handling. . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Coding and encryption. . . . . . . . . . . . . . . . . . . . . . 32 Event-driven marketing (EDM) . . . . . . . . . . . . . . 121
Color coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Expectancy theory. . . . . . . . . . . . . . . . . . . . . . . . . 123
Combinatorics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Experimenter’s bias. . . . . . . . . . . . . . . . . . . . . . . . 124
Comment programming. . . . . . . . . . . . . . . . . . . . . 39 Extreme programming . . . . . . . . . . . . . . . . . . . . . 126
Comparison operators. . . . . . . . . . . . . . . . . . . . . . . 41
Computer animation. . . . . . . . . . . . . . . . . . . . . . . . 44 Firewalls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Computer memory . . . . . . . . . . . . . . . . . . . . . . . . . 46 Firmware. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Computer modeling . . . . . . . . . . . . . . . . . . . . . . . . 48 Functional electrical stimulation (FES). . . . . . . . 133
Computer security. . . . . . . . . . . . . . . . . . . . . . . . . . 51
Game programming . . . . . . . . . . . . . . . . . . . . . . . 135
Computer-aided design (CAD). . . . . . . . . . . . . . . . 53
Gamification. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Computer-aided design and computer-aided
Graphical user interface (GUI) . . . . . . . . . . . . . . 138
manufacturing software (CAD/CAM) . . . . . . . . . . 55
Graphics formats. . . . . . . . . . . . . . . . . . . . . . . . . . 140
Computer-assisted instruction (CAI) . . . . . . . . . . . 57
Guard clause. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Conditional operators. . . . . . . . . . . . . . . . . . . . . . . 59
Constraint programming. . . . . . . . . . . . . . . . . . . . . 62 HTTP cookie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Control systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Cowboy coding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Imagined communities. . . . . . . . . . . . . . . . . . . . . 147
CPU design. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Incremental development. . . . . . . . . . . . . . . . . . . 149
Crowdfunding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Information technology (IT) . . . . . . . . . . . . . . . . 151
Crowdsourcing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Information visualization . . . . . . . . . . . . . . . . . . . 153
Cryptography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Internet Protocol (IP). . . . . . . . . . . . . . . . . . . . . . 154
Inversion of control (Hollywood Principle). . . . . 155
Data mining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 iOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Data warehouse . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Iterative constructs. . . . . . . . . . . . . . . . . . . . . . . . . 160
Database design. . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Database structuring conventions. . . . . . . . . . . . . . 83 Java programming language. . . . . . . . . . . . . . . . . 163
Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164

v
Contents Principles of Programming & Coding

Knowledge worker. . . . . . . . . . . . . . . . . . . . . . . . . 166 Search engine optimization (SEO) . . . . . . . . . . . 237


Semantic memory . . . . . . . . . . . . . . . . . . . . . . . . . 238
Levels of processing theory. . . . . . . . . . . . . . . . . . 168 Semantics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Logic synthesis. . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 Signal processing. . . . . . . . . . . . . . . . . . . . . . . . . . 240
Logistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 Source code comments. . . . . . . . . . . . . . . . . . . . . 243
Spiral development. . . . . . . . . . . . . . . . . . . . . . . . 245
Machine learning. . . . . . . . . . . . . . . . . . . . . . . . . . 173 Standard deviation. . . . . . . . . . . . . . . . . . . . . . . . . 248
Malware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Standpoint theory. . . . . . . . . . . . . . . . . . . . . . . . . 249
Massive open online course (MOOC) . . . . . . . . . 177 Statistical inference. . . . . . . . . . . . . . . . . . . . . . . . 251
Meta-analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 String-oriented symbolic languages
Metacomputing . . . . . . . . . . . . . . . . . . . . . . . . . . . 181  (SNOBOL). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Metadata. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 Structural equation modeling (SEM). . . . . . . . . . 254
Microprocessors. . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Mixed methods research (MMR). . . . . . . . . . . . . 186 Technology in education. . . . . . . . . . . . . . . . . . . . 256
Mobile apps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 Test doubles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Mobile technology. . . . . . . . . . . . . . . . . . . . . . . . . 191 Theory of multiple intelligences. . . . . . . . . . . . . . 261
Motherboards. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 Theory X and Theory Y. . . . . . . . . . . . . . . . . . . . . 262
Multiprocessing operating systems (OS) . . . . . . . 195 Transformation priority premise (TPP). . . . . . . . 264
Multi-user operating system (OS). . . . . . . . . . . . . 197 Tree structures. . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Turing test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Naming conventions . . . . . . . . . . . . . . . . . . . . . . . 200
Net neutrality. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 Uncertainty reduction theory (URT). . . . . . . . . . 272
Network security. . . . . . . . . . . . . . . . . . . . . . . . . . . 205 Unicode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Neuro-linguistic programming (NLP). . . . . . . . . 207 UNIX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Neuromarketing. . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Neuromorphic chips. . . . . . . . . . . . . . . . . . . . . . . 210 Variables and values. . . . . . . . . . . . . . . . . . . . . . . . 279

Objectivity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 Waterfall development . . . . . . . . . . . . . . . . . . . . . 282


Object-oriented design (OOD). . . . . . . . . . . . . . . 215 Web design. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Object-oriented programming (OOP). . . . . . . . . 217 Web graphic design. . . . . . . . . . . . . . . . . . . . . . . . 287
Working memory. . . . . . . . . . . . . . . . . . . . . . . . . . 289
Privacy rights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 Worse-is-better . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Programming languages. . . . . . . . . . . . . . . . . . . . 222
Prototyping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 Time Line of Inventions and Advancements in
Programming and Coding . . . . . . . . . . . . . . . . . . 295
Quantum computing. . . . . . . . . . . . . . . . . . . . . . . 228 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Bibliography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Random access memory (RAM). . . . . . . . . . . . . . 230 Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Rapid application development (RAD). . . . . . . . 232
Rational choice theory . . . . . . . . . . . . . . . . . . . . . 234

vi
Publisher’s Note

Salem Press is pleased to add Principles of Programming • Illustrations that clarify difficult concepts via
& Coding as the tenth title in the Principles of ­series that models, diagrams, and charts of such key topics as
includes Biotechnology, Chemistry, Physics, Astronomy, cloud computing, cryptography, e-banking, neu-
Computer Science, Physical Science, Biology, and Scientific romarketing, and waterfall programming.
Research. This new resource introduces students and • Bibliographies that offer further reading that re-
researchers to the fundamentals of programming lates to the entry.
and coding using easy-to-understand language,
giving readers a solid start and deeper understanding This reference work begins with a comprehen-
and appreciation of this complex subject. sive introduction to the field, written by volume
editor Donald Franceschetti, Professor Emeritus at
The 138 articles in this volume explain basic prin- University of Tennessee.
ciples of programming and coding, ranging from
3D printing and Algorithms to Waterfall develop- The book includes helpful appendixes as another
ment and Worse-is-better with attention paid to valuable resource, including the following:
Information visualization, Uncertainty reduction
theory, Technology in education, and more. All of • Time Line of Inventions and Advancements in
the entries are arranged in an A to Z order, making it Programming and Coding;
easy to find the topic of interest. • Glossary;
• Bibliography; and
Entries related to basic principles and concepts in- • Subject Index.
clude the following:
Salem Press and Grey House Publishing extend their
• Fields of study to illustrate the connections between appreciation to all involved in the development
the topic and the various branches of science and and production of this work. The entries have been
technology related to programming and coding; written by experts in the field. A list of heir names fol-
• An Abstract that provides brief, concrete summary lows the Editor’s Introduction.
of the topic and how the entry is organized;
• Text that gives an explanation of the background Principles of Programming & Coding, as well as all Salem
and significance of the topic to programming Press reference books, is available in print and as an
and coding as well as describing the way a process e-book. Please visit www.salempress.com for more
works or how a procedure or technique is applied information.
to achieve important goals related to writing effec-
tive programs and code.

vii
Editor’s Introduction

What Is a Program? write on the tape and then move the tape forward
A program is a set of instructions, meant to be car- or backward by one space. It turned out that every
ried out by one of more individuals or intelligent ma- effective procedure in arithmetic could be imple-
chines. An Army drill sergeant uses a simple set of mented as Turing machine and, further, that there
instructions to control his men. Once the meaning were Turing machines that could read in description
of the basic commands is understood, the sergeant of another Turing machine and then emulate it. This
could confine his men to a given area or control their in turn led to the notion of a universal Turing ma-
behavior during a 20-mile hike. The set of commands chine or programmable computer.
he uses is similar to the commands in a computer Now, a universal Turing machine was not needed
program; it can be pre-recorded, so that no human for most applications. One could economize and use
programmer (or drill sergeant) is needed. a reduced instruction set that would be useful for
For the most part we are concerned with instruc- many purposes, particularly where speed or size was
tions that a computer programs gives to a digital a consideration. A broad view of information tech-
computer. The program may by very simple, for in- nology shows the field growing out from two cen-
stance, to input a number of statements and the then ters. One center might be labeled communication,
output them in alphabetical order, or it may be far starting with the telegraph and voice communication
more complex, involving branch points and conver- and then leading to television and, ultimately, virtual
gence criteria to decide when it is done. Computer reality. The second center is computation which in-
programs must be written in a computer language cludes the several generations of computers. As time
understandable to both the human programmer has gone by, the two “centers” have merged. Consider
and the computer. The development of computer for instance the modern cell phone. It can be used
languages is itself a major subfield of linguistics—the for electronic mail, or as a camera, or as a computer
study of languages and their grammars. terminal. This tendency to combine functions in one
Any machine intended to perform its functions on device is characteristic of most developments in in-
its own, without guidance or interference, is called formation technology. While there will always be spe-
an automaton. The history of automata extends over cialized applications the trend is clearly in the direc-
several centuries. The Jacquard loom, invented in tion of greater generality.
1802 was an early example. The loom could be pro-
grammed to reproduce any pattern of threads in a What Is Coding?
fabric. Interestingly the loom was controlled by a sort If humans are to devise tasks that computers can ex-
of punch card, the precursor to punch cards used in ecute, there must be a common language which is
computer programming. A variety of note-keeping understood both by the human programmers and by
systems were based on index cards, where the desired computing machines. The history of computer s­ cience
card would be the one that had all of its holes prop- begins with the search for a common language. Now
erly punched. A great step forward came as the result humans are already familiar with a number of simple
of the work of British mathematical logician, Alan codes. The color code by which an electronics student
M. Turing. Turing’s main interest was in machines identifies a resistor with a particular resistance is one
that could do elementary arithmetic. Turing began such. Various alphabetic codes have been developed
by breaking down each computation into elementary for use in communication. The Morse code used by
steps. The general framework introduced by Turing telegraphers is a noteworthy example as is semaphore
involves a machine with a single memory location code used for communication at sea. To make com-
and a potentially infinitely long tape. The Turing munications faster and more reliable various devices
machine would then start from a designated square are added to the code, such as the parity bit.
on the tape and, depending on the symbol written in When one looks at nature with the eyes of a coder,
that square and the symbol stored in memory, would one finds that coding has evolved in a number of

ix
Editor’s Introduction Principles of Programming & Coding

situations. One of the fundamental questions in bi- housing the computers became a difficulty to over-
ology is “Why do offspring look like their parents.” come, as was the challenge of dissipating the wasted
The means of transmission is the genetic code with heat that the computers produced.
which virtually all organisms store the descriptions The invention of the transistor in 1947 gave rise to
of the essential proteins in a sequence of triplets of a second generation of electronic computers about
DNA bases. Variations on the basic theme allow us to a decade later. Transistor circuits were much smaller
explain the immune response, mutation, and many and far more and energy efficient than vacuum
other biological phenomena. tubes. They quickly became far more uniform in
Coding may also occur in the dimension of time. their characteristics as well. The first compilers date
The messages by which a sensation is encoded can back to this period, eliminating the need for tedious
be sampled by various means. The nervous system machine language programming. FORTRAN (for-
carries the message from one part of the body to an- mula translation) was invented Jim Backus of IBM
other. It is also apparent that coding is used in the in 1954. Fortran made it possible for scientists to do
animal kingdom. The code used by bees to commu- calculations using formulas without mastering the
nicate the location of a food source is probably the mysteries of machine language. Grace Hopper, an of-
best known example of coding in the insect world. ficer in the US Navy, developed the language known
as COBOL (Common Business Oriented Language)
An Overview of Computer Evolution in 1958. Incidentally the career of Grace Hopper who
It is difficult to predict the future evolution of com- retired from active service as a Rear Admiral, is an
puters. The physical sciences have been around inspiration to computer-minded boys and girls alike.
since the time of Galileo and Newton. Electrical en- The third generation, considered as lasting from
gineering is well over a hundred years old, though 1964 through 1971, was based on the integrated
the field has grown markedly since the introduction circuit. This was the time of large mainframe com-
of the transistor. Computational science has grown puters, like the IBM 360 and 370, and their counter-
much more quickly as advances in computer use parts. New languages like the Beginners’ All-purpose
have had an exponential effect on the field and its Symbolic Instruction Code (BASIC) were developed
growth. Subfields of computer science are constantly during this period as well as the C language in mul-
changing. The following is a generally accepted view tiple versions. Computers of this generation featured
of computer evolution and its effect on computa- time-sharing, with a single central processing unit
tional science. that could support the work of many peripheral de-
Computer designers are in general agreement vices. Also originating in this period are LISP, the list
that electronic computers have passed through four processing language, which was extensively used in
generations of development and are starting on a early artificial intelligence research.
fifth. While vacuum tube circuitry is obsolete, for the The fourth generation (1972–2010) was based on
most part, the basic principles of electronic computa- the microprocessor, now ubiquitous in all computers.
tion were established during the epoch of the first- This advance marked the beginning of the personal
generation electronic computers. The drawbacks of computer. While the need for very fast, very compact
these computers were well known. They relied on super computers remains, the development of the
vacuum tubes, which had limited lifetimes and were personal computer has had a large impact on compu-
known to fail. To obtain a reliable solution, a pre- tation in general. The semiconductor chip, on which
liminary program to test the functional soundness personal computers were based, required several ad-
of every tube in the computer had to be run both vances in materials science: A better understanding
before and after a program of interest to assure that of crystal growth; ion implantation; epitaxy; and pho-
no tubes had burned out. Computation schemes tolithography. When not needed by their owners, mi-
were developed that were meant to take into account crocomputers can be networked together to join in
the intrinsic variability of vacuum tubes. In addition such esoteric tasks as the search for extraterrestrial
to the inherent difficulties of working with vacuum intelligence or the more practical modeling of pro-
tubes, the computers themselves were relatively large tein folding. While an amateur could now assemble
and generated a great deal of heat, which meant that a working computer for a few hundred dollars, he

x
Principles of Programming & Coding Editor’s Introduction

was dependent on the chip manufacturers for the key in this area have interrupted their formal education
component. Very few manufacturers would now have so that they could devote all their youthful energy to
the high vacuum and ultra clean facilities to mass it. The only promise that can be made to the reader
produce silicon chips. is that changes are taking place and that the pace of
At this point it is important to point out that not all innovation is not slowing down.
physical problems have solutions that can be written
out in closed form. In fact, the majority do not. As The Role of Behavioral Science and Psychology
Stephen Wolfram, one of the guiding lights in the de- Should coders pay attention to their working envi-
velopment of the Mathematica package, points out, ronment, to what has been done in the past, and the
computer simulation is possible in principle even in obvious trade-off between hours spent on a project
the most complex systems. If one writes the basic laws and the time needed to meet the immediate need for
in local form, updating by small time increments, a solution? A coder working on a given project must
one can simulate numerically even the most complex decide which computer language to use and whether
systems. An interesting side effect was the develop- an existing program will work well enough, without
ment of chaos theory. It turned out that many math- giving away the advantage to a competitor. Copyright
ematical procedures are extremely sensitive to initial and proprietary information (trade secrets) may
conditions. With advances in computer graphics need protection. Articles on waterfall development
one could illustrate many special mathematical sets. or “worse is better” methodology provide a survey of
Fractal geometry and the Mandelbrot set became different program writing approaches. The involve-
popular computer related concepts. ment of psychological factors should not be underes-
The fifth generation is heralded as the advent timated. While there are stories of a few classic exam-
of true artificial intelligence. Prominent in this ples of short programs which can pass the Turing test
area are IBM and several Japanese semiconductor for a while, writing a program that displays anything
manufacturers whose methods of organization and that might be taken as intelligence is another matter.
governmental-industrial collaboration are novel to Currently a great many programs do not attempt in-
the traditional economies of Western Europe and telligent behavior overall but rather take on just one
North America. It is noteworthy that IBM, which was aspect of human performance and use the comput-
very slow to get on the microcomputer bandwagon, er’s capacity for expanded search, communications,
has again established a leadership position with its or reasoning to perform tasks without the limitations
Watson supercomputer. Following an initial launch, that humans bring to the problem.
Watson was pitted against human opponents playing An important open question is the extent to which
the televised game Jeopardy. Watson, a machine that computers should imitate the information processing
can learn from its mistakes, demonstrated its power, found in nature. Should one write computer codes
and the machine was turned loose on the world’s for a highly distributed processor like a neural net-
cancer literature. A variety of promising new thera- work or for more deterministic computer, perhaps
pies have their origin in Watson’s work in the field. using random number generation to provide a mea-
sure of independence? Genetic algorithms, in which
What Is To Be Found in this Book? a trial solution is revised repeatedly by a process that
This book presents over 140 articles on various as- resembles biological evolution, are but one example
pects of coding and programming. The articles range of a “biological” approach to computation.
from the strictly technical to general discussions of
human psychology. Not all are free from controversy. Economic Transitions
Nor will reading of all the articles make one an expert One of the most significant changes involves the
on any branch of computer science. Nonetheless, the matter of who will pay for the research that will lead
articles provide a snapshot of the current state of this to new advances. Without a sense of history, one
rapidly changing field of human endeavor, one so may be alarmed at cuts in government funding for
rapidly changing that a bright high school student’s research. The current situation is mainly a product
contribution may have more impact than that of a of the Second World War and the nuclear arms
Ph.D. Indeed, many of the most successful workers race. Indeed, twentieth century history might have

xi
Editor’s Introduction Principles of Programming & Coding

turned out differently had not one man, Albert languages are needed, so that the available memory
Einstein sent the now famous telegram to President is adequate for the system.
Franklin Roosevelt and the U. S. Army identified a
charismatic leader, Dr. J. Robert Oppenheimer, to Following Biology
direct a massive, but secret operation. Interestingly A significant amount of effort is now devoted to mod-
Alan Turing was active in war research for the eling mental processes with the computer. In 1943
British government at the same time, trying to Warren McCulloch, associated with the psychiatry
crack the German’s Enigma code. Both Turing and department at the University of Illinois, published
Oppenheimer were somewhat suspect to the secu- an article in the Bulletin of Mathematical Biophysics
rity officials of the time and needed friends in high entitled “A logical calculus of the ideas Immanent in
places to maintain their position. Today the key fig- Nervous Activity. This paper proposed that the basic
ures may well be Bill Gates and Steve Jobs (who pub- logical functions could be modeled by individual
licly who publicly acknowledged Oppenheimer as a nerve cells with thresholds. This was the beginning
role model) and the most intense battles are fought of trying to understand what actually happens in the
not using conventional or nuclear weapons but in brain. Of course, neural processes involve many real
the stock market indices. neurons and the first neural nets were greatly over-
The role of the American government is sup- simplified but investigations in this field continue.
porting marvels such as the Hubble Telescope and
the human genome project is undeniable, but it is Human Psychology, Perception, and Sensory
noteworthy that much of the research has been paid Physics
for by private companies. No longer is it a certainty Psychophysics Is the term used to describe the physics
that Nobel prizes will be awarded to academics or of human sensation, a field begun nearly a century
members of national research centers. The Nobel ago by Ernst Mach. Every attribute of the visual or
Prize for 2003 was awarded to Kary Mullis of Cetus sonic output of a computer has its corresponding
Corporation for his work on the polymerase chain re- human sensation. Thus frequency, amplitude, and
action, an essential tool in DNA fingerprinting and harmonic mixture describe the sensations of sound
the Human Genome Project. Even in area tradition- we perceive as pitch, loudness, and timbre, while a
ally left to governmental initiatives, like space explo- far more complex description is needed for vision.
ration, one finds private companies and government- Even the chemical senses (taste and smell) are liable
industry collaborations playing an increasing role. to computer analysis.

The Internet Computer Games


Upgrading the speed at which postal mail travels has Last, but far from least, is the matter of computer
been a goal of communications technology since the games and alternative realities. While the advent of
invention of the telegraph. The first advances meant the personal computer brought the arcade into the
that if one had a wired connection between two home with video games such as Pac Man and Ping
places, one could communicate by telegraph. The Pong, game designers took an interest in physics-like
next step was to transmit voice, and then the tele- simulations, which had an appeal to slightly older
phone was invented. The discovery of radio transmis- players. While accurate simulations of spaceflight
sion came next, followed within a couple of decades were much too slow to make for an exciting game,
by television. The transmission of images was made a number of approximate computational schemes
possible by the facsimile machine. Now the process made it possible to see believable results on a com-
is very inexpensive and people can meet “face-to- puter screen. Increasingly realistic simulations are
face” over long distances, even around the globe, now included in astronaut training. The frontier of
using Skype or similar group meeting software. The gaming has attracted talented programmers respon-
internet has to some extent replaced the need for sible for both realistic simulations and pure fantasies
microcomputers since it is accessible on portable that have gained legions of fans who are waiting for
cell phones and other small hand-held devices. With the next advance.
smaller hand-held devices a variety of computer ——Donald R. Franceschetti, PhD

xii
Principles of Programming & Coding Editor’s Introduction

For Further Reading: 2013, www.byte-notes.com/five-generations-com-


Dyson, George. Turing’s Cathedral: The Origins of the puters.
Digital Universe. London: Penguin Books, 2013. Print. Whitson, G. M. “Artifical Intelligence.” Applied
Feigenbaum, Edward Albert., and Julian Feldman. Science, edited by Donald R. Franceschetti, Salem
Computers and Thought. AAAI Press, 1995. Press, a Division of EBSCO Information Services,
Franklin, Stan. Artificial Minds. MIT Press, 2001. Inc., 2012, pp. 121–127.
Khan, Jawad. “Five Generations of Computers.” Byte- Winston, Patrick H. Artificial Intelligence. Reading,
Notes | Computer Science Learning Platform, 31 Aug. Mass. Addison-Wesley, 1999. Print.

xiii
Contributors

Andrew Farrell, MLIS Leon James Bynum, MA


Andrew Hoelscher, MEng Lisa U. Phillips, MFA
Lindsay Rohland Luke E. A. Lockhart
Céleste Codington-Lacerte Mariam Orkodashvili, PhD
Christopher Rager, MA Marjee Chmiel, MA, PhD
Daniel Horowitz Mary Woodbury Hooper
Daniel L. Berek, MA, MAT Maura Valentino, MSLIS
Elizabeth Rholetter Purdy, MA, PhD Maura Valentino, MSLIS
Gavin D. J. Harper, MSc, MIET Melvin O
Hitaf R. Kady, MA Micah L. Issitt
Isaiah Flair, MA Mitzi P. Trahan, MA, PhD
Jennifer A. Vadeboncoeur, MA, PhD Narissra Maria Punyanunt-Carter, MA, PhD
Jerry Johnson Patricia Hoffman-Miller, MPA, PhD
Joel Christophel Randa Tantawi, PhD
Daniel Showalter, PhD Richard De Veaux
John Mark Froiland, PhD Robert N. Stacy, CSS, MA
John Vines Robert N. Stacy, MA
John Walsh, PhD Sarah E. Boslaugh, PhD, MPH
Joseph Dewey, PhD Scott Zimmer, JD
Joshua Miller Shari Parsons Miller, MA
Joy Crelin Steven Miller
Julia Gilstein Susan R. Adams, MA, PhD
Kehley Coviello Teresa E. Schmidt
Kenrick Vezina, MS Trevor Cunnington, MA, PhD
Laura L. Lundin, MA

xv
3D PRINTING
FIELDS OF STUDY also called machining. In machining, material is re-
moved from a starting sample until the desired struc-
Computer Science; Digital Media
ture remains. Most AM processes use less raw mate-
rial and are therefore less wasteful than machining.
ABSTRACT The first AM process was developed in the 1980s,
Additive manufacturing (AM), or 3D printing, com- using liquid resin hardened by ultraviolet (UV) light.
prises several automated processes for building three- By the 2000s, several different AM processes had
dimensional objects from layers of plastic, paper, been developed. Most of these processes use liquid,
glass, or metal. AM creates strong, light 3D objects powder, or extrusion techniques. Combined with
quickly and efficiently. complex computer modeling and robotics, AM could
launch a new era in manufacture. Soon even com-
PRINCIPAL TERMS plex mechanical objects could be created by AM.

ƒƒ binder jetting: the use of a liquid binding agent to Software and Modeling
fuse layers of powder together. 3D printing begins with a computer-aided design
ƒƒ directed energy deposition: a process that deposits (CAD) drawing or 3D scan of an object. These draw-
wire or powdered material onto an object and then ings or scans are usually saved in a digital file format
melts it using a laser, electron beam, or plasma arc. known as STL, originally short for “stereolithog-
ƒƒ material extrusion: a process in which heated fila- raphy” but since given other meanings, such as “sur-
ment is extruded through a nozzle and deposited face tessellation language.” STL files “tessellate” the
in layers, usually around a removable support. object—that is, cover its surface in a repeated pattern
ƒƒ material jetting: a process in which drops of liquid of shapes. Though any shape can be used, STL files
photopolymer are deposited through a printer use a series of non-overlapping triangles to model the
head and heated to form a dry, stable solid. curves and angles of a 3D object. Errors in the file
ƒƒ powder bed fusion: the use of a laser to heat layers may need repair. “Slices” of the STL file determine
of powdered material in a movable powder bed. the number and thickness of the layers of material
ƒƒ sheet lamination: a process in which thin layered needed.
sheets of material are adhered or fused together
and then extra material is removed with cutting Liquid 3D Printing
implements or lasers. The earliest AM technique was stereolithography
ƒƒ vat photopolymerization: a process in which a laser (SLA), patented in 1986 by Chuck Hull. SLA uses
hardens layers of light-sensitive material in a vat. liquid resin or polymer hardened by UV light to
create a 3D object. A basic SLA printer consists of
Additive Manufacturing an elevator platform suspended in a tank filled with
3D printing, also called additive manufacturing light-sensitive liquid polymer. A UV laser hardens a
(AM), builds three-dimensional objects by adding thin layer of resin. The platform is lowered, and the
successive layers of material onto a platform. AM dif- laser hardens the next layer, fusing it to the first. This
fers from traditional, or subtractive, manufacturing, process is repeated until the object is complete. The
1
3D printing Principles of Programming & Coding

FDM Process SLA Process

Scanning system
Liquifier head Laser
(moves in x
and y direction)
Supports
Extrusion
nozzles Recoater blade
Foam
slab Supports

Build platform
Support
(moves in
material spool
z direction) Liquid Photopolymer Resin
Build
material spool
Platform

SLS Process

Scanning system
CO2 laser

Temperature-controlled
build chamber with
nitrogen atmosphere
Powder bed on
Powder-leveling roller
build piston

Excess powder
Powder takeup
feed

This presents a comparison of the three common 3-D printing processes: SLA (in which liquid polymer resin is solidified by a laser and sup-
port material is removed after completion), SLS (in which powder is fused by a CO2 laser and unfused powder acts as support), and FDM
(in which liquid modeling material is extruded through extrusion nozzles and solidifies quickly, and a build material and a support material
can be used in tandem, with the support material being removed after completion) .

2
Principles of Programming & Coding 3D printing

object is then cleaned and cured by UV. This AM metal, or plastic with adhesive. The resulting object
technique is also called vat photopolymerization is then cut with a laser or other cutting tool to refine
because it takes place within a vat of liquid resin. the shape. This method is less costly but also less ac-
Various types of SLA printing processes have been curate than others.
given alternate names, such as “photofabrication”
and “photo-solidification.”
The Future of 3D Printing
Powder-Based 3D Printing While AM techniques have been in use since the
In the 1980s, engineers at the University of Texas cre- 1980s, engineers believe that the technology has
ated an alternate process that uses powdered solids not yet reached its full potential. Its primary use has
instead of liquid. Selective layer sintering (SLS), or been in rapid prototyping, in which a 3D printer is
powder bed fusion, heats powdered glass, metal, ce- used to quickly create a 3D model that can be used
ramic, or plastic in a powder bed until the material to guide production. In many cases, 3D printing
is “sintered.” To sinter something is to cause its par- can create objects that are stronger, lighter, and
ticles to fuse through heat or pressure without lique- more customizable than objects made through
fying it. A laser is used to selectively sinter thin layers machining. Printed parts are already being used
of the powder, with the unfused powder underneath for planes, race cars, medical implants, and dental
giving structural support. The platform is lowered crowns, among other items. Because AM wastes far
and the powder compacted as the laser passes over less material than subtractive manufacturing, it is of
the object again. interest for conservation, waste management, and
cost reduction. The technology could also democra-
Extrusion Printing tize manufacturing, as small-scale 3D printers allow
Material extrusion printing heats plastic or polymer individuals and small businesses to create products
filament and extrudes it through nozzles to deposit a that traditionally require industrial manufacturing
layer of material on a platform. One example of this facilities. However, intellectual property disputes
process is called fused deposition modeling (FDM). could also occur more often as AM use becomes
As the material cools, the platform is lowered and more widespread.
another layer is added atop the last layer. Creating —Micah L. Issitt
extruded models often requires the use of a struc-
tural support to prevent the object from collapsing.
Extrusion printing is the most affordable and com- Bibliography
monly available 3D printing process. “About Additive Manufacturing.” Additive
Manufacturing Research Group. Loughborough U,
Emerging and Alternative Methods 2015. Web. 6 Jan. 2016.
Several other 3D printing methods are also emerging. Hutchinson, Lee. “Home 3D Printers Take Us on a
In material jetting, an inkjet printer head deposits Maddening Journey into Another Dimension.” Ars
liquefied plastic or other light-sensitive material onto Technica. Condé Nast, 27 Aug. 2013. Web. 6 Jan. 2016.
a surface, which is then hardened with UV light. “Knowledge Base: Technologies in 3D Printing.”
Another inkjet printing technique is binder jetting, DesignTech. DesignTech Systems, n.d. Web. 6 Jan. 2016.
which uses an inkjet printer head to deposit drops Matulka, Rebecca. “How 3D Printers Work.” Energy.
of glue-like liquid into a powdered medium. The gov. Dept. of Energy, 19 June 2014. Web. 6 Jan. 2016.
liquid then soaks into and solidifies the medium. “The Printed World.” Economist. Economist
In directed energy deposition (DED), metal wire or Newspaper, 10 Feb. 2011. Web. 6 Jan. 2016.
powder is deposited in thin layers over a support be- “3D Printing Processes: The Free Beginner’s Guide.”
fore being melted with a laser or other heat source. 3D Printing Industry. 3D Printing Industry, 2015.
Sheet lamination fuses together thin sheets of paper, Web. 6 Jan. 2016.

3
A
ALGORITHMS
FIELDS OF STUDY has been celebrated around the world as a pioneer of
mathematics and conceptual problem solving.
Computer Science; Operating Systems; Software
“Algorithm” has no precise definition. Broadly,
Engineering
it refers to a finite set of instructions, arranged in a
specific order and described in a specific language,
ABSTRACT
for solving a problem. In other words, an algorithm is
An algorithm is set of precise, computable instruc- like a plan or a map that tells a person or a machine
tions that, when executed in the correct order, will what steps to take to complete a given task.
provide a solution to a certain problem. Algorithms
are widely used in mathematics and engineering,
Algorithm Basics
and understanding the design of algorithms is funda-
In computer science, an algorithm is a series of in-
mental to computer science.
structions that tells a computer to perform a certain
function, such as sorting, calculating, or finding data.
PRINCIPAL TERMS
Each step in the instructions causes the computer to
ƒƒ deterministic algorithm: an algorithm that when transition from one state to another until it reaches
given a input will always produce the same output. the desired end state.
ƒƒ distributed algorithm: an algorithm designed to Any procedure that takes a certain set of inputs (a
run across multiple processing centers and so, ca- data list, numbers, information, etc.) and reaches a
pable of directing a concentrated action between desired goal (finding a specific datum, sorting the
several computer systems. list, etc.) is an algorithm. However, not all algorithms
ƒƒ DRAKON chart: a flowchart used to model algo- are equal. Algorithms can be evaluated for “ele-
rithms and programmed in the hybrid DRAKON gance,” which measures the simplicity of the coding.
computer language. An elegant algorithm is one that takes a minimum
ƒƒ function: instructions read by a computer’s pro- number of steps to complete. Algorithms can also be
cessor to execute specific events or operations. evaluated in terms of “goodness,” which measures the
ƒƒ recursive: describes a method for problem solving speed with which an algorithm reaches completion.
that involves solving multiple smaller instances of Algorithms can be described in a number of ways.
the central problem. Flowcharts are often used to visualize and map the
ƒƒ state: a technical term for all the stored informa- steps of an algorithm. The DRAKON computer lan-
tion, and the configuration thereof, that a pro- guage, developed in the 1980s, allows users to pro-
gram or circuit can access at a given time. gram algorithms into a computer by creating a flow-
chart that shows the steps of each algorithm. Such a
An Ancient Idea flowchart is sometimes called a DRAKON chart.
The term “algorithm” is derived from the name al- Algorithms often specify conditional processes
Khwarizmi. Muhammad ibn Musa al-Khwarizmi was a that occur only when a certain condition has been
ninth-century Persian mathematician who is credited met. For instance, an algorithm about eating lunch
with introducing the decimal system to the West. He might begin with the question, “Are you hungry?”

4
Principles of Programming & Coding Algorithms

If the answer is “yes,” the algorithm will instruct the


user to eat a sandwich. It will then ask again if the Lamp isn’t working
user is hungry. If the answer is still yes, the “eat a
sandwich” instruction will be repeated. If the answer
is “no,” the algorithm will instruct the user to stop
eating sandwiches. In this example, the algorithm re-
peats the “eat a sandwich” step until the condition
“not hungry” is reached, at which point the algo- Is the lamp No
rithm ends. plugged in? Plug in the lamp

Types of Algorithms
Various types of algorithms take different approaches
to solving problems. An iterative algorithm is a simple Yes
form of algorithm that repeats the same exact steps
in the same way until the desired result is obtained.
A recursive algorithm attempts to solve a problem by
completing smaller instances of the same problem. Is the bulb Yes
One example of a recursive algorithm is called a “di- burned out? Replace the bulb
vide and conquer” algorithm. This type of algorithm
addresses a complex problem by solving less complex
examples of the same problem and then combining
the results to estimate the correct solution. No
Algorithms can also be serialized, meaning that
the algorithm tells the computer to execute one in-
struction at a time in a specific order. Other types Buy a new lamp
of algorithms may specify that certain instructions
should be executed simultaneously. Distributed algo-
An algorithm is a set of operations or a procedure for solving a
rithms are an example of this type. Different parts of problem or processing data. Flowcharts are often used as a vi-
the algorithm are executed in multiple computers or sualization of the process, showing the order in which steps are
nodes at once and then combined. performed.
An algorithm may have a single, predetermined
output, or its output may vary based on factors other
than the input. Deterministic algorithms use exact, information on the Internet. The Google search en-
specific calculations at every step to reach an answer gine can search through vast amounts of data and rank
to a problem. A computer running a deterministic millions of search results in a specific order for dif-
algorithm will always proceed through the same se- ferent users. Sorting large lists of data was one of the
quence of states. Nondeterministic algorithms incor- earliest problems that computer scientists attempted
porate random data or “guessing” at some stage of to solve using algorithms. In the 1960s, the quicksort
the process. This allows such algorithms to be used algorithm was the most successful sorting algorithm.
as predictive or modeling tools, investigating prob- Using a random element from the list as a “pivot,”
lems for which specific data is lacking. In computa- quicksort tells the computer to pick other elements
tional biology, for instance, evolutionary algorithms from the list and compare them to the pivot. If the ele-
can be used to predict how populations will change ment is less than the pivot, it is placed above it; if it is
over time, given estimations of population levels, greater, it is placed below. The process is repeated until
breeding rates, and other environmental pressures. each pivot is in its proper place and the data is sorted
into a list. Computer scientists are still attempting to
Algorithm Applications find search and sorting algorithms that are more “el-
One of the most famous applications of algorithms egant” or “good” in terms of completing the function
is the creation of “search” programs used to find quickly and with the least demand on resources.

5
American Standard Code for Information Interchange (ASCII) Principles of Programming & Coding

Searching and sorting are the most famous examples Bell, Tim, et al. “Algorithms.” Computer Science Field
of algorithms. However, these are just two of the thou- Guide. U of Canterbury, 3 Feb. 2015. Web. 19 Jan.
sands of algorithm applications that computer scientists 2016.
have developed. The study of algorithm design has be- Cormen, Thomas H. Algorithms Unlocked. Cambridge:
come a thriving subfield within computer science. MIT P, 2013. Print.
Cormen, Thomas H., et al. Introduction to Algorithms.
—Micah L. Issitt
3rd ed. Cambridge: MIT P, 2009. Print.
“Intro to Algorithms.” Khan Academy. Khan Acad.,
Bibliography 2015. Web. 19 Jan. 2016.
Anthes, Gary. “Back to Basics: Algorithms.” Toal, Ray. “Algorithms and Data Structures.” Ray
Computerworld. Computerworld, 24 Mar. 2008. Toal. Loyola Marymount U, n.d. Web. 19 Jan. 2016.
Web. 19 Jan. 2016.

AMERICAN STANDARD CODE FOR INFORMATION


INTERCHANGE (ASCII)
FIELDS OF STUDY ƒƒ printable characters: characters that can be
written, printed, or displayed in a manner that can
Computer Science; Computer Engineering
be read by a human.

ABSTRACT Understanding Character Encoding


The American Standard Code for Information Written language, or text, is composed of a variety
Interchange (ASCII) is a character encoding system. of graphic symbols called characters. In many lan-
It enables computers and other electronic communi- guages, these characters include letters, numbers,
cation devices to store, process, transmit, print, and punctuation marks, and blank spaces. Such charac-
display text and other graphic characters. Initially ters are also called printable characters because they
published in 1963, ASCII formed the basis for several can be printed or otherwise displayed in a form that
other character encoding systems developed for use can be read by humans. Another type of character is
with PCs and the Internet. a control character. Control characters effect the pro-
cessing of other characters. For example, a control
character might instruct a printer to print the next
PRINCIPAL TERMS
character on a new line. Character encoding is the
ƒƒ bit width: the number of bits used by a computer process of converting characters into a format that
or other device to store integer values or other can be used by an electronic device such as a com-
data. puter or telegraph.
ƒƒ character: a unit of information that represents Originally designed for use with Samuel Morse’s
a single letter, number, punctuation mark, blank telegraph system, Morse code was one of the first
space, or other symbol used in written language. character encoding schemes adopted for widespread
ƒƒ control characters: units of information used to use. Telegraphs transmit information by sending elec-
control the manner in which computers and other tronic pulses over telegraph wires. Morse code assigns
devices process text and other characters. each character to a unique combination of short and
ƒƒ hamming distance: a measurement of the differ- long pulses. For example, the letter A was assigned to
ence between two characters or control characters the combination of one short followed by one long
that effects character processing, error detection, pulse, while the letter T was assigned to a single long
and error correction. pulse. Using Morse code, a telegraph operator can

6
Principles of Programming & Coding American Standard Code for Information Interchange (ASCII)

This chart presents the decimal and hexidecimal ASCII codes for common characters on a keyboard.

send messages by transmitting a sequence of pulses. The encoded integers are then converted to bits,
The sequence, or string, of pulses represents the the smallest unit of data that can be stored by a com-
characters that comprise the message text. puter system. A single bit can have a value of either
Other character encoding systems were created zero or one. In order to store integers larger than
to meet the needs of new types of electronic devices one, additional bits must be used. The number of
including teleprinters and computers. By the early bits used to store a value is called the bit width. ASCII
1960s, the use of character encoding systems had specifies a bit width of seven. For example, in ASCII,
become widespread. However, no standard char- the integer value 65 is stored using seven bits, which
acter encoding system existed to ensure that systems can be represented as the bit string 1000001.
from different manufacturers could communicate The ASCII seven-bit integer values for specific
with each other. In fact, by 1963, over sixty different characters were not randomly assigned. Rather, the
encoding systems were in use. Nine different sys- integer values of specific characters were selected to
tems were used by IBM alone. To address this issue, maximize the hamming distance between each value.
the American Standards Association (ASA) X3.4 Hamming distance is the number of bits set to dif-
Committee developed a standardized character en- ferent values when comparing two bit strings. For ex-
coding scheme called ASCII. ample, the bit strings 0000001 (decimal value 1) and
0000011 (decimal value 3) have a hamming distance
Understanding the ASCII Standard of 1 as only the second to last bit differs between the
The ASCII standard is based on English. It encodes two strings. The bit patterns 0000111 (decimal value
128 characters into integer values from 0 to 127. 7) and 0000001 (decimal value 1) have a hamming
Thirty-three of the characters are control charac- distance of two as the bit in the third to last posi-
ters, and ninety-five are printable characters that in- tion also differs between the two strings. ASCII was
clude the upper- and lowercase letters from A to Z, designed to maximize hamming distance because
the numbers zero to nine, punctuation marks, and a larger hamming distances enable more efficient data
blank space. For example, the letter A is encoded as processing as well as improved error detection and
65 and a comma as 44. handling.

7
Android OS Principles of Programming & Coding

grew, other standards were developed to meet this


SAMPLE PROBLEM need. One such standard, Unicode can encode
more than 120,000 characters. ASCII remains an im-
ASCII defines the integer values for the first portant technology, however. Many systems still use
eleven lowercase letters of the alphabet as ASCII. Character encoding systems such as Unicode
follows: incorporate ASCII to promote compatibility with ex-
a = 97; b = 98; c = 99; d = 100; e = 101; f = 102; isting systems.
g = 103; h = 104; i = 105; j = 106; k = 107 —Maura Valentino, MSLIS
Using this information, translate the word
hijack to the correct ASCII integer values.
Bibliography
Answer: Amer. Standards Assn. American Standard Code for
Information Interchange. Amer. Standards Assn., 17
The ASCII representation of the word hijack
June 1963. Digital file.
can be determined by comparing each
Anderson, Deborah. “Global Linguistic Diversity
character in the word to its defined decimal
for the Internet.” Communications of the ACM Jan.
value as follows:
2005: 27. PDF file.
h i j a   c   k
Fischer, Eric. The Evolution of Character Codes, 1874–
h (104) i (105) j (106) a (97)  c (99) k (107)
1968. N.p.: Fischer, n.d. Trafficways.org. Web. 22
104 105 106 97 99 107
Feb. 2016.
The correct ASCII encoding for the word Jennings, Tom. “An Annotated History of Some
hijack is 104 105 106 97 99 107. Character Codes.” World Power Systems. Tom
Jennings, 29 Oct. 2004. Web. 16 Feb. 2016.
McConnell, Robert, James Haynes, and Richard
Warren. “Understanding ASCII Codes.”
Beyond ASCII NADCOMM. NADCOMM, 14 May 2011. Web. 16
Following its introduction in 1963, ASCII continued Feb. 2016.
to be refined. It was gradually adopted for use on a Silver, H. Ward. “Digital Code Basics.” Qst 98.8
wide range of computer systems including the first (2014): 58–59. PDF file.
IBM PC. Other manufacturers soon followed IBM’s “Timeline of Computer History: 1963.” Computer
lead. The ASCII standard was also widely adopted for History Museum. Computer History Museum, 1
use on the Internet. However, as the need for more May 2015. Web. 23 Feb. 2016.
characters to support languages other than English

ANDROID OS
FIELDS OF STUDY PRINCIPAL TERMS
Computer Science; Operating Systems; Mobile ƒƒ application program interface (API): the code
Platforms that defines how two pieces of software interact,
particularly a software application and the oper-
ating system on which it runs.
ABSTRACT
ƒƒ immersive mode: a full-screen mode in which the
This article briefly discusses the general issues in- status and navigation bars are hidden from view
volved with mobile computing and presents a history when not in use.
and analysis of Google’s Android operating system. ƒƒ Material Design: a comprehensive guide for visual,
It concludes with a look at Android’s future in the motion, and interaction design across Google plat-
growing market for mobile technology. forms and devices.

8
Principles of Programming & Coding Android OS

ƒƒ multitasking: in the mobile phone environment,


allowing different apps to run concurrently, much
like the ability to work in multiple open windows
on a PC.
ƒƒ multitouch gestures: touch-screen technology that
allows for different gestures to trigger the behavior
of installed software.

A Force in Mobile Computing


Mobile computing is the fastest-growing segment of
the tech market. As pricing has become more afford-
able, developing nations, particularly in Africa, are
the largest growing market for smartphones. With
smartphones, users shop, gather information, con-
nect via social media such as Twitter and Facebook,
and communicate—one of the uses more tradition-
ally associated with phones.
By far the most popular operation system run-
ning on mobile phones is Android. It has outpaced
Apple’s iOS with nearly double the sales. As of 2014,
more than a million Android devices were being acti-
vated daily. Since its launch in 2008, Android has far
and away overtaken the competition.

Android Takes Off


Android came about amid a transformative moment
in mobile technology. Prior to 2007, slide-out key-
boards mimicked the typing experience of desktop The swype keyboard, originally designed for Android operating
PCs. In June of that year, Apple released its first systems, was developed to speed up typing capabilities by allowing
iPhone, forever altering the landscape of mobile the user to slide a finger over the keyboard from letter to letter
without lifting their finger to choose each character. This standard
phones. Apple focused on multitouch gestures and software in the Android operating system allows for quick texting.
touch-screen technology. Nearly concurrent with
this, Google’s Android released its first application
program interface (API). widgets, and strong integration with Google’s Gmail
The original API of Google’s new operating service.
system (OS) first appeared in October 2008. The One later feature, the full-screen immersive mode,
Android OS was first installed on the T-Mobile G1, has become quite popular as it reduces distractions.
also known as the HTC Dream. This prototype had First released with Android 4.4, “KitKat,” in 2013, it
a very small set of preinstalled apps, and as it had a hides the navigation and status bars while certain
slide-out QWERTY keyboard, there were no touch- apps are in use. It was retained for the release of
screen capabilities. It did have native multitasking, Android 5.0, “Lollipop,” in 2015.
which Apple’s iOS did not yet have. Still, to compete
with Apple, Google was forced to replace physical Android Changes and Grows
keyboards and access buttons with virtual onscreen Both of Google’s operating systems—Android and
controls. The next iteration of Android shipped with its cloud-based desktop OS, Chrome—are based
the HTC Magic and was accompanied by a virtual key- on the free open-source OS Linux, created by en-
board and a more robust app marketplace. Among gineer Linus Torvalds and first released in 1991.
the other early features that have stood the test of Open-source software is created using publicly avail-
time are the pull-down notification list, home-screen able source code. The open-source development of

9
Android OS Principles of Programming & Coding

Android has allowed manufacturers to produce ro- to keep the two separate. Further, Google execu-
bust, affordable products that contribute to its wide- tives have made it clear that Chromebooks (laptops
spread popularity in emerging and developing mar- that run Chrome) and Android devices have distinct
kets. This may be one reason why Android has had purposes. Android’s focus has been on touch-screen
more than twice as many new users as its closest rival, technology, multitouch gesturing, and screen resolu-
Apple’s iOS. This strategy has kept costs down and tion, making it a purely mobile OS for phones, tab-
has also helped build Android’s app marketplace, lets, and more recently wearable devices and TVs.
which offers more than one million native apps, Meanwhile, Chrome has developed tools that are
many free of charge. By 2014 Android made up 54 more useful in the PC and laptop environment, such
percent of the global smartphone market. as keyboard shortcuts. However, an effort to unify the
This open-source development of Android has appearance and functionality of Google’s different
had one adverse effect: the phenomenon known as platforms and devices called Material Design was in-
“forking,” which occurs primarily in China. Forking troduced in 2014. Further, Google has ensured that
is when a private company takes the OS and creates Android apps can be executed on Chrome through
their own products apart from native Google services Apps Runtime on Chrome (ARC). Such implemen-
such as e-mail. Google seeks to prevent this loss of tations suggest a slow merging of the Android and
control (and revenue) by not supporting these com- Chrome user experiences.
panies or including their apps in its marketplace.
—Andrew Farrell, MLIS
Forked versions of Android made up nearly a quarter
of the global market in early 2014.
Google’s business model has always focused on a Bibliography
“rapid-iteration, web-style update cycle.” By contrast, Amadeo, Ron. “The History of Android.” Ars Technica.
rivals such as Microsoft and Apple have had a far Condé Nast, 15 June 2014. Web. 2 Jan. 2016.
slower, more deliberate pace due to hardware issues. “Android: A Visual History.” Verge. Vox Media, 7 Dec.
One benefit of Google’s faster approach is the ability 2011. Web. 2 Jan. 2016.
to address issues and problems in a timely manner. A Bajarin, Tim. “Google Is at a Major Crossroads with
drawback is the phenomenon known as “cloud rot.” Android and Chrome OS.” PCMag. Ziff Davis, 21
As the cloud-based OS grows older, servers that were Dec. 2015. Web. 4 Jan. 2016.
once devoted to earlier versions are repurposed. Edwards, Jim. “Proof That Android Really Is for the
Since changes to the OS initially came every few Poor.” Business Insider. Business Insider, 27 June
months, apps that worked a month prior would sud- 2014. Web. 4 Jan. 2016.
denly lose functionality or become completely unus- Goldsborough, Reid. “Android on the Rise.” Tech
able. Later Android updates have been released on a Directions May 2014: 12. Academic Search Complete.
timescale of six months or more. Web. 2 Jan. 2016.
Manjoo, Farhad. “Planet Android’s Shaky Orbit.” New
Android’s Future York Times 28 May 2015: B1. Print.
In 2014 alone, more than one billion devices using Newman, Jared. “Android Laptops: The $200 Price
Android were activated. One of the biggest concerns Is Right, but the OS May Not Be.” PCWorld. IDG
about Android’s future is the issue of forking. Making Consumer & SMB, 26 Apr. 2013. Web. 27 Jan.
the code available to developers at no cost has made 2016.
Android a desirable and cost-effective alternative to Newman, Jared. “With Android Lollipop, Mobile
higher-end makers such as Microsoft and Apple, but Multitasking Takes a Great Leap Forward.” Fast
it has also made Google a target of competitors. Company. Mansueto Ventures, 6 Nov. 2014. Web.
Another consideration for Android’s future is its 27 Jan. 2016.
inextricable link to the Chrome OS. Google plans

10
Principles of Programming & Coding Application

APPLICATION
FIELDS OF STUDY versions of an application to run on different plat-
forms. A cross-platform application is one that can be
Applications; Software Engineering
run on more than one platform.
In the context of mobile devices such as tablets and
ABSTRACT
smartphones, the term “application” is typically short-
In the field of information technology, an application ened to app. Since the introduction of the iPhone in
is a piece of software created to perform a task, such 2007, apps have taken center stage in the realm of
as word processing, web browsing, or chess playing. consumer electronics. Previously, consumers tended
Each application is designed to run on a particular to be attracted more to a device’s hardware or OS fea-
platform, which is a type of system software that is tures. A consumer might have liked a certain phone
installed on desktop computers, laptops, or mobile for its solid design or fast processor, or they might
devices such as tablet computers or smartphones. have preferred the graphical interface of Microsoft
Windows and Mac OS to the command-line interface
PRINCIPAL TERMS of Linux. These features have since become much
less of a concern for the average consumer. Instead,
ƒƒ app: an abbreviation for “application,” a program consumers tend to be more interested in finding a
designed to perform a particular task on a com- device that supports the specific apps they wish to use.
puter or mobile device.
ƒƒ application suite: a set of programs designed to Evolution of Applications
work closely together, such as an office suite that Over the years, apps have become more and more
includes a word processor, spreadsheet, presenta- specialized. Even basic utility programs that were
tion creator, and database application. once included with OSs are now available for pur-
ƒƒ platform: the specific hardware or software infra- chase as separate apps. In some cases, these apps are
structure that underlies a computer system; often a more advanced version of the utility software that
refers to an operating system, such as Windows, comes with the OS. For example, an OS may come
Mac OS, or Linux. with free antivirus software, but a user may choose
ƒƒ system software: the basic software that manages to purchase a different program that offers better
the computer’s resources for use by hardware and protection.
other software. Some software companies offer application suites
ƒƒ utility program: a type of system software that per- of interoperating programs. Adobe Creative Cloud is
forms one or more routine functions, such as disk a cloud-based graphic design suite that includes pop-
partitioning and maintenance, software installa- ular design and editing programs such as Photoshop
tion and removal, or virus protection. and InDesign. Microsoft Office is an office suite con-
ƒƒ web application: an application that is down- sisting of a word processor (Word), a spreadsheet
loaded either wholly or in part from the Internet program (Excel), and other applications commonly
each time it is used. used in office settings. These programs are expensive
and can take up large amounts of storage space on a
Applications in Context user’s computer. Before broadband Internet access
Applications are software programs that perform became widely available, application suites were dis-
particular tasks, such as word processing or web tributed on portable media such as floppy disks, CD-
browsing. They are designed to run on one or more ROMs, or DVDs, because downloading them over a
specific platforms. The term “platform” can refer dial-up connection would have taken too long.
to any basic computer infrastructure, including the As high-speed Internet access has become much
hardware itself and the operating system (OS) that more common, application developers have taken a
manages it. An OS is a type of system software that different approach. Instead of investing in bulky ap-
manages a device’s hardware and other software re- plication suites, users often have the option of using
sources. Application designers may create different web applications. These applications run partly or

11
Application Principles of Programming & Coding

COMPUTER HARDWARE

Debugger
File Mgmt
Operating Tools
System SYSTEMS
Utilities SOFTWARE
Compilers
Assembler
Games
Graphics
Communications

Word
Processing
Databases
APPLICATIONS
SOFTWARE

Spreadsheets

The variety and quantity of application software available is massive compared to the limited array of system software and hardware that
support them.

12
Principles of Programming & Coding Application

entirely on remote servers, avoiding the need to in- its privileges to make the computer behave in ways
stall them on the computer’s hard drive. it should not. For example, the attacker could send
spam e-mails, host illegally shared files, or even
Types of Applications launch additional attacks against other computers on
Many different types of software fall under the broad the same network.
heading of applications. A large segment of the ap-
plication market is focused on office and productivity Careers in Applications
software. This category includes e-mail applications, Applications are the focus of a variety of career op-
word processors, spreadsheet software, presentation tions for those interested in working with software.
software, and database management systems. In an Apart from the obvious role of computer pro-
office environment, it is critical that users be able to grammer, there are several other paths one might
create documents using these applications and share take. One option is quality assurance. Quality assur-
them with others. This often means that a business or ance staff are responsible for testing software under
organization will select a particular application suite development to make sure it performs as it should.
and then require all employees to use it. Technical support is another option. Technical sup-
Other types of applications include games, audio- port specialists assist users with operating the software
video editing and production software, and even and fixing errors it might cause. Yet another path is
software that helps programmers write new soft- technical writing. Technical writers create software
ware. Due the complexity of software engineering, user manuals and training materials. Finally, some
programmers have developed many applications to applications are so complex that using them can be a
help them produce more polished, bug-free pro- career in itself.
grams. Software developers may use multiple appli- —Scott Zimmer, JD
cations to code a single program. They might use
a word processor or text editor to write the source
code and explanatory comments, a debugging Bibliography
tool to check the code for errors, and a compiler Bell, Tom. Programming: A Primer; Coding for Beginners.
to convert the code into machine language that a London: Imperial Coll. P, 2016. Print.
computer can execute. There is even a type of ap- Calude, Cristian S., ed. The Human Face of Computing.
plication that can emulate a virtual computer run- London: Imperial Coll. P, 2016. Print.
ning inside another computer. These applications Dey, Pradip, and Manas Ghosh. Computer Fundamentals
are often used by web-hosting companies. Instead of and Programming in C. 2nd ed. New Delhi: Oxford
having to set up a new physical server for each cus- UP, 2013. Print.
tomer that signs up, they can create another virtual Goriunova, Olga, ed. Fun and Software: Exploring
server for the user to access. Pleasure, Paradox, and Pain in Computing. New York:
Bloomsbury, 2014. Print.
Security Implications Neapolitan, Richard E. Foundations of Algorithms. 5th
Applications must have certain privileges in order ed. Burlington: Jones, 2015. Print.
to use the resources of the computer they are run- Talbot, James, and Justin McLean. Learning Android
ning on. As a result, they can sometimes be a point Application Programming: A Hands-On Guide to
of weakness for attackers to exploit. A clever attacker Building Android Applications. Upper Saddle River:
can take over a vulnerable application and then use Addison, 2014. Print.

13
Autonomic computing Principles of Programming & Coding

AUTONOMIC COMPUTING
FIELDS OF STUDY Self-Star Systems
The concept of autonomic computing is based on au-
Computer Science; Embedded Systems; System-Level
tonomic systems found in nature. Examples of such
Programming
systems include the autonomic nervous system of hu-
mans and the self-regulation of colonial insects such as
ABSTRACT
bees and ants. In an autonomic system, the behaviors
Autonomic computing is a subfield of computer sci- of individual components lead to higher-order self-
ence that focuses on enabling computers to operate maintenance properties of the group as a whole.
independently of user input. First articulated by IBM The properties that a system needs to function au-
in 2001, the concept has particular relevance to fields tonomically are often called self-star properties. One
such as robotics, artificial intelligence (AI), and ma- is self-management, meaning that the system can
chine learning. manage itself without outside input after an initial
setup. Computer scientists disagree about what other
PRINCIPAL TERMS self-star properties a system must have to be consid-
ered autonomic. Proposed properties include:
ƒƒ autonomic components: self-contained software
or hardware modules with an embedded capacity self-stabilization, the ability to return to a stable
for self-management, connected via input/out- state after a change in configuration;
puts to other components in the system. self-healing, the ability to recover from external
ƒƒ bootstrapping: a self-starting process in a com- damage or internal errors;
puter system, configured to automatically initiate self-organization, the ability to organize compo-
other processes after the booting process has been nent parts and processes toward a goal;
initiated. self-protection, the ability to combat external
ƒƒ multi-agent system: a system consisting of mul- threats to operation; and
tiple separate agents, either software or hardware self-optimization, the ability to manage all re-
systems, that can cooperate and organize to solve sources and components to optimize operation.
problems.
ƒƒ resource distribution: the locations of resources Autonomic systems may also display self-aware-
available to a computing system through various ness and self-learning. Self-awareness in a computer
software or hardware components or networked system differs from self-awareness in a biological
computer systems. system. In a computer system, self-awareness is better
ƒƒ self-star properties: a list of component and system defined as the system’s knowledge of its internal com-
properties required for a computing system to be ponents and configuration. Self-learning is the ability
classified as an autonomic system. to learn from experiences without a user program-
ming new information into the system.
Self-Managing Systems
Autonomic computing is a branch of computer Design of Autonomic Systems
science aimed at developing computers capable An autonomic computer system is typically envi-
of some autonomous operation. An autonomic sioned as having autonomic components (ACs),
system is one that is, in one or more respects, self- which are at least partly self-managing. An example
managing. Such systems are sometimes described of an AC is bootstrapping. Bootstrapping is the pro-
as “self-*” or “self-star.” The asterisk, or “star,” rep- cess by which a computer configures and initiates
resents different properties of autonomic systems various processes during start-up. After a user turns
(self-organization, self-maintenance). Autonomic on the computer, the bootstrapping process is self-
computing aims to develop systems that require managed. It proceeds through a self-diagnostic
less outside input, allowing users to focus on other check and then activates various hardware and soft-
activities. ware components.

14
Principles of Programming & Coding Autonomic computing

Self- Self-
Configuring Healing

Self- Self-
Optimizing Protecting

Basic Managed Predictive Adaptive Autonomic


Level 1 Level 2 Level 3 Level 4 Level 5

Self-
Configuring

Self- Self-
Healing Healing

Self- Self- Self-


Protecting Protecting Protecting

Self- Self- Self- Self-


Optimizing Optimizing Optimizing Optimizing

Manual
Autonomic
As computer systems have advanced from very basic technologies needing intense IT management toward autonomic systems that can self-
manage, there have been four major stepping stones: self-optimizing, self-protecting, self-healing, and self-configuring. Each of these steps
toward fully autonomic systems allows for more expansive computing while reducing the skill level required of the end users.

There are two basic models for autonomic com- systems that activate or deactivate ACs. A multi-agent
puter design: a feedback control system and a multi- system uses the collective functions of separate com-
agent system. In a feedback control system, changing ponents to complete higher-order functions. For in-
conditions provide feedback to the system that trig- stance, groups of computers can be networked such
gers changes in the system’s function. Feedback that by performing individual functions, the compo-
control is often found in biological systems. In the nents can collectively manage the system’s functions
autonomic nervous system, for example, levels of and resources with reduced need for outside input.
various neurotransmitters are linked to feedback Linking multiple processors together changes the

15
Avatars and simulation Principles of Programming & Coding

system’s resource distribution, requiring that it be computer networking. For instance, the AI system
able to locate computing resources within all con- Amelia, developed by former IT specialist Chetan
nected agents in to handle tasks effectively. Dube, not only responds to verbal queries and answers
Semi-autonomic software and hardware systems questions but can also learn by listening to human
are commonly used. Peer-to-peer (P2P) systems for operators answer questions that it cannot answer. To
social networking and communication generally have some, systems that can learn and alter their own pro-
some autonomic properties, including self-configura- gramming are the ultimate goal of autonomic design.
tion, self-tuning, and self-organization. These systems
—Micah L. Issitt
can determine a user’s particular computer setup,
tune themselves to function in various environments,
and self-organize in response to changing data or Bibliography
configuration. Most modern computing systems con- Bajo, Javier, et al., eds. Highlights of Practical Applications
tain ACs but are not considered fully autonomic, as of Agents, Multi-Agent Systems, and Sustainability.
they still require some external management. Proc. of the International Workshops of PAAMS
2015, June 3–4, 2015, Salamanca, Spain. Cham:
The Promise of Autonomic Systems Springer, 2015. Print.
The main goal of autonomic computing is to enable Berns, Andrew, and Sukumar Ghosh. “Dissecting
computer systems to perform basic maintenance Self-* Properties.” SASO 2009: Third IEEE
and optimization tasks on their own. Maximizing the International Conference on Self-Adaptive and Self-
number of automated functions that a computer can Organizing Systems. Los Alamitos: IEEE, 2009. 10–
handle allows engineers and system administrators 19. Andrew Berns: Homepage. Web. 20 Jan. 2016.
to focus on other activities. It also enhances ease of Follin, Steve. “Preparing for IT Infrastructure
operation, especially for those less adept at data man- Autonomics.” IndustryWeek. Penton, 19 Nov. 2015.
agement or system maintenance. For instance, the Web. 20 Jan. 2016.
bootstrapping system and the self-regulatory systems Gibbs, W. Wayt. “Autonomic Computing.” Scientific
that detect and correct errors have made computing American. Nature Amer., 6 May 2002. Web. 20 Jan.
more friendly for the average user. 2016.
Autonomic computer systems are particularly im- Lalanda, Philippe, Julie A. McCann, and Ada Dia-
portant in robotics, artificial intelligence (AI), and conescu, eds. Autonomic Computing: Principles, Design
machine learning. These fields seek to design ma- and Implementation. London: Springer, 2013. Print.
chines that can work unaided after initial setup and Parashar, Manish, and Salim Hariri, eds. Autonomic
programming. The science of autonomic computing Computing: Concepts, Infrastructure, and Applications.
is still in its infancy, but it has been greatly enhanced Boca Raton: CRC, 2007. Print.
by advancements in processing power and dynamic

AVATARS AND SIMULATION


FIELDS OF STUDY by the images and sounds of a computer. An avatar
is the personal manifestation of a particular person.
Digital Media; Graphic Design
Simulation and VR are used for many applications,
from entertainment to business.
ABSTRACT
PRINCIPAL TERMS
Avatars and simulation are elements of virtual reality
(VR), which attempts to create immersive worlds for ƒƒ animation variables (avars): defined variables used
computer users to enter. Simulation is the method in computer animation to control the movement
by which the real world is imitated or approximated of an animated figure or object.

16
Principles of Programming & Coding Avatars and simulation

ƒƒ keyframing: a part of the computer animation pro- Before the rendering stage, a great deal of ef-
cess that shows, usually in the form of a drawing, fort goes into designing how an animated character
the position and appearance of an object at the or avatar will look, how it will move, and how its
beginning of a sequence and at the end. textures will behave during that movement. For
ƒƒ modeling: reproducing real-world objects, people, example, a fur-covered avatar that moves swiftly
or other elements via computer simulation. outdoors in the wind should have a furry or hairy
ƒƒ render farm: a cluster of powerful computers that texture, with fibers that appear to blow in the wind.
combine their efforts to render graphics for ani- All of this must be designed and coordinated by
mation applications. computer animators. Typically, one of the first steps
ƒƒ virtual reality: the use of technology to create is keyframing, in which animators decide what
a simulated world into which a user may be im- the starting and ending positions and appearance
mersed through visual and auditory input. of the animated object will be. Then they design
the movements between the beginning and end
Virtual Worlds by assigning animation variables (avars) to dif-
Computer simulation and virtual reality (VR) have ferent points on the object. This stage is called
existed since the early 1960s. While simulation has “in-betweening,” or “tweening.” Once avars are
been used in manufacturing since the 1980s, avatars assigned, a computer algorithm can automatically
and virtual worlds have yet to be widely embraced change the avar values in coordination with one
outside gaming and entertainment. VR uses comput- another. Alternatively, an animator can change “in-
erized sounds, images, and even vibrations to model between” graphics by hand. When the program is
some or all of the sensory input that human beings run, the visual representation of the changing avars
constantly receive from their surroundings every day. will appear as an animation.
Users can define the rules of how a VR world works In general, the more avars specified, the more de-
in ways that are not possible in everyday life. In the tailed and realistic that animation will be in its move-
real world, people cannot fly, drink fire, or punch ments. In an animated film, the main characters
through walls. In VR, however, all of these things are often have hundreds of avars associated with them.
possible, because the rules are defined by human For instance, the 1995 film Toy Story used 712 avars for
coders, and they can be changed or even deleted. the cowboy Woody. This ensures that the characters’
This is why users’ avatars can appear in these virtual actions are lifelike, since the audience will focus at-
worlds as almost anything one can imagine—a loaf of tention on them most of the time. Coding standards
bread, a sports car, or a penguin, for example. Many for normal expressions and motions have been de-
users of virtual worlds are drawn to them because of veloped based on muscle movements. The MPEG-4
this type of freedom. international standard includes 86 face parameters
Because a VR simulation does not occur in phys- and 196 body parameters for animating human and
ical space, people can “meet” regardless of how far humanoid movements. These parameters are en-
apart they are in the real world. Thus, in a company coded into an animation file and can affect the bit
that uses a simulated world for conducting its meet- rate (data encoded per second) or size of the file.
ings, staff from Hong Kong and New York can both
occupy the same VR room via their avatars. Such vir-
tual meeting spaces allow users to convey nonverbal
cues as well as speech. This allows for a greater de-
gree of authenticity than in telephone conferencing.

Mechanics of Animation
The animation of avatars in computer simulations
often requires more computing power than a single
workstation can provide. Studios that produce ani-
Avatars were around long before social media. As computers have
mated films use render farms to create the smooth become more powerful and the rendering capabilities more effi-
and sophisticated effects audiences expect. cient, avatars have improved in detail and diversity.

17
Avatars and simulation Principles of Programming & Coding

Educational Applications Bibliography


Simulation has long been a useful method of training
Chan, Melanie. Virtual Reality: Representations in
in various occupations. Pilots are trained in flight
Contemporary Media. New York: Bloomsbury, 2014.
simulators, and driving simulators are used to pre-
Print.
pare for licensing exams. Newer applications have
Gee, James Paul. Unified Discourse Analysis: Language,
included training teachers for the classroom and
Reality, Virtual Worlds, and Video Games. New York:
improving counseling in the military. VR holds the
Routledge, 2015. Print.
promise of making such vocational simulations much
Griffiths, Devin C. Virtual Ascendance: Video Games and
more realistic. As more computing power is added,
the Remaking of Reality. Lanham: Rowman, 2013.
simulated environments can include stimuli that
Print.
better approximate the many distractions and de-
Hart, Archibald D., and Sylvia Hart Frejd. The Digital
tailed surroundings of the typical driving or flying
Invasion: How Technology Is Shaping You and Your
situation, for instance.
Relationships. Grand Rapids: Baker, 2013. Print.
Kizza, Joseph Migga. Ethical and Social Issues in the
VR in 3D Information Age. 5th ed. London: Springer, 2013.
Most instances of VR that people have experienced
Print.
so far have been two-dimensional (2D), occurring
Lien, Tracey. “Virtual Reality Isn’t Just for Video
on a computer or movie screen. While entertaining,
Games.” Los Angeles Times. Tribune, 8 Jan. 2015.
such experiences do not really capture the concept
Web. 23 Mar. 2016.
of VR. Three-dimensional (3D) VR headsets such as
Parisi, Tony. Learning Virtual Reality: Developing
the Oculus Rift may one day facilitate more lifelike
Immersive Experiences and Applications for Desktop,
business meetings and product planning. They may
Web, and Mobile. Sebastopol: O’Reilly, 2015. Print.
also offer richer vocational simulations for military
and emergency personnel, among others.
—Scott Zimmer, JD

18
B
BINARY HEXADECIMAL REPRESENTATIONS
FIELDS OF STUDY Understanding the Binary Number
System
Computer Science; Computer Engineering; Software
A mathematical number system is a way of repre-
Engineering
senting numbers using a defined set of symbols.
Number systems take their names from the number
ABSTRACT of symbols the system uses to represent numbers. For
The binary number system is a base-2 number system. example, the most common mathematical number
It is used by digital devices to store data and perform system is the decimal system, or base-10 system. Deci-
mathematical operations. The hexadecimal number means “ten.” It uses the ten digits 0 through 9 as
system is a base-16 number system. It enables humans symbols for numbers. Number systems can be based
to work efficiently with large numbers stored as bi- on any number of unique symbols, however. For ex-
nary data. ample, the number system based on the use of two
digit symbols (0 and 1) is called the binary or base-2
system.
PRINCIPAL TERMS
Both the decimal and binary number systems use
ƒƒ base-16: a number system using sixteen symbols, the relative position of digits in a similar way when rep-
0 through 9 and A through F. resenting numbers. The value in the rightmost, or first,
ƒƒ base-2 system: a number system using the digits position is multiplied by the number of digits used in
0 and 1. the system to the zero power. For the decimal system,
ƒƒ bit: a single binary digit that can have a value of this value is 100. For the binary system, this value is 20.
either 0 or 1. Both 100 and 20 are equal to 1. Any number x raised to
ƒƒ byte: a group of eight bits. the zero power is equal to 1. The power used increases
ƒƒ nibble: a group of four bits. by one for the second position and so on.

Decimal/Binary Table. Table organizes binary based values and decima based values by position,
from 8 to 1, and by power, from seventh power to zero power.

Using the decimal number system, the integer 234 is represented by placing the symbols 2, 3, and 4 in posi-
tions 3, 2, and 1, respectively.

19
Binary hexadecimal representations Principles of Programming & Coding

Decimal/Digits table. Table organizes decimal values and


the number of digits by position, from 3 to 1.

In the decimal system, 234 = (2 × 100) + (3 × 10) + (4 × 1), or (2 × 102) + (3 × 101) + (4x100). The binary system
uses the relative position of the symbols 0 and 1 to express the integer 234 in a different manner.

Binary/Bit Table. Table organizes binary based values and Bit values by position from 8 to 1.

In the binary system, 234 = (1 × 128) + (1 × 64) + systems. Such devices store data using transistors,
(1 × 32) + (0 × 16) + (1 × 8) + (0 × 4) + (1 × 2) + (0 × 1), electronic parts that can each be switched between
or 234 = (1 × 27) + (1 × 26) + (1 × 25) + (0 × 24) + (1 × 23) + two states. One state represents the binary digit 0 and
(0 × 22) + (1 × 21) + (0 × 20). the other, the binary digit 1. These binary digits are
bits, the smallest units of data that can be stored and
The Importance of the Binary Number manipulated. A single bit can be used to store the
System value 0 or 1. To store values larger than 1, groups of
The binary number system is used to store numbers bits are used. A group of four bits is a nibble. A group
and perform mathematical operations in computers of eight bits is a byte.

SAMPLE PROBLEM

To work with binary numbers in digital applications, it is important to be


able to translate numbers from their binary values to their decimal values.
Translate the following binary byte to its decimal value: 10111001

Answer:
The decimal value of the binary byte 10111001 is 185. The decimal value can
be determined using a chart and then calculating.

8 7 6 5 4 3 2 1
128 or 2 7
64 or 2 6
32 or 2 5
16 or 2 4
8 or 2 3
4 or 22
2 or 2 1
1 or 20
1 1 1 0 1 0 1 0

= (1 × 27) + (0 × 26) + (1 × 25) + (1 × 24) + (1 × 23) + (0 × 22) + (0 × 21) + (1 × 20)


= (1 × 128) + (0 × 64) + (1 × 32) + (1 ×16) + (1 × 8) + (0 × 4) + (0 × 2) + (1 × 1)
= 185

20
Principles of Programming & Coding Binary hexadecimal representations

DECIMAL HEXADECIMAL BINARY


0 00 00000000
1 01 00000001
2 02 00000010
3 03 00000011
4 04 00000100
5 05 00000101
6 06 00000110
7 07 00000111
8 08 00001000
9 09 00001001
10 0A 00001010
11 0B 00001011
12 0C 00001100
13 0D 00001101
14 0E 00001110
15 0F 00001111
16 10 00010000
17 11 00010001
18 12 00010010
19 13 00010011
20 14 00010100
21 15 00010101
22 16 00010110
23 17 00010111
24 18 00011000
25 19 00011001
26 1A 00011010
27 1B 00011011
28 1C 00011100
29 1D 00011101
30 1E 00011110
31 1F 00011111
32 20 00100000
33 21 00100001
34 22 00100010
35 23 00100011
36 24 00100100
37 25 00100101
38 26 00100110
39 27 00100111
40 28 00101000
41 29 00101001
42 2A 00101010
43 2B 00101011
44 2C 00101100
45 2D 00101101
46 2E 00101110
47 2F 00101111
48 30 00110000
49 31 00110001
50 32 00110010

The American Standard Code for Information Interchange (ASCII) was an early system used to translate basic characters into a numerical
code readable by computers . The common characters on a keyboard are provided with decimal and hexadecimal codes .

21
Binary hexadecimal representations Principles of Programming & Coding

Using Hexadecimal to Simplify Binary binary nibble can be represented by a single symbol.
Numbers For example, the hex digit F can be used instead
The hexadecimal number system is a base-16 system. of the binary nibble 1111 for the decimal value 15.
It uses the digits 0 through 9 and the letters A through Sixteen different combinations of bits are possible
F to represent numbers. The hexadecimal digit, or in a binary nibble. The hexadecimal system, with six-
hex digit, A has a decimal value of 10. Hex digit B teen different symbols, is therefore ideal for working
equals 11, C equals 12, D equals 13, E equals 14, and with nibbles.
F equals 15. In hexadecimal, the value 10 is equal One disadvantage of using binary is that large
to 16 in the decimal system. Using hexadecimal, a numbers of digits are needed to represent large

Decimal/Hexidecimal Table. table organizes decimal based values and hexidecimal based values by
position from 8 to 1, and power from seventh to zero.

integers. For example, 1,000,000 is shown in binary Computers can quickly and easily work with large
digits as 11110100001001000000. The same number numbers in binary. Humans have a harder time using
is shown in hex digits as F4240, which is equal to (15 × binary to work with large numbers. Binary uses many
65,536) + (4 × 4,096) + (2 × 256) + (4 × 16) + (0 × 1). more digits than hexadecimal does to represent large

Position 5 4 3 2 1
Fourth Third Second First Zero
Power Power Power Powder Power
Hexadecimal 65,536 4,096 256 or 16 or 1
or 164 or 163 162 161 or 160
Hex digits F or 15 4 2 4 0
Hexidecimal/Hex digits Table. Table organizes hexidecimal based values and corres-
ponding hex digits by position from 5 to 1.

numbers. Hex digits are therefore easier for humans U of California Berkeley, Spring 2013. Digital
to use to write, read, and process than binary. File.
—Maura Valentino, MSLIS Glaser, Anton. History of Binary and Other Nondecimal
Numeration. Rev. ed. Los Angeles: Tomash, 1981.
Print.
Bibliography Lande, Daniel R. “Development of the Binary
Australian National University. Binary Representation Number System and the Foundations of Computer
and Computer Arithmetic. Australian National U, Science.” Mathematics Enthusiast 1 Dec. 2014: 513–
n.d. Digital file. 40. Print.
Cheever, Erik. “Representation of Numbers.” Swarthmore “A Tutorial on Data Representation: Integers,
College. Swarthmore College, n.d. Web. 20 Feb. 2016. Floating-Point Numbers, and Characters.” NTU.
Govindjee, S. Internal Representation of Numbers. edu. Nanyang Technological U, Jan. 2014. Web. 20
Dept. of Civil and Environmental Engineering, Feb. 2016.

22
Principles of Programming & Coding Boolean operators

BOOLEAN OPERATORS
FIELD OF STUDY expression is false. When two expressions are joined
by the OR operator, the combined expression evalu-
Software Development; Coding Techniques; Computer
ates to true if either expression is true and only evalu-
Science
ates to false if both are false.
The NOT operator reverses the value of a Boolean
ABSTRACT expression. For example, the expression x > 5
Boolean, or logical, operators are used to create evaluates to true if the value of x is greater than 5.
Boolean expressions, which test whether a condition However, the NOT operator can be used to reverse
is true or false. Statements such as the if-statement this result. The expression NOT x > 5 evaluates to
use Boolean expressions to control the order in false if the value of x is greater than 5.
which a computer program processes commands and The order in which operations are performed
other statements. is called “precedence.” Arithmetic is done before
Boolean operations. Boolean operators with higher
PRINCIPAL TERMS precedence are evaluated before those with lower
precedence: NOT is evaluated before AND, which
ƒƒ if-statement: a command that instructs a com- is evaluated before OR. The default precedence can
puter program to execute a block of code if a cer- be overridden using nested parentheses. Expressions
tain condition is true. within the innermost parentheses are evaluated first,
ƒƒ operator: a character that indicates a specific followed by expressions contained within the paren-
mathematical, relational, or logical operation. theses that surround them, and so on. However, when
ƒƒ string: in computer programming, a data type using the AND operator, if any component expression
consisting of characters arranged in a specific se- evaluates to false, then any component expressions
quence. that follow the false expression are not evaluated.
Likewise, when using the OR operator, if a compo-
Understanding Boolean Expressions nent expression evaluates to true, then any compo-
In computer programming, an expression describes nent expressions that follow the true expression are
some value (much as a math equation does), often not evaluated. This is called “short-circuiting.”
using integers, strings, constants, or variables. The order in which statements are executed is called
Boolean expressions are expressions that, when eval- “control flow.” Statements such as the if-statement
uated, return one of two values: “true/false,” “yes/ and if-else statement alter a program’s control flow.
no,” or “on/off.” For example, the Boolean expres- The if-statement tests for a condition, and if that
sion x > 5 would return a value of “false” if x = 4 and condition is true, control flow passes to a designated
a value of “true” if x = 6. Boolean expressions can be block of code. If the condition is false, no action is
used with different data types, including integers, performed. In an if-else statement, if the condition is
strings, and variables. Complex Boolean expressions false, control flow passes to a different block of code.
can be created using Boolean operators. Boolean op- Boolean expressions are used to create the condi-
erators combine two or more Boolean expressions tions used by if-statements and if-else statements.
into a single expression and can also reverse the
value of a Boolean expression. Using Boolean Operators Effectively
There are three main Boolean operators: AND, Computer programs are often designed to help
OR, and NOT. Different programming languages people accomplish their tasks more efficiently.
use different symbols to represent them, such as && As many tasks require making decisions based on
for AND or || for OR in Java, but the uses remain the whether different conditions are true or false,
same. The AND operator combines two Boolean ex- Boolean operators help computer programs com-
pressions into a single expression that evaluates to plete these tasks effectively. In fact, simple condi-
true if, and only if, both expressions are true. If ei- tional tests are easy to convert to code because simple
ther expression evaluates to false, then the combined Boolean expressions are coded much like words are

23
Boolean operators Principles of Programming & Coding

used in everyday language. Consider the following IF (Score >= 90) THEN
plain-language statement: “If the date for the concert Grade = “A”
is September 1, 2018, and the type of concert is folk ELSE IF (Score >= 80) AND (Score < 90) THEN
music, then delete the concert from the master list.” Grade = “B”
This statement could be expressed in code as follows: ELSE IF (Score >= 70) AND (Score < 80) THEN
Grade = “C”
IF (Date = “9/1/18”) AND (ConcertType = “folk ELSE IF (Score >= 60) AND (Score < 70) THEN
music”) THEN Grade = “D”
Delete Concert ELSE
END IF Grade = “F”
END IF
However, as Boolean expressions become more
complicated, they become increasing difficult to Boolean Operators in the Real World
understand correctly. For example, the expression Boolean operators are commonly used when search­
NOT x < 5 AND y > 1 OR country = “UK” can only be ing for information in a database. For instance, if a
executed correctly if the order of precedence for the student needs to write a research paper on climate
operators is known. Programmers use parentheses change, they might type in “global warming OR
to define the order precedence they desire to make climate change.” This would tell the library’s database
such expressions easier to understand. For example, to return results that include either phrase and thus
the above expression could be rewritten as follows: increase the overall number of results returned.
Boolean operators are also used to program soft-
NOT (x < 5 AND (y > 1 OR country = “UK”)) ware in which a sequential flow of control is not
desired. The conditions that they enable allow
Conditional Statements in Practice programs not only to branch through selection,
If statements and if-else statements could be used to but also to loop (or repeat) sections of code. Thus,
assign a letter grade based on an exam score. First, a Boolean operators allow more complex software to
Boolean expression is used to check that the exam be developed.
has been completed and scored. The AND operator
is used because both conditions must be true for a —Maura Valentino, MSLIS
letter grade to be assigned.
Bibliography
IF (ExamComplete = 1) AND (ExamScored = 1)
Friedman, Daniel P., and Mitchell Wand. Essentials of
THEN
Programming Languages. 3rd ed., MIT P, 2008.
Retrieve ExamScore
Haverbeke, Marijn. Eloquent JavaScript: A Modern
END IF
Introduction to Programming. 2nd ed., No Starch
Store ExamScore in a variable named Score
Press, 2014.
MacLennan, Bruce J. Principles of Programming
Next, the code uses a chain of if statements to assign
Languages: Design, Evaluation, and Implementation.
a letter grade to the variable Grade. Note how the first
3rd ed., Oxford UP, 1999.
statement does not use a Boolean operator because it
Schneider, David I. An Introduction to Programming
does not need to evaluate more than one expression.
using Visual Basic. 10th ed., Pearson, 2016.
The next three statements use the Boolean operator
Scott, Michael L. Programming Language Pragmatics.
AND because they require both expressions to be true
4th ed., Morgan Kaufmann Publishers, 2016.
for the code to be executed. The final if-statement
Van Roy, Peter, and Seif Haridi. Concepts, Techniques,
does not contain a Boolean expression because it ex-
ecutes only if all other if-statements fail to execute. and Models of Computer Programming. MIT P, 2004.

24
Principles of Programming & Coding Branching logic

BRANCHING LOGIC
FIELD OF STUDY true, then code is executed to create outcome A. If
it evaluates to false, then code is executed to create
Coding Techniques; Software Development; Computer
outcome B.
Science
The exact syntax of the if-then-else statement
ABSTRACT varies among programming languages, but the logic
remains the same. In some programming languages,
Branching logic is used in computer programming the “else” statement is optional. In these cases, if the
when different sections of code need to be executed conditional statement evaluates to false, the program
depending on one or more conditions. Each possible will continue with the instructions that come after
code pathway creates another branch. There is no the “end if” statement.
limit to the number of branches that can be used to Multiple branches can be used to test multiple
implement complex logic. conditions. An “else if” statement can be added to the
above example to test other conditions:
PRINCIPAL TERMS
ƒƒ Boolean logic: a type of algebra in which variables IF condition 1 THEN
have only two possible values, either “true” or “false.” outcome A
ƒƒ if-then-else: a conditional statement that evaluates ELSE IF condition 2 THEN
a Boolean expression and then executes different outcome B
sets of instructions depending on whether the ex- ELSE IF condition 3 THEN
pression is true or false. outcome C
ƒƒ parameter: in computer programming, a variable ELSE
with an assigned value that is passed into a func- outcome D
tion or subroutine within a larger program. END IF

With the above structure, three conditions are


What Is Branching Logic?
tested and four outcomes are possible.
Branching logic is a form of decision making in
Most applications do not execute their code lin-
which a computer program follows different sets of
early, without variations. Rather, each time an appli-
instructions depending on whether or not certain
cation is run, different inputs can lead to different
conditions are met during the program’s execution.
results. For example, in a word-processing applica-
Each set of instructions represents a different branch.
tion, pressing the same letter key on a computer key-
Which branch of code is executed depends on the
board will result in different outcomes depending on
values assigned to the parameters of the branching
whether certain other keys are pressed at the same
procedure. The values of these parameters may be
time. If a user presses the letter a, the application
input by the user, or they may be generated by the
must evaluate whether or not that user also pressed
output from a previous procedure.
either the shift key or the control key before it can de-
A common form of branching logic is the if-then-
termine if the letter should be displayed as a capital A
else statement. Such statements generally take the
or a lowercase a, or if some other code should be ex-
following form:
ecuted instead. The decision structure for this output
IF condition 1 THEN might look something like the following:
outcome A
IF shift key is also pressed THEN
ELSE
display A
outcome B
ELSE IF control key is also pressed THEN
END IF
select entire document
In this statement, Boolean logic is used to test a ELSE
given condition (condition 1), which can be found display a
to be either true or false. If condition 1 evaluates to END IF

25
Branching logic Principles of Programming & Coding

website, certain marketing materials are sent to that


customer. If a different page is viewed, different ma-
terials are sent.
The nesting structure of branching logic can be
confusing to plan if there are many conditions to
check. Programmers can use a script tool to create a
form structure for users to input the parameters that
will be used to evaluate the conditional statements.
This technique reduces errors, because restrictions
can be placed on what data is entered. The script tool
can also be used to provide the user with information
calculated from input parameters.
There are some minor drawbacks to using
branching logic. For example, the nesting structure
of the “else if” statement creates added difficulty for
some compilers, and conditional statements can slow
the processing of code. Faster structures have been
A model of branching logic will have multiple sequences of events. developed to overcome these difficulties.
Which set of instructions is followed depends on the outcomes
along specific nodes in the path. After script A is complete, if the
output matches an expected outcome, then script B will run; if
not, then script C will run. How Is Branching Logic Used?
Branching logic is used by computer programs in
many fields. In online retail stores, for example, some
In this example, the Boolean statements being evalu-
items only require the user to make one decision—to
ated are “shift key is also pressed” and “control key is
buy or not to buy—while other items require the user
also pressed.” The keys pressed by the user are stored
to choose a color and a size. If the color is chosen
as parameters and then passed to the branching
first, the store will only list the sizes available in that
procedure, which uses those parameters to evaluate
color, and vice versa. This is much more convenient,
whether or not the statements are true. The user’s ac-
and much less frustrating to users, than it would be
tions can result in a new decision being created each
if the store presented users with choices that did not
time the same section of code is executed.
exist and did not inform them until much later in the
process. A listing for an item that is available in three
When Is Branching Logic Used?
colors in sizes small and medium, four colors in size
It is imperative that computer programs and appli-
large, and one color in size extra large may follow the
cations be able to execute different pieces of code
following decision structure:
depending on the input they receive. For example,
branching logic is often used in surveys so that par-
ticipants receive only questions that apply to them. IF size = small THEN
If a survey contains questions that only apply to one colors = blue, green, red
sex or another, the first survey question may ask for ELSE IF size = medium THEN
the sex of the participant. The participant’s response colors = blue, red, yellow
will be stored as a parameter that will then determine ELSE IF size = large THEN
which additional questions they will be presented colors = blue, green, red, yellow
with. If every participant had to read through all of ELSE
the possible questions to determine whether or not colors = blue
each one applied to them, the survey would be much END IF
more difficult and time consuming, and it would re-
sult in more errors. If the user chooses color before size, the ensuing deci-
Branching logic is also used in workflows in fields sion structure would look similar. The two structures
such as marketing. If a customer views one page of a can be nested within a larger if-then-else statement
26
Principles of Programming & Coding Branching logic

that executes either one or the other depending on Bibliography


whether size or color is chosen first.
Friedman, Daniel P., and Mitchell Wand. Essentials of
Programming Languages. 3rd ed., MIT P, 2008.
Why Is Branching Logic Important?
Haverbeke, Marijn. Eloquent JavaScript: A Modern
Many computer programs require decision making,
Introduction to Programming. 2nd ed., No Starch
and branching logic is one way of making decisions.
Press, 2015.
It is so common in computer programming that
MacLennan, Bruce J. Principles of Programming
many languages feature alternate structures that can
Languages: Design, Evaluation, and Implementation.
execute branching procedures in much fewer lines
3rd ed., Oxford UP, 1999.
of code. For example, conditional operators can pro-
Scott, Michael L. Programming Language Pragmatics.
duce the same results as if-then-else statements using
4th ed., Elsevier, 2016.
just one line of code. A switch statement is another,
Schneider, David I. An Introduction to Programming
more complicated form of branching logic that uses
Using Visual Basic. 10th ed., Pearson, 2017.
a table to check many values against the given condi-
Van Roy, Peter, and Seif Haridi. Concepts, Techniques,
tion. Branching logic is used extensively in modern
and Models of Computer Programming. MIT P, 2004.
programming and has led to many developments as
programs have become more complex.
—Maura Valentino, MSLIS

27
C
CHARACTERS AND STRINGS
FIELDS OF STUDY combined to create the strings “TOP,” “OPT,” and
“POT.” Strings that use the same characters can have
Software Development; Coding Techniques; Computer
different meanings and outputs depending on the se-
Science
quence in which the characters are arranged.
Computer programs use variables to store and
ABSTRACT
manipulate data. Variables are referenced by unique
Characters and strings are basic units of programming symbolic names. The data stored in a variable is re-
languages that direct computer programs to store, re- ferred to as a value. Different types of data can be
trieve, and manipulate data. Characters represent the stored as variables, including numeric and textual in-
individual letters, numbers, punctuation marks, and formation. For example, the variable used to hold an
other symbols in programming languages. Strings are error message might be named ErrorMessage. If a com-
groups of characters arranged in a specific sequence. puter program needs to notify the user that an error
has occurred, it could accomplish this by storing the
PRINCIPAL TERMS string “Error!” in the variable ErrorMessage. The pro-
gram could then issue a command to instruct the
ƒƒ command: an instruction given by a user to a com-
computer to display the error message.
puter that directs the computer to perform a spe-
The rules that govern the arrangement and mean-
cific, predefined task.
ings of words and symbols in a programming lan-
ƒƒ interpolation: a process by which a computer pro-
guage are the syntax. For example, one computer
gram evaluates variable expressions within a string.
language might use the following syntax to display
ƒƒ sequence: the specific order in which code is ar-
the error message.
ranged, thereby affecting its output.
ƒƒ string literals: a fixed sequence of characters
ErrorMessage = “Error!”
that appear in source code enclosed by single or
echo ErrorMessage
double quotation marks.
ƒƒ syntax: in computer programming, the rules that
In this example, ErrorMessage is the variable.
govern how the elements of a programming lan-
“Error!” is the string. The command is named echo,
guage should be arranged.
and the statements are separated by line breaks. On
the other hand, another language might use dif-
What Are Characters and Strings? ferent syntax to accomplish the same task:
Characters are the most basic units of programming
languages. Characters include letters, numbers, punc- ErrorMessage = ‘Error!’;
tuation marks, blank spaces, and the other symbols. In printscreen ErrorMessage;
computer programming, characters may be grouped
together to form units of information called strings. A In this example, ErrorMessage is the variable and
string can be created by placing one or more charac- “Error!” is the string. However, printscreen is the com-
ters in sequential order. For example, the letters O, P, mand, and the statements are separated by semicolons
and T are characters. Those three characters can be and line breaks. In both examples, the string Error! is

28
Principles of Programming & Coding Characters and strings

stored as a value for the variable ErrorMessage in the When a character, such as the double quotation
first statement. The string is then displayed on the us- mark, is used to define a string, it is called a special
er’s monitor by a command in the second statement. character. The use of a special character to define a
There are several ways in which string values may string creates a problem when the special character it-
be created. One way is through the use of string lit- self needs to be used within the string. Programming
erals. String literals are strings that represent a vari- languages solve this problem through the use of
able with a fixed value. String literals are enclosed in character combinations to escape the string. For
quotation marks in the source code. For example, example, a double quotation mark that is used in a
the string “John Smith” might be stored in the vari- string enclosed by double quotation marks might be
able CustomerName as follows: represented by a backslash as follows:
CustomerName = “John Smith” MyQuotation = “/”Hello there, Mr. Jones!/”“
String literals can also be created by combining
various placeholders. For example, the variable This code would output the text “Hello there, Mr.
CustomerName might also be created as follows: Jones!” to the user’s monitor. The backslash changes
the meaning of the quotation mark that it precedes
FirstName = “John” from marking the end of a string to representing an
LastName = “Smith” ordinary character within the string.
CustomerName = FirstName + “ “ + LastName
Strings and Characters in Real-World
The process of adding two string variables to- Data Processing
gether in this manner is called concatenation. The use of characters and strings to store and ma-
Strings may also be created by combining vari- nipulate the symbols that make up written languages
ables, string literals, and constants. When a com- is commonplace in computer programming. Strings
puter program evaluates various placeholders within are used to process textual data of all types. Computer
a string, it is called interpolation. For example, the programs use strings and characters to sort, search,
variables FirstName and LastName, along with the and combine a vast array of textual information rap-
string literals “Dear” and blank spaces, might be used idly and accurately. The widespread use of textual
to store the string value “Dear John Smith” in the data in computer programming has led to the devel-
variable Salutation, as follows: opment of industry standards that promote sharing of
FirstName = “John” text across programming languages and software. For
LastName = “Smith” example, Unicode, the most widely used system for
Salutation = “Dear” + “ “ + FirstName + “ “ + processing, displaying, and storing textual data, stan-
LastName dardizes the encoding for more than 128,000 charac-
ters and 135 languages. Due to their widespread use,
In this example, the string value “John” is stored strings and characters form one of the cornerstones
in the variable FirstName, and the string value “Smith” of computer and information science.
is stored in the variable LastName. The final line of —Maura Valentino, MSLIS
code uses interpolation to combine the data stored in
the variables with the string literals “Dear” and blank
spaces to create a new variable named Salutation, Bibliography
which stores the string value “Dear John Smith.” Friedman, Daniel P., and Mitchell Wand. Essentials of
Programming Languages. 3rd ed., MIT P, 2008.
Using Special Characters in Strings Haverbeke, Marijn. Eloquent JavaScript: A Modern
As demonstrated in the previous examples, the syntax Introduction to Programming. 2nd ed., No Starch
for a computer language might use double quotation Press, 2014.
marks to define a string as follows: MacLennan, Bruce J. Principles of Programming
Languages: Design, Evaluation, and Implementation.
LastName = “Smith” 3rd ed., Oxford UP, 1999.

29
Cloud computing Principles of Programming & Coding

Scott, Michael L. Programming Language Pragmatics. Van Roy, Peter, and Seif Haridi. Concepts, Techniques,
4th ed., Morgan Kaufmann Publishers, 2016. and Models of Computer Programming. MIT P, 2004.
Schneider, David I. Introduction to Programming using
Visual Basic. 10th ed., Pearson, 2016.

CLOUD COMPUTING
FIELDS OF STUDY cloud-based storage for user data. Others provide
virtual access to software programs or enhanced
Information Technology; Computer Science; Software
processing capabilities. Cloud computing is among
the fastest-growing areas of the Internet services in-
ABSTRACT dustry. It has also been adopted by government and
Cloud computing is a networking model in which research organizations.
computer storage, processing, and program access
are handled through a virtual network. Cloud com- Types of Cloud Networks
puting is among the most profitable IT trends. A host Private clouds are virtual networks provided to a lim-
of cloud-oriented consumer products are available ited number of known users. These are often used in
through subscription. corporations and research organizations. Operating
a private cloud requires infrastructure (software,
PRINCIPAL TERMS servers, etc.), either on-site or through a third party.
Public clouds are available to the public or to paying
ƒƒ hybrid cloud: a cloud computing model that com- subscribers. The public-cloud service provider owns
bines public cloud services with a private cloud and manages the infrastructure. Unlike private
platform linked through an encrypted connec- clouds, public clouds provide access to an unknown
tion. pool of users, making them less secure. Public clouds
ƒƒ infrastructure as a service: a cloud computing tend to be based on open-source code, which is free
platform that provides additional computing re- and can be modified by any user.
sources by linking hardware systems through the The hybrid cloud lies somewhere between the two.
Internet; also called “hardware as a service.” It offers access to private cloud storage or software
ƒƒ multitenancy: a software program that allows mul- services, such as database servers, while keeping some
tiple users to access and use the software from dif- services or components in a public cloud. Setup costs
ferent locations. may be lower with hybrid cloud services. A group
ƒƒ platform as a service: a category of cloud com- using a hybrid cloud outsources some aspects of in-
puting that provides a virtual machine for users to frastructure investment and maintenance but still en-
develop, run, and manage web applications. joys greater security than with a public cloud. Hybrid
ƒƒ software as a service: a software service system in clouds have become widespread in the health care,
which software is stored at a provider’s data center law, and investment fields, where sensitive data must
and accessed by subscribers. be protected on-site.
ƒƒ third-party data center: a data center service pro-
vided by a separate company that is responsible for Cloud Computing as a Service
maintaining its infrastructure. The infrastructure as a service (IaaS) model offers
access to virtual storage and processing capability
Cloud Network Design through a linked network of servers. Cloud-based
Cloud computing is a networking model that al- storage has become popular, with services such
lows users to remotely store or process data. Several as Apple iCloud and Dropbox offering storage al-
major Internet service and content providers offer ternatives beyond the memory on users’ physical

30
Principles of Programming & Coding Cloud computing

programs through a virtual network . Adobe


Systems’ Creative Cloud provides access to
programs such as Photoshop, Illustrator,
and Lightroom for a monthly fee . Users
pay a smaller amount over time rather than
paying a higher cost up front to purchase
the program . SaaS supports multitenancy,
in which a single copy of a program is avail-
able to multiple clients . This allows software
providers to earn revenue from multiple cli-
ents through a single instance of a software
program .
CLOUD
Advantages and Disadvantages of
the Cloud
Cloud networking allows small compa-
nies and individuals access to develop-
ment tools, digital storage, and software
that once were prohibitively expensive or
required significant management and ad-
ministration . By paying subscription fees,
users can gain monthly, yearly, or as-used
access to software or other computing tools
Cloud computing refers to the use of processors, memory, and other peripheral with outsourced administration . For service
devices offsite, connected by a network to one’s workstation . Use of the cloud providers, cloud computing is cost effective
protects data by storing it and duplicating it offsite and reduces infrastructure
because it eliminates the cost of packaging
and personnel needs .
and selling individual programs and other
products .
computers . IaaS can also give users greater com- Data security is the chief concern among
puting power by allowing certain processes to run those considering cloud computing . The private
on virtual networks, rather than on the hardware and hybrid cloud models provide a secure way for
of a single system . Using IaaS enables companies to companies to reap the benefits of cloud computing .
create a corporate data center through third-party Firewalls and encryption are common means of se-
data centers . These third-party centers provide ex- curing data in these systems . Providers are working to
pert IT assistance and server resources, generally for increase the security of public clouds, thus reducing
subscription fees . the need for private or hybrid systems .
The platform as a service (PaaS) model mainly of- —Micah L. Issitt
fers access to a specific platform that multiple users
can use to develop software applications, or apps .
Many apps require access to specific development Bibliography
programs . The Google App Engine and IBM’s de- Beattie, Andrew . “Cloud Computing: Why the Buzz?”
veloperWorks Open provide an environment that Techopedia . Techopedia, 30 Nov . 2011 . Web . 21 Jan .
stores, supports, and runs web apps . PaaS allows soft- 2016 .
ware developers to create apps without investing in Huth, Alexa, and James Cebula . The Basics of Cloud
infrastructure and data center support . Providers Computing . N .p .: Carnegie Mellon U and US
may also offer virtual storage, access to virtual net- Computer Emergency Readiness Team, 2011 . PDF
works, and other services . file .
The software as a service (SaaS) model offers Kale, Vivek . Guide to Cloud Computing for Business and
users subscription-based or shared access to software Technology Managers . Boca Raton: CRC, 2015 . Print .

31
Coding and encryption Principles of Programming & Coding

Kruk, Robert. “Public, Private and Hybrid Clouds: Ryan, Janel. “Five Basic Things You Should Know
What’s the Difference?” Techopedia. Techopedia, about Cloud Computing.” Forbes. Forbes.com, 30
18 May 2012. Web. 21 Jan. 2016. Oct. 2013. Web. 30 Oct. 2013.
Rountree, Derrick, and Ileana Castrillo. The Basics Sanders, James. “Hybrid Cloud: What It Is, Why It
of Cloud Computing. Waltham: Elsevier, 2014. Matters.” ZDNet. CBS Interactive, 1 July 2014. Web.
Print. 10 Jan. 2016.

CODING AND ENCRYPTION


ABSTRACT Around 2000 bce, Egyptian scribes included non-
standard hieroglyphs in carved inscriptions. During
Mathematical algorithms are used in modern en-
war campaigns, Julius Caesar sent coded informa-
cryption and decryption.
tion to Roman generals. Paul Revere’s signal from a
Boston bell tower in 1775 is even a simple example of
Overview
a coded message. Success of the Allies in both World
Human beings have a propensity to preserve and
Wars depended on their breaking of the German’s
share secret information. Cryptography, from the
Enigma code. With the world-wide need for more
Greek kryptos (hidden) and graphein (to write), is
sophisticated coding algorithms to transmit secure
the art and science of coding and decoding mes-
messages for military forces, businesses, and govern-
sages containing secret information. Encryption
ments, people began capitalizing on the combined
is the algorithmic process that converts plain-text
powers of mathematics, computer technology, and
into cipher-text (looks like a collection of unintel-
engineering.
ligible symbols), while decryption is the reverse
The simplest examples of ciphers involve ei-
process that converts the cipher-text back to the
ther transpositions or substitutions. In 450 bce,
original plain-text. A cipher algorithm and its asso-
the Spartans used transposition ciphers when they
ciated key control both directions of the sequence,
wound a narrow belt spirally around a thick staff and
with the code’s security level directly related to the
wrote a plain-text (or message) along the length of
algorithm’s complexity. The two fundamental types
the rod. Once unwound, the belt appeared to be a
of cryptography are symmetric (or secret keys) or
meaningless sequence of symbols. To decipher the
asymmetric (or public-key), with multiple variations.
cipher-text, the receiver wound the belt around a
Claude Shannon, an American mathematician and
similar staff. Variations of transposition ciphers are
electronic engineer, is known as the father of infor-
the route cipher and the Cardan grill.
mation theory and cryptography. Some claim that
Julius Caesar used substitution ciphers, where
his master’s thesis, which demonstrates that electrical
each letter of the plain-text is replaced by some other
applications of Boolean algebra can construct and re-
letter or symbol, using a substitution dictionary. For
solve any logical numerical relationship, is the most
example, suppose:
important master’s thesis of all time.

Original Alphabet:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Key Dictionary:
K L M N O P Q R S T U V W X Y Z A B C D E F G H I J

32
Principles of Programming & Coding Coding and encryption

A man writing codes on his laptop

where the key dictionary is made by starting with The table is built by moving left to right and from
“code” letter K and then writing the alphabet as if top to bottom (or other visual pattern as in a spiral)
on a loop. To encode the plain-text, “The World Is by first filling in the table’s cells with the keyword’s
Round,” each letter is substituted by its companion letters—avoiding duplicate letters. Then, the subse-
letter, producing the cipher-text “CRO FXAUN quent cells are filled with the remaining letters of
SB AXDWN.” To disguise word lengths and to add the alphabet, using the “I” to represent the “J” to re-
complexity, the cipher-text was sometimes blocked duce the alphabet to 25 letters (instead of 26). Both
into fixed-length groups of letters such as “CROF the coder and the decoder need to know the both the
XAUN SBAX DWN.” To decipher the cipher-text, keyword and the conventions used to construct the
one needed to know only the “code” letter. Though common cipher-key.
simple and initially confusing, substitution ciphers The coder first breaks the plain-text into two-letter
now are easily broken using frequency patterns of let- pairs and uses the cipher-key via a system of rules:
ters and words. Variations of the substitution cipher
involve the suppression of letter frequencies, syllabic If double letters occur in the plain-text, insert
substitutions, or polyalphabetic substitutions such as an X between them.
the Vigenère or Beaufort ciphers. Rewrite the plain-text as a sequence of two-letter
The Playfair Square cipher used by Great Britain pairs, using an X as a final filler for last letter-pair.
in World War I is a substitution cipher, but its encryp- If the two letters lie in the same row, replace
tion of letter pairs in place of single letters is more each letter by the letter to its right (for example,
powerful yet easy to use. The cipher-key is a 5 × 5 CS becomes SB).
table initiated by a key word, such as “mathematics.” If the two letters lie in the same column, replace
each letter by the letter below it (TS becomes SK
Exchange Table Model and PW becomes WA).
M A T H E If the two letters lie at corners of a rectangle
embedded in the square, replace them by their
I C S B D
counterpart in the same rectangle (TB becomes
F G K L N SH and CR becomes PB).
O P Q R U
Using this cipher-key, the plain-text “The World Is
V W X Y Z Round” becomes first

33
Coding and encryption Principles of Programming & Coding

TH EW OR LD IS RO UN DX As the “receiver,” start with the product n equal


to two very large prime numbers p and q.
which when encoded, becomes Choose a number e relatively prime to (p-1)(q-1).
The published encryption key is the pair (n,e).
HE ZA PU BN CB UP ZU ZS. Change plain-text letters to equivalent number
forms using a conversion such as A=2, B=3, C=4,… ,
The same cipher-key is used to decode this mes- Z=27.
sage, but the rules are interpreted in reverse. It is Using the published encryption key, the
quite difficult to decode this cipher-text without ac- “sender” encrypts each number z using the for-
cess to both the keyword and the conventions to con- mula m ≡ z
struct the common cipher-key, though very possible. e
mod(n), with the new number sequence being
The problem with all substitution and transpo- the cipher-text.
sition encryption systems is their dependence on To decode the text, the “receiver” not only
shared secrecy between the coders and the intended knows both e and the factors of n but also the large
decoders. To transmit plain-text via cipher-text and primes p and q as prime factors of n.
then decode it back to public-text successfully, both Then, the decryption key d is private but can
parties would have to know and use common systems, be computed by the “receiver” using an inverse
common key-words, and common visual arrange- relationship ed ≡ 1 mod(p-1)(q-1),which allows
ments. In turn, privacy is required, since these sys- the decoding of the encrypted number into a set
tems are of no value if the user learns the key-word of numbers that can be converted back into the
or is able to use frequency techniques of word/letter plain-text.
patterns to break the code. A more complicated and
secure encryption process was needed, but it was not
The RSA public key system works well, but the re-
invented until the 1970s.
quired primes p and q have to be very large and often
The revolutionary idea in encryption was the idea
involve more than 300 digits. If they are not large,
of a public key system, where the encryption key is
powerful computers can determine the decryption
known by everyone (that is, the public). However,
key d from the given encryption key (n,e) by factoring
the twist was that this knowledge was not useful in
the number n. This decryption is possible because
figuring out the decryption key, which was not made
of the fact that, while computers can easily multiply
public. The RSA public-key cipher, invented in 1977
large numbers, it is much more difficult to factor
by Ronald Rivest, Adi Shamir, and Leonard Adleman
large numbers on a computer.
(“RSA” stands for the names of the inventors), all of
Regardless of its type, a cryptographic system must
whom have bachelor’s degrees in mathematics and
meet multiple characteristics. First, it must reflect
advanced degrees in computer science, is still used
the user’s abilities and physical context, avoiding ex-
today thanks to powerful mathematics and powerful
treme complexity and extraneous physical apparatus.
computer systems.
Second, it must include some form of error checking,
In a RSA system, the “receiver” of the intended
so that small errors in composition or transmission do
message is the driver of the process. In lieu of the
not render the message into meaningless gibberish.
“sender,” the receiver chooses both the encryption
Third, it must ensure that the decoder of the cipher-
key and the matching decryption key. In fact, the
text will produce a single, meaningful plain-text.
“receiver” can make the encryption key public in a
There are many mathematicians working for gov-
directory so any “sender” can use it to send secure
ernment agencies like the National Security Agency
messages, which only the “receiver” knows how to de-
(NSA), as well as for private companies that are devel-
crypt. Again, the latter decryption process is not even
oping improved security for storage and transmission
known by the “sender.”
of digital information using these principles. In fact,
Because the problem is quite complex and uses
the NSA is the largest employer of mathematicians in
both congruence relationships and modular arith-
the United States.
metic, only a sense of the process can be described
as follows: —Jerry Johnson

34
Principles of Programming & Coding Color coding

Bibliography Lewand, Robert. Cryptological Mathematics.


Washington, DC: Mathematical Association of
Churchhouse, Robert. Codes and Ciphers. Cambridge,
America, 2000.
England: Cambridge University Press, 2002.
Smith, Laurence. Cryptography: The Science of Secret
Kahn, David. The Codebreakers: The Story of Secret
Writing. New York: Dover Publications, 1971.
Writing. New York: Macmillan, 1967.

COLOR CODING
FIELDS OF STUDY Coloring Code for Clarity
Computer code is, first and foremost, a set of
Programming Methodologies; Software Development
commands intended for a computer. In practice,
however, the process of writing software requires pro-
ABSTRACT grammers to spend time reading their code and their
colleagues’ code. Reading and understanding code
Many text editors display different elements of a can be daunting and time-consuming.
computer programming or markup language in dif- In order to facilitate the process of reading code,
ferent colors. The goal of color coding is to make it text editors and integrated development environ-
easier for programmers to write, read, and under- ments (IDEs) began incorporating visual aids in the
stand source code. Syntax highlighting color-codes late 1980s. Among these aids is syntax highlighting, a
parts of the syntax of a programming language, such technique that assigns various colors (and sometimes
as keywords. Semantic highlighting color-codes other fonts and styles) to important elements of the code’s
aspects, such as variables, based on the code content. syntax. For example, numbers could be represented
in green and keywords in blue.
PRINCIPAL TERMS The goal of color coding is to reduce the amount of
time it takes programmers to understand the purpose
ƒƒ annotation: in computer programming, a com- of a segment of code. When a program’s source code
ment or other documentation added to a pro- is displayed in one color, programmers must read each
gram’s source code that is not essential to the line carefully for full comprehension. Color coding
execution of the program but provides extra infor- aims to allow programmers to skim like-colored words
mation for anybody reading the code.
and patterns and to help identify errors.
ƒƒ class: in object-oriented programming, a category Studies examining the effects of color coding on
of related objects that share common variables comprehension have had mixed findings. A 2006
and methods. Finnish experiment found no benefit to color coding
ƒƒ command: an instruction given by a user to a com- when programmers searched code by sight. Such
puter that directs the computer to perform a spe- searches are crucial to comprehension and debug-
cific, predefined task. ging. By contrast, two small Cambridge University
ƒƒ method: in object-oriented programming, a pro- experiments from 2015 found that colored code sig-
cedure or function specific to objects of a partic- nificantly reduced code-writing time among novice
ular class.
programmers but less so among experienced ones.
ƒƒ syntax: in computer programming, the rules that
Interestingly, the Finnish subjects favored colored
govern how the elements of a programming lan- code even when its effectiveness was not shown to be
guage should be arranged.
significant.
ƒƒ variable: in computer programming, a symbolic
name that refers to data stored in a specific loca- Approaches to Color Coding
tion in a computer’s memory, the value of which For a text editor or IDE to use color coding, it must
can be changed. know which language a given segment of code was

35
Color coding Principles of Programming & Coding

SAMPLE PROBLEM

Consider the following code segment,


written in the Java programming language.
Even those who are unfamiliar with Java can
appreciate how the coloring might make it
easier to read the code.
Identify which colors in the segment corres-
pond to the language elements listed below.
For each element, list as many colors as apply.
Using colored font in code does not change the function of the code
itself, but it does make the code easier to read. This block of code Class names
has separate colors for commands, variables, functions, strings, and Comments
comments; a coder can use sight to quickly find particular elements. Language keywords
Variable names
Literal values
Method names

Answer:
Dark blue
Dark green
Purple
Orange, grey, and black
Red
written in and must understand the syntax rules for Bright green
that language. Some editors support only a single
programming language. Such editors assume that all
code they encounter is in the language they support. • Keywords (such as for, true, or if)
More versatile editors examine file extensions and • Literal values and constants (such as “Hello
the content of source code files to determine which world,” 3.14)
language is being used. • Matching paired brackets (if the cursor is adjacent
Some editors rely entirely upon built-in knowl- to such a character)
edge about the syntax of certain languages for color • Comments and annotations (such as //fix this)
coding. More versatile editors allow for the installa-
tion of language extensions or plug-ins. This makes A powerful extension of syntax highlighting, called
it possible to use highlighting with languages about “semantic highlighting,” attempts to make further
which the editor had no prior knowledge. coloring decisions based on the meaning of the code.
Some text editors allow programmers to cus- Semantic highlighting may expand color coding to
tomize the details of their color coding. This may the names of variables (sometimes using a different
include choices about which elements to color and color for each), classes, and methods.
which colors to use.
Color Coding in the Real World
Color coding has become widely used in computer
Commonly Colored Elements programming. Not only is it supported by most major
Standard approaches to syntax highlighting assign code editors, but code-sharing websites have adopted
colors to a range of syntactical elements, often in- the technique as well. Almost anywhere code is dis-
cluding the following: played, it is in color. Although the effectiveness of

36
Principles of Programming & Coding Combinatorics

color coding remains under debate, colorful code Interest Group, 2015, www.ppig.org/sites/default/
appears to have a firm foothold in the world of files/2015-PPIG-26th-Dimitri.pdf. Accessed 22
programming. Feb. 2017.
Each new language attempts to fix inefficiencies Everitt, Paul. “Make Sense of Your Variables at a
of prior languages, and with each IDE update comes Glance with Semantic Highlighting.” PyCharm
new features aimed at further streamlining the task Blog, JetBrains, 19 Jan. 2017, blog.jetbrains.com/
of programming. At each step, programmers spend pycharm/2017/01/make-sense-of-your-variables-
less time puzzling over tools such as visual aids and at-a-glance-with-semantic-highlighting/. Accessed
more time imagining elegant solutions to difficult 17 Feb. 2017.
problems. Hakala, Tuomas, et al. “An Experiment on the Effects
of Program Code Highlighting on Visual Search
—Joel Christophel and Daniel Showalter, PhD
for Local Patterns.” 18th Workshop of the Psychology of
Programming Interest Group, U of Sussex, Sept. 2006,
Bibliography www.ppig.org/papers/18th-hakala.pdf. Accessed
Beelders, Tanya R., and Jean-Pierre L. Du Plessis. 7 Mar. 2017.
“Syntax Highlighting as an Influencing Factor Kingsley-Hughes, Adrian, and Kathie Kingsley-
When Reading and Comprehending Source Hughes. Beginning Programming. Wiley Publishing,
Code.” Journal of Eye Movement Research, vol. 9, no. 2005.
1, 2016, pp. 2207–19. Sarkar, Advait. “The Impact of Syntax Colouring
Deitel, Paul J., et al. Preface. Android: How to Program, on Program Comprehension.” Psychology of
Global Edition. 2nd ed., Pearson, 2015, pp. 19–30. Programming Interest Group, 2015, www.ppig.org/
Dimitri, Giovanna Maria. “The Impact of Syntax sites/default/files/2015-PPIG-26th-Sarkar.pdf.
Highlighting in Sonic Pi.” Psychology of Programming Accessed 17 Feb. 2017.

COMBINATORICS
FIELDS OF STUDY ƒƒ combinatorial design: the study of the creation
and properties of finite sets in certain types of de-
Information Technology; Algorithms; System Analysis
signs.
ƒƒ enumerative combinatorics: a branch of combina-
ABSTRACT torics that studies the number of ways that certain
patterns can be formed using a set of objects.
Combinatorics is a branch of mathematics that is con-
ƒƒ graph theory: the study of graphs, which are dia-
cerned with sets of objects that meet certain condi-
grams used to model relationships between ob-
tions. In computer science, combinatorics is used to
jects.
study algorithms, which are sets of steps, or rules, de-
vised to address a certain problem. Basics of Combinatorics
Combinatorics is a branch of mathematics that
studies counting methods and combinations, per-
PRINCIPAL TERMS
mutations, and arrangements of sets of objects.
ƒƒ analytic combinatorics: a method for creating pre- For instance, given a set of fifteen different objects,
cise quantitative predictions about large sets of combinatorics studies equations that determine how
objects. many different sets of five can be created from the
ƒƒ coding theory: the study of codes and their use in original set of fifteen. The study of combinatorics is
certain situations for various applications. crucial to the study of algorithms. Algorithms are sets

37
Combinatorics Principles of Programming & Coding

C
A B

D
A B

The Konigsberg bridge problem is a common example of combinatorial structures used to identify and quan-
tify possible combinations of values . Each landmass becomes a vertex or node, and each bridge becomes an
arc or edge . In computer science, these graphs are used to represent networks or the flow of computation .

of rules, steps, or processes that are linked together Combinatorics Applications


to address a certain problem . There are many different applications for combina-
torics in analytic mathematics, engineering, physics,
The Science of Counting and and computer science . Among the most familiar
Combinations basic examples of combinatorics is the popular game
Combinatorics is often called the “science of sudoku . The game challenges players to fill in the
counting .” It focuses on the properties of finite sets blanks in a “magic square” diagram with specific
of objects, which do not have infinite numbers of column and row values . Sudoku puzzles are an ex-
objects and so are theoretically countable . The pro- ample of combinatorial design, which is a branch of
cess of describing or counting all of the items in a combinatorics that studies arrangements of objects
specific set is called “enumeration .” Combinatorics that have symmetry or mathematical/geometric bal-
also includes the study of combinations, a process of ance between the elements .
selecting items from a set when the order of selection Combinatorics is also crucial to graph theory .
does not matter . Finally, combinatorics also studies Graph theory is a field of mathematics that deals
permutations . Permutations involve selecting or ar- with graphs, or representations of objects in space .
ranging items in a list, when the order of arrange- Graphs are used in geometry, computer science, and
ment is important . Combinatorics also studies the other fields to model relationships between objects .
relationships between objects organized into sets in In computer science, for instance, graphs are typi-
various ways . cally used to model computer networks, computa-
There are numerous subfields of combina- tional flow, and the structure of links within websites .
torics used to study sets of objects in different ways . Combinatorics is used to study the enumeration of
Enumerative combinatorics is the most basic branch graphs . This can be seen as counting the number of
of the field . It can be described as the study of different possible graphs that can be used for a cer-
counting methods used to derive the number of ob- tain application or model .
jects in a given set . By contrast, analytic combinatorics
is a subfield of enumerative combinatorics . It deals Combinatorics in Algorithm Design
with predicting the properties of large sets of objects, In computer science, combinatorics is used in the cre-
using quantitative analysis . All combinatorics analysis ation and analysis of algorithms . Algorithms are sets
requires detailed knowledge of calculus . Many sub- of instructions, computing steps, or other processes
fields make extensive use of probability theory and that are linked together to address a certain compu-
predictive analysis . tational problem . As algorithms are essentially sets,

38
Principles of Programming & Coding Comment programming

the steps within algorithms can be studied using com- applicable to many academic and practical fields.
binatorial analysis, such as enumeration or permuta- Combinatorics influences many aspects of computer
tion. As combinatorics can help researchers to find design and programming including the develop-
more efficient arrangements of objects, or sets, com- ment of codes and the precise study of information
binatorial analysis is often used to test and assess the and arrangement of data.
efficiency of computer algorithms. Combinatorics is
—Micah L. Issitt
also key to the design of sorting algorithms. Sorting
algorithms allow computers to sort objects (often
pieces of data, web pages, or other informational ele- Bibliography
ments), which is a necessary step in creating effective Beeler, Robert A., How to Count: An Introduction to
algorithms for web searching. Combinatorics. New York: Springer, 2015. Print.
“Combinatorics.” Mathigon. Mathigon, 2015. Web. 10
Combinatorics in Coding Feb. 2016.
Combinatorics is also used in coding theory, the study Faticoni, Theodore G., Combinatorics: An Introduction.
of codes and their associated properties and charac- New York: Wiley, 2014. Digital file.
teristics. Codes are used for applications, including Guichard, David. “An Introduction to Combinatorics
cryptography, compressing or translating data, and and Graph Theory.” Whitman. Whitman Coll., 4
correcting errors in mathematical, electrical, and Jan 2016. Web. 10 Feb. 2016.
information systems. Coding theory emerged from Roberts, Fred S., and Barry Tesman. Applied
combinatorial analysis. These two branches of mathe- Combinatorics. 2nd ed. Boca Raton: Chapman,
matics are distinct but share theories and techniques. 2012. Print.
Combinatorics is an advanced field of study. The Wagner, Carl. “Choice, Chance, and Inference.”
arrangement, organization, and study of relation- Math.UTK.edu. U of Tennessee, Knoxville, 2015.
ships between objects provides analytical information Web. 10 Feb. 2016.

COMMENT PROGRAMMING
FIELDS OF STUDY execution of the program but provides extra infor-
mation for anybody reading the code.
Software Development; Coding Techniques; Computer
ƒƒ class: in object-oriented programming, a category
Science
of related objects that share common variables
and methods.
ABSTRACT ƒƒ command: an instruction given by a user to a com-
Comments are annotations that are used to explain puter that directs the computer to perform a spe-
the purpose and structure of the code used to create cific, predefined task.
computer programs. The use of appropriate com- ƒƒ method: in object-oriented programming, a pro-
ments makes it more efficient to create, debug, and cedure or function specific to objects of a partic-
maintain computer programs and enables program- ular class.
mers to work together more effectively. ƒƒ syntax: in computer programming, the rules that
govern how the elements of a programming lan-
guage should be arranged.
PRINCIPAL TERMS
ƒƒ variable: in computer programming, a symbolic
ƒƒ annotation: in computer programming, a com- name that refers to data stored in a specific loca-
ment or other documentation added to a pro- tion in a computer’s memory, the value of which
gram’s source code that is not essential to the can be changed.

39
Comment programming Principles of Programming & Coding

Using Comments to Annotate Code code statement itself. A more effective comment
Anyone familiar with the syntax of a computer pro- could be written as follows.
gramming language can read the code itself to gain
a basic understanding what a statement or series of // Variable stores applicant age for use in deter-
statements does. However, the code itself cannot re- mining eligibility status for
veal to a programmer why a statement or series of // Social Security benefits.
statements was used or the overall purpose of an en-
tire program or a section of code. This can make com- This comment explains succinctly why the vari-
puter programs difficult to understand, debug, and able is being declared and how the variable functions
maintain. To address this problem, programmers use within the program.
comments to annotate the code that they create. Comments are expected in several places. An entire
Comments can be used to annotate many types program typically has a comment at the beginning.
of computer code. For example, an explanation of Called a “header comment,” this states the author,
why a certain command was used can be provided in the date of creation, the date of last update, the pur-
a comment. Comments can also be used to describe pose of the program, and its function. Each function
functions, subroutines, classes, and methods, and to should be called out, as should any single line of code
explain why variables are used. that is not intuitive. Too many in-line comments may
Comments are written in plain language, not in indicate that the code is overly complex. Or, it may
the syntax of a programming language. However, mean that the names for variables, constants, func-
each programming language provides its own rules tions, and the like are not descriptive enough.
that allow the program to distinguish properly
marked comments from executable lines of code and Using Comments to Improve Software
to ignore them. For example, a comment might be Development
distinguished by using two forward slashes before the Creating effective and useful comments is extremely
text that makes up the comment, as follows: important in real-world programming environments,
where teams of programmers often work together
// This is a comment. on complex applications. For example, an appli-
cation used to track client data for a major insurer
How to Create Useful Comments might consist of tens of thousands of lines of code
There is no good substitute for annotation. Although containing numerous variables, methods, classes,
this takes time, the time spent annotating code can commands, and other statements. Such projects are
greatly reduce the time spent on debugging and usually developed over many weeks, months, or even
maintenance. Comments may be added before, years by dozens of programmers. Thus, proper use of
while, or after the code is written. Updating com- comments allows programmers to quickly understand
ments to reflect changes in the code is just as critical the purpose of and interactions among lines of code
as adding them at the start. written by other programmers and at other times.
Because annotation takes valuable programming This greatly increases the efficiency with which appli-
time, learning to create short but effective and useful cations can be developed and updated. Consider the
comments is an important skill. Comments should not following code example in the Visual Basic language:
simply restate what a line or block of code does, but
rather focus on explaining why the code does what it Dim y as integer
does and how it relates to the overall structure and func- Dim t as integer
tion of the program. Consider the following comment y = GetYesterdaysTotal()
associated with the declaration for the variable age. t = GetTodaysTotal()
n=y+t
// Declare an integer variable named age. echo z

This comment does not convey any meaning or While that example may be syntactically correct,
information that could not be determined from the the statements themselves do little to explain the

40
Principles of Programming & Coding Comparison operators

purpose of the code. However, comments and clearer programming languages make it difficult to describe
names can be used to make the purpose of the code code fully without using comments, even if the pro-
clearer, as follows. gram has few functions and a single author. Larger
projects that provide complex functionality and in-
// Declare a variable eggsYesterday to hold the volve multiple programmers working together are
number of eggs laid yesterday. exponentially more difficult to manage. The consis-
Dim eggsYesterday as integer tent use of appropriate comments provides signifi-
// Declare a variable eggsToday to hold the cant benefits to programmers and results in greater
number of eggs laid today. efficiency, lower costs, and more robust and effective
Dim eggsToday as integer code.
// Retrieve total number of eggs laid yesterday
—Maura Valentino, MSLIS
from Egg1 database.
eggsYesterday = GetYesterdaysTotal()
// Retrieve total number of eggs laid today from Bibliography
Egg1 database. Friedman, Daniel P., and Mitchell Wand. Essentials of
eggsToday = GetTodaysTotal() Programming Languages. 3rd ed., MIT P, 2008.
// Calculate total number of eggs laid in past two Haverbeke, Marijn. Eloquent JavaScript: A Modern
days. Introduction to Programming. 2nd ed., No Starch
eggsNow = eggsYesterday + eggsToday Press, 2014.
// Display total number of eggs laid in past two days. MacLennan, Bruce J. Principles of Programming
echo eggsNow Languages: Design, Evaluation, and Implementation.
3rd ed., Oxford UP, 1999.
Along with comments, adding line breaks and in- Schneider, David I. An Introduction to Programming
denting nested blocks of code make the code easier using Visual Basic. 10th ed., Pearson, 2016.
to read and understand. Scott, Michael L. Programming Language Pragmatics.
4th ed., Morgan Kaufmann Publishers, 2016.
Comments Make Good Code More Useful Van Roy, Peter, and Seif Haridi. Concepts, Tech-
Programmers focus on writing effective code that has niques, and Models of Computer Programming. MIT P,
correct syntax. However, the inherent limitations of 2004.

COMPARISON OPERATORS
FIELDS OF STUDY flow in a computer program. They thereby support
complex decision making in computer programs.
Software Development; Coding Techniques;
Computer Science
PRINCIPAL TERMS
ABSTRACT
ƒƒ array: a data structure holding a fixed sized collec-
Comparison operators compare two values in an ex- tion of values or variables of the same type.
pression that resolves to a value of true or false. The ƒƒ Boolean operator: one of a predefined set of
main comparison operators are equal to, not equal words—typically AND, OR, NOT, and variations—
to, greater than, greater than or equal to, less than, that is used to combine expressions that resolve to
and less than or equal to. Comparison operators are either-or values.
used in conditional expressions to determine if one ƒƒ conditional expression: a statement executed based
block of code or another executes, thus controlling on whether a condition is found to be true or false.

41
Comparison operators Principles of Programming & Coding

Operators used to compare the value of a variable (x) to a given value are called “comparison oper-
ators.” The table provides multiple comparison operators, definitions of the operators, and statements
using them. True and false examples of values for the variable are provided for each statement.

ƒƒ object: in object-oriented programming, a self- evaluates to true if x equals 4 or less but evaluates to
contained module of data belonging to a partic- false if x equals 5 or more. If x and y are string vari-
ular class that shares the variables and methods ables, x equals y evaluates to true only if the strings are
assigned to that class. the same length and are composed of the same char-
ƒƒ string: in computer programming, a data type con- acters in the same order. Therefore, “abc” is equal to
sisting of characters arranged in a specific sequence. “abc” but “abc” is not equal to “bac.” For some opera-
tions, only data of the same type can be compared.
Understanding Comparison Operators For example, if x is an integer and y is a string, then
In computer programming, comparison operators expression x is greater than y would return an error.
are used in conditional expressions to determine Some languages, such as JavaScript and MySQL, use
which block of code executes, thus controlling the numeric values for the characters in a string to make
program flow. Comparison operators compare two the comparison.
values in an expression that resolves to a value of Arrays are not typically compared using compar-
true or false. In if-then-else statements, comparison ison operators. Different languages return different
operators enable different blocks of code to execute results when comparing arrays for equivalence. For
based on whether the result of the comparison is true example, the C language returns a pointer to the
or false. Boolean operators can be used to combine both array’s location in memory and then compares
either-or expressions to create complex Boolean ex- the memory locations for equivalence. Thus, the con-
pressions that also resolve to true or false. This allows tents of the arrays, their stored values, are not directly
more complex scenarios to be tested to determine compared.
which block of code should execute. Similarly, when objects are compared with the
There are six main comparison operators: equal “equal to” comparison operator in languages like
to, not equal to, greater than, greater than or equal JavaScript or C#, the comparison operator checks
to, less than, and less than or equal to. Different pro- whether the objects are of the same class and does
gramming languages use different syntax to express not compare the data stored within the objects. In
these operators, but the meanings are the same. the language PHP, however, the values are also as-
Some languages include additional operators, such sessed. It is thus important to be aware of the rules of
as the equal value and equal type operator (===) and the programming language in question.
the not equal value or not equal type operator (!==)
in JavaScript. Using Comparison Operators
Comparison operators can compare a variety Comparison operators are used in computer pro-
of data types, including integers and strings. For grams in many ways. For example, personal infor-
example, if x is an integer variable, x is less than 5 mation, stored in a database, could be compared

42
Principles of Programming & Coding Comparison operators

to eligibility requirements for a program or benefit. Next, an if statement is used to execute different
Using the Boolean operator AND allows the program blocks of code depending on which value is returned
to check two conditions, both of which must be true by the function.
to return a value of true.
IF code = 1 THEN
IF candidateAge > 65 AND candidateAnnualIn- Display a message that the update was successful.
come < 250,000 THEN IF code = 2 THEN
SocialSecurityEligible() Display a message that the database was not
END IF found.
IF code = 3 THEN
They are also used to compare strings. Here an- Display a message that the user was not found.
other Boolean operator, OR, has been used to check ELSE
two comparisons, and if either is true, the entire Display a message that an unknown error has
statement returns a value of true and the function is occurred.
called: END IF

IF userState = “NY” OR userState = “New York” The Power of Comparison


THEN Comparison operators are used in a wide variety of
NewYorkResident() development scenarios. They are used in authenti-
END IF cation routines, where exact comparison is crucial.
For example, a user’s credentials may be checked
Comparison operators are an important devel- against a database of authorized users before access
opment tool because of their support for the if-else to the database is permitted. Comparison opera-
conditional logic. With the added power of Boolean tors may also be used for more mundane tasks such
logic, complex decision-making structures are pos- as processing discount codes. When a user types
sible. For instance, “branching,” or “selection,” al- in a discount code, it is compared to valid codes,
lows for various courses of action to be taken (that is, and if the code is valid, the applicable discount is
different else-if statements to execute) depending on applied.
the condition.
—Maura Valentino, MSLIS
However, using comparison operators incor-
rectly can lead to errors that are difficult to correct.
Programmers must ensure they are aware of how Bibliography
comparison operators behave when used to compare
Friedman, Daniel P., and Mitchell Wand. Essentials of
different types of data in the using different com-
Programming Languages. 3rd ed., MIT P, 2008.
puter languages, paying particular attention to how
Haverbeke, Marijn. Eloquent JavaScript: A Modern
arrays, objects, and strings are handled.
Introduction to Programming. 2nd ed., No Starch
Press, 2014.
Comparison Operators in Practice MacLennan, Bruce J. Principles of Programming
Comparison operators are often used in process Languages: Design, Evaluation, and Implementation.
codes. In the following example, an error code is 3rd ed., Oxford UP, 1999.
returned from a function that updates a customer’s Nixon, Robin. Learning PHP, MySQL, JavaScript, CSS
name in a database. Comparison operators are then & HTML5: A Step-by-Step Guide to Creating Dynamic
used to determine which error has occurred and Websites. 3rd ed., O’Reilly, 2014.
then to transfer control to the appropriate block of Scott, Michael L. Programming Language Pragmatics.
code. First, the function is called and the value it re- 4th ed., Morgan Kaufmann Publishers, 2016.
turns is stored in a variable named code. Van Roy, Peter, and Seif Haridi. Concepts, Tech-
niques, and Models of Computer Programming. MIT P,
code = updateDatabase(“Jane Smith”) 2004.

43
Computer animation Principles of Programming & Coding

COMPUTER ANIMATION
FIELDS OF STUDY objects, and backgrounds was created frame by
frame. Each frame was drawn by hand. This time-
Digital Media; Graphic Design
consuming and difficult process necessitated the cre-
ation of dozens of individual frames for each second
ABSTRACT of film.
Computer animation is the creation of animated As computer technology developed, computer
projects for film, television, or other media using researchers and animators began to experiment
specialized computer programs. As animation proj- with creating short animations using computers.
ects may range from short, simple clips to detailed Throughout the 1960s, computers were used to
and vibrant feature-length films, a wide variety of create 2D images. Ed Catmull, who later founded the
animation software is available, each addressing the studio Pixar in 1986, created a 3D animation of his
needs of animators. The computer animation pro- hand using a computer in 1972. This was the first 3D
cess includes several key steps, including modeling, computer graphic to be used in a feature film when
keyframing, and rendering. These stages are typically it appeared in Futureworld (1976). Early attempts at
carried out by a team of animators. computer animation were found in live-action films.
The 1986 film Labyrinth, for instance, notably features
PRINCIPAL TERMS a computer-animated owl flying through its opening
credits. As technology improved, computer ani-
ƒƒ animation variables (avars): defined variables that mation became a major component of special effects
control the movement of an animated character in live-action media. While cel animation continued
or object. to be used in animated feature films, filmmakers
ƒƒ keyframing: the process of defining the first and began to include some computer-generated ele-
last—or key—frames in an animated transition. ments in such works. The 1991 Walt Disney Studios
ƒƒ render farms: large computer systems dedicated film Beauty and the Beast, for instance, featured a ball-
to rendering animated content. room in one scene that was largely created using a
ƒƒ 3D rendering: the process of creating a 2D anima- computer.
tion using 3D models. In 1995, the release of the first feature-length
ƒƒ virtual reality: a form of technology that enables computer-animated film marked a turning point in
the user to view and interact with a simulated en- the field of animation. That film, Toy Story, was cre-
vironment. ated by Pixar, a pioneer in computer animation.
Over the following decades, Pixar and other studios,
History of Computer Animation including Disney (which acquired Pixar in 2006)
Since the early twentieth century, the field of anima- and DreamWorks, produced numerous computer-
tion has been marked by frequent, rapid change. animated films. Computer animation became a
Innovation in the field has been far reaching, fil- common process for creating animated television
tering into film, television, advertising, video games, shows as well as video games, advertisements, music
and other media. It was initially an experimental videos, and other media.
method and took decades to develop. Computer ani- In the early twenty-first century, computer anima-
mation revitalized the film and television industries tion also began to be used to create simulated envi-
during the late twentieth and early twenty-first centu- ronments accessed through virtual reality equipment
ries, in many ways echoing the cultural influence that such as the head-mounted display Oculus Rift. Much
animation had decades before. of the computer-animated content created during
Prior to the advent of computer animation, most this time featured characters and surroundings that
animated projects were created using a process that appeared 3D. However, some animators opted to
later became known as “traditional,” or “cel,” anima- create 2D animations that more closely resemble tra-
tion. In cel animation, the movement of characters, ditionally animated works in style.

44
Principles of Programming & Coding Computer animation

From designing the original animation model to creating algorithms that control the movement of fluids, hair,
and other complex systems, computer software has drastically changed the art of animation. Through software
that can manipulate polygons, a face can be rendered and further manipulated to create a number of images
much more efficiently than with hand-drawn illustrations. Thus, the detail of the imaging is increased, while the
time needed to develop a full animation is reduced.

Three-Dimensional Computer Animation reportedly used several hundred avars to control the
Creating a feature-length computer-animated pro- characters’ mouths alone. Using such variables gives
duction is a complex and time-intensive process that animated characters a greater range of motion and
is carried out by a large team of animators, working often more realistic expressions and gestures. After
with other film-industry professionals. When cre- the characters and objects are modeled and ani-
ating a 3D computer-animated project, the anima- mated, they are combined with backgrounds as well
tion team typically begins by drawing storyboards. as lighting and special effects. All of the elements are
Storyboards are small sketches that serve as a rough then combined to transform the 3D models into a 2D
draft of the proposed scenes. image or film. This process is known as 3D rendering.
Next, animators transform 2D character designs
into 3D models using animation software. They use Two-Dimensional Computer Animation
animation variables (avars) to control the ways in Animating a 2D computer-animated work is some-
which the 3D characters move, assigning possible di- what different from its 3D counterpart, in that it does
rections of movement to various points on the charac- not rely on 3D modeling. Instead, it typically features
ters’ bodies. The number of avars used and the areas the use of multiple layers, each of which contains dif-
they control can vary widely. The 2006 Pixar film Cars ferent individual elements. This method of animating

45
Computer memory Principles of Programming & Coding

typically features keyframing. In this procedure, ani- systems in use. Rendering, for example, often de-
mators define the first and last frames in an animated mands a sizable amount of processing power. As
sequence and allow the computer to fill in the move- such, many studios make use of render farms, large,
ment in between. This process, which in traditionally powerful computer systems devoted to that task.
animated films was a laborious task done by hand, is
—Joy Crelin
often known as “inbetweening,” or “tweening.”

Tools
Various animation programs are available to anima- Bibliography
tors, each with its own strengths and weaknesses. Carlson, Wayne. “A Critical History of Computer
Some animation software, such as Maya and Cinema Graphics and Animation.” Ohio State University.
4D, are geared toward 3D animation. Others, such Ohio State U, 2003. Web. 31 Jan. 2016.
as Adobe Flash, are better suited to 2D animation. Highfield, Roger. “Fast Forward to Cartoon Reality.”
Adobe Flash has commonly been used to produce 2D Telegraph. Telegraph Media Group, 13 June 2006.
cartoons for television, as it is considered a quick and Web. 31 Jan. 2016.
low-cost means of creating such content. Animation Parent, Rick. Computer Animation: Algorithms and
studios such as Pixar typically use proprietary anima- Techniques. Waltham: Elsevier, 2012. Print.
tion software, thus ensuring that their specific needs “Our Story.” Pixar. Pixar, 2016. Web. 31 Jan. 2016.
are met. Sito, Tom. Moving Innovation: A History of Computer
In addition to animation software, the process Animation. Cambridge: MIT P, 2013. Print.
of computer animation relies heavily on hardware, Winder, Catherine, and Zahra Dowlatabadi. Producing
as many steps in the process can be taxing for the Animation. Waltham: Focal, 2011. Print.

COMPUTER MEMORY
FIELDS OF STUDY ƒƒ nonvolatile memory: memory that stores informa-
tion regardless whether power is flowing to the
Computer Science; Computer Engineering;
computer.
Information Technology
ƒƒ random access memory (RAM): memory that the
computer can access very quickly, without regard
ABSTRACT
to where in the storage media the relevant infor-
Computer memory is the part of a computer used for mation is located.
storing information that the computer is currently ƒƒ virtual memory: memory used when a computer
working on. It is different from computer storage configures part of its physical storage (on a hard
space on a hard drive, disk drive, or storage medium drive, for example) to be available for use as addi-
such as CD-ROM or DVD. Computer memory is one tional RAM. Information is copied from RAM and
of the determining factors in how fast a computer moved into virtual memory whenever memory re-
can operate and how many tasks it can undertake at sources are running low.
a time. ƒƒ volatile memory: memory that stores information
in a computer only while the computer has power;
when the computer shuts down or power is cut,
PRINCIPAL TERMS
the information is lost.
ƒƒ flash memory: nonvolatile computer memory that
can be erased or overwritten solely through elec- Overview of Computer Memory
tronic signals, i.e. without physical manipulation Computer memory is an extremely important part
of the device. of configuring and using computers. Many users find

46
Principles of Programming & Coding Computer memory

MEMORY

Primary Secondary

ROM RAM Disk drives Tape drives

PROM Static Floppy Hard Optical SD USB flash


RAM disk disk memory cards drive
EPROM Dynamic
RAM
EEPROM CD R/W DVD R/W
Computer memory comes in a number of formats. Some are the primary CPU memory, such as RAM and
ROM; others are secondary memory, typically in an external form. External memory formats have changed
over the years and have included hard drives, floppy drives, optical memory, flash memory, and secure digital
(SD) memory. Adapted from the ItsAllAboutEmbedded blog.

themselves confused by the concepts of computer very quickly but holds a smaller amount of informa-
memory and computer storage. After all, both store tion than the books.
information. Storage serves a very different purpose
from memory, however. Storage is slower, because it Random and Virtual Memory
uses a series of spinning platters of magnetic disks One feature of memory that makes it much faster
and a moving read/write head. These create a tiny than other types of information storage is that it is
magnetic field that can modify the polarity of tiny a type of random access memory (RAM). Any ad-
sections of the platters to record or read informa- dress in the memory block can be accessed directly,
tion. The benefit of storage is that it is nonvolatile without having to sort through the other entries in
memory, meaning that its contents remain even the memory space. This contrasts with other types of
when the power is turned off. Computer memory, memory, such as magnetic tape, which are sequential
by contrast, is volatile memory because it only stores access devices. To get to a certain part of the tape,
information while power is flowing through the one must move forward through all the other parts of
computer. the tape that come first. This adds to the time it takes
This can be a drawback, especially when a user to access that type of memory.
has vital information, such as a newly created but Memory, more than almost any other factor, de-
unsaved document, that is lost when a power surge termines how fast a computer responds to requests
shuts down the system. However, memory is also and completes tasks. This means that more memory
incredibly useful because it allows the computer to is constantly in demand, as consumers want systems
store information that it is currently working on. that are faster and can on more tasks at the same
For example, if a user wished to update a résumé time. When a computer is running low on memory
file saved on their hard drive, they would first tell because too many operations are going on at once,
the computer to access its storage to find a copy of it may use virtual memory to try to compensate.
the file. The computer would locate the file and Virtual memory is a technique in which the com-
then copy the file’s contents into its volatile memory puter supplements its memory space by using some
and open the document. As the user makes changes of its storage space. If the computer is almost out of
to the file, these changes are reflected only in the memory and another task comes in, the computer
memory, until the user saves them to storage. Some copies some contents of its memory onto the hard
have compared storage and memory to a librarian. drive. Then it can remove this information from
Storage is like the thousands of books the librarian memory and make space for the new task. Once the
has in the library, which they can consult if given new task is managed, the computer pulls the infor-
enough time. Memory is like the knowledge the li- mation that was copied to the hard drive and loads it
brarian carries around in their head. It is accessible back into memory.

47
Computer modeling Principles of Programming & Coding

Flash and Solid-State Memory Bibliography


Some newer types of memory straddle the line be- Biere, Armin, Amir Nahir, and Tanja Vos, eds.
tween memory and storage. Flash memory, used in Hardware and Software: Verification and Testing. New
many mobile devices, can retain its contents even York: Springer, 2013. Print.
when power to the system is cut off. However, it can Englander, Irv. The Architecture of Computer Hardware
be accessed or even erased purely through electrical and System Software: An Information Technology
signals. Wiping all the contents of flash memory and Approach. 5th ed. Hoboken: Wiley, 2014. Print.
replacing them with a different version is sometimes Kulisch, Ulrich. Computer Arithmetic and Validity:
called “flashing” a device. Theory, Implementation, and Applications. 2nd ed.
Many newer computers have incorporated solid Boston: De Gruyter, 2013. Print.
state disks (SSDs), which are similar in many respects Pandolfi, Luciano. Distributed Systems with Persistent
to flash memory. Like flash memory, SSDs have no Memory: Control and Moment Problems. New York:
moving parts and can replace hard drives because Springer, 2014. Print.
they retain their contents after system power has Patterson, David A., and John L. Hennessy. Computer
shut down. Many advanced users of computers have Organization and Design: The Hardware/Software In-
adopted SSDs because they are much faster than tra- terface. 5th ed. Waltham: Morgan, 2013. Print.
ditional computer configurations. A system can be Soto, María, André Rossi, Marc Sevaux, and Johann
powered on and ready to use in a matter of seconds Laurent. Memory Allocation Problems in Embedded
rather than minutes. Systems: Optimization Methods. Hoboken: Wiley,
—Scott Zimmer, JD 2013. Print.

COMPUTER MODELING
FIELDS OF STUDY ƒƒ simulation: a computer model executed by a com-
puter system.
Computer Science; Computer Engineering; Software
ƒƒ system: a set of interacting or interdependent
Engineering
component parts that form a complex whole.
ƒƒ variable: a symbol representing a quantity with no
ABSTRACT
fixed value.
Computer modeling is the process of designing a
representation of a particular system of interacting
Understanding Computer Models
or interdependent parts in order to study its be-
A computer model is a programmed representation
havior. Models that have been implemented and ex-
of a system that is meant to mimic the behavior of
ecuted as computer programs are called computer
the system. A wide range of disciplines, including
simulations.
meteorology, physics, astronomy, biology, and eco-
nomics, use computer models to analyze different
PRINCIPAL TERMS
types of systems. When the program representing
ƒƒ algorithm: a set of step-by-step instructions for per- the system is executed by a computer, it is called a
forming computations. simulation.
ƒƒ data source: the origin of the information used in One of the first large-scale computer models was
a computer model or simulation, such as a data- developed during the Manhattan Project by scien-
base or spreadsheet. tists designing and building the first atomic bomb.
ƒƒ parameter: a measurable element of a system that Early computer models produced output in the form
affects the relationships between variables in the of tables or matrices that were difficult to analyze. It
system. was later discovered that humans can see data trends

48
Principles of Programming & Coding Computer modeling

Develop a
Real system mathematical Computer program
model of model

Perform Perform
experiments simulations

Experimental Simulation
results results

Evaluate Evaluate
and improve and improve
model theory

Mathematical models are used to identify and understand the details influencing a real system. Computer programs allow one to evaluate
many variations in a mathematical model quickly and accurately, thus efficiently evaluating and improving models. (Adapted from Allen and
Tildesly, “Computer Simulation of Liquids.”)

more easily if the data is presented visually. For ex- that for the Voyager space probes now leaving the
ample, humans find it easier to analyze the output of solar system.
a storm-system simulation if it is presented as graphic There are several different types of models. Static
symbols on a map rather than as a table of meteoro- models simulate a system at rest, such as a building
logical data. Thus, simulations that produced graphic design. Dynamic models simulate a system that
outputs were developed. changes over time. A dynamic model could be used
Computer models are used when a system is too to simulate the effects of changing ocean tempera-
complex or hard to study using a physical model. tures on the speed of ocean currents throughout
For example, it would be difficult to create a phys- the year. A continuous model simulates a system that
ical model representing the gravitational effects of changes constantly, while a discrete model simulates
planets and moons on each other and on other ob- a system that changes only at specific times. Some
jects in space, although the National Aeronautics models contain both discrete and continuous ele-
and Space Administration (NASA) has done exactly ments. A farming model might simulate the effects of

49
Computer modeling Principles of Programming & Coding

both weather patterns, which constantly change, and model might include the orbits of the known planets,
pesticide spraying, which occurs at specified times. their distance from the sun, and the equations that
relate an object’s mass to its gravity. Certain param-
How Computer Models Work eters can be changed to test different scenarios each
To create a computer model, one must first deter- time a simulation is run. Because parameters are not
mine the boundaries of the system being modeled always constant, they can be difficult to distinguish
and what aspect of the system is being studied. For from variables at times.
example, if the model is of the solar system, it might The model must also have a data source from
be used to study the potential effect on the orbits of which it will draw the input data. This data may be
the existing planets if another planet were to enter directly entered into the program or imported
the solar system. from an external source, such as a file, database, or
To create such a model, a computer programmer spreadsheet.
would develop a series of algorithms that contain
the equations and other instructions needed to Why Computer Models Are Important
replicate the operation of the system. Variables are Computer models have provided great benefits to
used to represent the input data needed. Examples society. They help scientists explore the universe,
of variables that might be used for the solar system understand the earth, cure diseases, and discover
model include the mass, diameter, and trajectory of and test new theories. They help engineers design
the theoretical new planet. The values that define buildings, transportation systems, power systems,
the system, and thus how the variables affect each and other items that affect everyday life. With the
other, are the parameters of the system. The param- development of more powerful computer systems,
eters control the outputs of the simulation when it computer models will remain an important mecha-
is run. Different values can be used to test different nism for understanding the world and improving the
scenarios related to the system and problem being human condition.
studied. Example parameters for the solar system
—Maura Valentino, MSLIS

SAMPLE PROBLEM Bibliography


It is important to select appropriate variables Agrawal, Manindra, S. Barry Cooper, and Angsheng
and parameters when designing a computer Li, eds. Theory and Applications of Models of
model. List two variables and two parameters Computation: 9th Annual Conference, TAMC 2012,
that might be used to determine the speed of Beijing, China, May 16–21, 2012. Berlin: Springer,
a baseball after it has traveled three feet from 2012. Print.
the pitcher’s throwing hand. Edwards, Paul N. A Vast Machine: Computer Models,
Climate Data, and the Politics of Global Warming.
Cambridge: MIT P, 2010. Print.
Answer:
Kojić, Miloš, et al. Computer Modeling in Bioengineering:
Variables needed to determine the ball’s Theoretical Background, Examples and Software.
speed might include the mass and size of the Hoboken: Wiley, 2008. Print.
ball, the angle at which the ball is released, Law, Averill M. Simulation Modeling and Analysis. 5th
and the force with which it is thrown. ed. New York: McGraw, 2015. Print.
Parameters that define the system, which Morrison, Foster. The Art of Modeling Dynamic Systems:
may be changed to test different scenarios, Forecasting for Chaos, Randomness, and Determinism.
include wind speed, aerodynamic drag on the 1991. Mineola: Dover, 2008. Print.
ball, and whether or not it is raining when the Seidl, Martina, et al. UML@Classroom: An Introduction
ball is thrown. to Object-Oriented Modeling. Cham: Springer, 2015.
Print.

50
Principles of Programming & Coding Computer security

COMPUTER SECURITY
FIELDS OF STUDY Hardware Security
The first line of defense in the field of computer
Information Technology; Security
security concerns the computer hardware itself. At
a basic level, computer hardware must be stored in
ABSTRACT
secure locations where it can only be accessed by
The goal of computer security is to prevent computer authorized personnel. Thus, in many organizations,
and network systems from being accessed by those access to areas containing employee workstations is
without proper authorization. It encompasses dif- restricted. It may require a badge or other identifica-
ferent aspects of information technology, from hard- tion to gain access. Sensitive equipment such as an
ware design and deployment to software engineering enterprise server is even less accessible, locked away
and testing. It even includes user training and work- in a climate-controlled vault. It is also possible to add
flow analysis. Computer security experts update hardware security measures to existing computer
software with the latest security patches, ensure that systems to make them more secure. One example
hardware is designed appropriately and stored safely, of this is using biometric devices, such as fingerprint
and train users to help protect sensitive information scanners, as part of the user login. The computer
from unauthorized access. will only allow logins from people whose fingerprints
are authorized. Similar restrictions can be linked to
PRINCIPAL TERMS voice authentication, retina scans, and other types of
biometrics.
ƒƒ backdoor: a hidden method of accessing a com- Inside a computer, a special type of processor
puter system that is placed there without the based on a trusted platform module (TPM) can
knowledge of the system’s regular user in order to manage encrypted connections between devices.
make it easier to access the system secretly. This ensures that even if one device is compromised,
ƒƒ device fingerprinting: information that uniquely the whole system may still be protected. Another
identifies a particular computer, component, or type of security, device fingerprinting, can make it
piece of software installed on the computer. This possible to identify which device or application was
can be used to find out precisely which device ac- used to access a system. For example, if a coffee
cessed a particular online resource. shop’s wireless access point was attacked, the access
ƒƒ intrusion detection system: a system that uses hard- point’s logs could be examined to find the machine
ware, software, or both to monitor a computer or address of the device used to launch the attack. One
network in to determine when someone attempts highly sophisticated piece of security hardware is an
to access the system without authorization. intrusion detection system. These systems can take
ƒƒ phishing: the use of online communications to different forms but generally consist of a device
trick a person into sharing sensitive personal in- through which all traffic into and out of a network
formation, such as credit card numbers or social or host is filtered and analyzed. The intrusion de-
security numbers. tection system examines the flow of data to pinpoint
ƒƒ principle of least privilege: a philosophy of com- any attempt at hacking into the network. The system
puter security that mandates users of a computer can then block the attack before it can cause any
or network be given, by default, the lowest level damage.
of privileges that will allow them to perform
their jobs. This way, if a user’s account is com-
promised, only a limited amount of data will be Network Security
vulnerable. Network security is another important aspect of com-
ƒƒ trusted platform module (TPM): a standard used puter security. In theory, any computer connected to
for designing cryptoprocessors, which are special the Internet is vulnerable to attack. Attackers can try
chips that enable devices to translate plain text to break into systems by exploiting weak points in the
into cipher text and vice versa. software’s design or by tricking users into giving away

51
Computer security Principles of Programming & Coding

Hardware firewall Key encryption

INTERNET
INTERNET

Access denied
Encrypted wireless
connection

Key encryption

Software firewall

Password denied
Computer security can come in many forms to ensure data and programs are protected . Passwords
limit who can access a computer, key encryption limits who can read transmitted data, and firewalls can
limit intrusion from the Internet .

their usernames and passwords . The latter method transfer company assets to their own bank account .
is called phishing, because it involves “fishing” for Keeping privileges contained thus allows an orga-
information . Both methods can be time consuming, nization to minimize the damage an intruder may
however . So once a hacker gains access, they may in- try to inflict .
stall a backdoor . Backdoors allow easy, undetected ac-
cess to a system in future . Software Security
One way of preventing attackers from tricking Software represents another vulnerable point of
authorized users into granting access is to follow computer systems . This is because software running
the principle of least privilege . According to this on a computer must be granted certain access privi-
principle, user accounts are given the minimum leges to function . If the software is not written in a
amount of access rights required for each user to secure fashion, then hackers may be able to enhance
perform their duties . For instance, a receptionist’s the software’s privileges . Hackers can then use these
account would be limited to e-mail, scheduling, enhanced privileges to perform unintended func-
and switchboard functions . This way, a hacker who tions or even take over the computer running the
acquired the receptionist’s username and password software . In the vernacular of hackers, this is known
could not do things such as set their own salary or as “owning” a system .

52
Principles of Programming & Coding Computer-aided design (CAD)

A Moving Target Brooks, R. R. Introduction to Computer and Network


Computer security professionals have an unenviable Security: Navigating Shades of Gray. Boca Raton:
task. They must interfere with the way users wish to CRC, 2014. Digital file.
use their computers, to make sure that hardware and Jacobson, Douglas, and Joseph Idziorek. Computer
software vulnerabilities are avoided as much as pos- Security Literacy: Staying Safe in a Digital World. Boca
sible. Often, the same users whom they are trying to Raton: CRC, 2013. Print.
protect attempt to circumvent those protective mea- Schou, Corey, and Steven Hernandez. Information
sures, finding them inconvenient or downright bur- Assurance Handbook: Effective Computer Security and
densome. Computer security in these cases can be- Risk Management Strategies. New York: McGraw,
come a balancing act between safety and functionality. 2015. Print.
Vacca, John R. Computer and Information Security
—Scott Zimmer, JD
Handbook. Amsterdam: Kaufmann, 2013. Print.
Williams, Richard N. Internet Security Made Easy: Take
Bibliography Control of Your Computer. London: Flame Tree,
Boyle, Randall, and Raymond R. Panko. Corporate 2015. Print.
Computer Security. 4th ed. Boston: Pearson, 2015. Print.

COMPUTER-AIDED DESIGN (CAD)

Computer-aided design, more commonly referred to the digital age. The capabilities and uses of subse-
as CAD, is the use of computer software, programs, quent programs grew to incorporate other design
and systems to create two-dimensional (2D) vector- applications as computer technology improved
based graphics and three-dimensional (3D) models and personal computers became more affordable.
that are used extensively in the architectural, design, This, in turn, allowed businesses in various design
drafting, and civil, electrical, and mechanical engi- fields the opportunity to reduce overall production
neering industries. The introduction of CAD pro- costs by enabling fewer people to accomplish the
grams and software beginning in the 1980s signifi- work of many in a fraction of the time compared
cantly reduced manufacturing costs and expanding to traditional drafting, design, and engineering
design and concepts capabilities within these and techniques.
other fields. The value of this technology to the industry goes
beyond cost efficiency and productivity. The ad-
Overview vanced technology associated with these systems has
CAD programs and software encompass a wide va- improved manufacturing and construction tech-
riety of applications that enable users to design not niques, increasing the stability and safety of products
only machine parts, automobiles, buildings, and and buildings, with increased accuracy and with fewer
prosthetics, but also to create visual effects and com- errors introduced into the process. This improved
puter animation, video games, and maps, and geo- accuracy has also allowed designers, engineers, and
spatial applications. architects to look at improving the materials used in
CAD was first introduced in the early 1980s a project, because they can determine how the mate-
and began to transform the profession of drafting rial and structure will act in a 3D model prior to con-
by replacing the need for many manual drafting struction. CAD has also expanded the possibilities
techniques used in architecture and engineering. of construction with new shapes and complex geo-
However, many in the field credit Ivan Sutherland’s metrical designs that would have been cost-prohibi-
1963 MIT PhD dissertation, the computer program tive to carry out via traditional techniques, such as
Sketchpad, for propelling graphics technology into hand-drawing and models. Many professionals credit

53
Computer-aided design (CAD) Principles of Programming & Coding

Located at Chambersburg, Pennsylvania. A view of the Computer Aided Design/Computer Aided Manufacturing (CAD/CAM) system cen-
tral processing facility and graphic plotter at Letterkenny Army Depot.

CAD for enhancing the design process by encour- Community Choice Award that same year. A free
aging architects, designers, and engineers to concep- version of SketchUp that combines 3D modeling
tualize nontraditional shapes that can be applied to techniques with a geolocation component allows
their products and structures while simultaneously multiple users to download others’ designs and con-
improving the accuracy needed to manufacture or tribute to large multigroup projects associated with
build the resulting design. Google Earth. Widely used CAD software packages
CAD software comes in many varieties, including include CADKEY, CATIA, IEAS-MS, Inventor, Pro-E,
many that are available as open source and free SolidEdge, SolidWorks, and Unigraphics.
software. One such program is SketchUp, which
was released in the summer of 2000 and won the —Laura L. Lundin, MA

54
Principles of Programming & Coding Computer-aided design and computer-aided manufacturing software

Bibliography Sutherland, Ivan. Sketchpad: A Man-Machine


Bethune, James. Engineering Graphics with AutoCAD Graphical Communication System. Diss. MIT.
2014. San Francisco: Peachpit, 2013. Print. Cambridge: MIT, 1963. Print.
Farin, G. E. Curves and Surfaces for Computer-Aided Thakur, A. A. G. Banerjee, and S. K. Gupta. “A
Geometric Design: A Practical Guide. 4th ed. San Survey of CAD Model Simplification Techniques
Diego: Academic, 1997. Print. for Physics-Based Simulation Applications.” CAD
Innovation in Produce Design: From CAD to Virtual Computer Aided Design 41.2 (2009): 65–80.
Prototyping. Eds. Monica Bordegoni and Caterina Print.
Rizze. London: Springer, 2001. Print. Yu, Cheng, and Song Jia. Computer Aided Design:
Rao, P. N. CAD/CAM: Principles and Applications. Technology, Types, and Practical Applications. New
3rd Ed. India: Tata McGraw, 2010. Print. York: Nova, 2012. eBook Collection (EBSCOhost).
Stojkovic, Zlatar. Computer-Aided Design in Power Web. 5 June 2015.
Engineering: Application of Software Tools. New York:
Springer, 2012. Print.

COMPUTER-AIDED DESIGN AND COMPUTER-AIDED


MANUFACTURING SOFTWARE(CAD/CAM)
FIELDS OF STUDY ƒƒ solid modeling: the process of creating a 3D repre-
sentation of a solid object.
Applications; Graphic Design
ƒƒ vector: a means of storing, displaying, and editing
ABSTRACT image data based on the use of defined points and
lines.
Computer-aided design (CAD) and computer-aided
manufacturing (CAM) are software that enable
users to design products and, through the use of Applications of CAD/CAM
The term “CAD/CAM” is an acronym for “computer-
computer-guided machinery, manufacture them ac-
aided design” and “computer-aided manufacturing.”
cording to the necessary specifications. CAD/CAM
CAD/CAM refers collectively to a wide range of com-
programs are used in a wide range of industries and
puter software products. Although CAD software and
play a key role in rapid prototyping, a process that
CAM software are considered two different types of
allows companies to manufacture and test iterations
of a product. programs, they are frequently used in concert and
thus associated strongly with each other. Used pri-
marily in manufacturing, CAD/CAM software en-
PRINCIPAL TERMS
ables users to design, model, and produce various
ƒƒ four-dimensional building information modeling objects—from prototypes to usable parts—with the
(4D BIM): the process of creating a 3D model that assistance of computers.
incorporates time-related information to guide CAD/CAM software originated in the 1960s, when
the manufacturing process. researchers developed computer programs to assist
ƒƒ rapid prototyping: the process of creating phys- professionals with design and modeling. Prior to that
ical prototype models that are then tested and point, designing objects and creating 3D models was
evaluated. a time-consuming process. Computer programs de-
ƒƒ raster: a means of storing, displaying, and ed- signed to aid with such tasks represented a signifi-
iting image data based on the use of individual cant time savings. By the late 1960s, CAD programs
pixels. began to be used alongside early CAM software.

55
Computer-aided design and computer-aided manufacturing software Principles of Programming & Coding

Computer-Aided Design
Design Display Analysis Using CAD/CAM software is a two-part process that
begins with design. In some cases, the user begins de-
signing an object by using CAD software to create 2D
line drawings of the object. This process is known as
“drafting.” He or she may then use tools within the
CAD software to transform those 2D plans into a 3D
CAD CAM model. As CAD/CAM is used to create physical ob-
jects, the modeling stage is the most essential stage in
the design process. In that stage, the user creates a 3D
representation of the item. This item may be a part
for a machine, a semiconductor component, or a pro-
totype of a new product, among other possibilities.
Digital In some cases, the user may create what is known
representations as a “wire-frame model,” a 3D model that resembles
the outline of an object. However, such models do
not include the solid surfaces or interior details of
the object. Thus, they are not well suited for CAM,
the goal of which is to manufacture a solid object.
Physical As such, those using CAD software in a CAD/CAM
models context often focus more on solid modeling. Solid
modeling is the process of creating a 3D model of
an object that includes the object’s edges as well as
its internal structure. CAD software typically allows
Computer-aided design (CAD) and computer-aided manufac- the user to rotate or otherwise manipulate the cre-
turing (CAM) are used in many industries to fulfill the same basic ated model. With CAD, designers can ensure that all
goals. 3-D items are scanned and analyzed, new items are designed, the separate parts of a product will fit together as in-
and those designs can then be translated into manufactured items
through CAM, which can develop the program necessary for
tended. CAD also enables users to modify the digital
machines to properly create the new item. model. This is less time-consuming and produces less
waste than modifying a physical model.
When designing models with the intention of
CAM enabled users to instruct computer-compatible manufacturing them through CAM technology, users
machinery to manufacture various objects according must be particularly mindful of their key measure-
to digital designs. The use of CAD/CAM software be- ments. Precision and accurate scaling are crucial. As
came widespread over the following decades. such, users must be sure to use vector images when
CAD/CAM is now a key part of the manufacturing designing their models. Unlike raster images, which
process for numerous companies, from large corpo- are based on the use of individual pixels, vector im-
rations to small start-ups. Industries in which CAD/ ages are based on lines and points that have defined
CAM proved particularly useful include the automo- relationships to one another. No matter how much
tive and computer technology industries. However, a user shrinks or enlarges a vector image, the image
CAM software has also been widely used in less obvious will retain the correct proportions in terms of the
fields, including dentistry and textile manufacturing. relative placement of points and lines.
In addition to its use alongside CAM software, CAD
software functions alone in a number of fields. CAD Computer-Aided Manufacturing
software allows users to create 3D models of objects After designing an object using CAD software, a user
or structures that do not need to be manufactured may use a CAM program to manufacture it. CAM
by machine. For instance, specialized CAD software programs typically operate through computer nu-
are used in architecture to design floor plans and 3D merical control (CNC). In CNC, instructions are
models of buildings. transmitted to the manufacturing machine as a series

56
Principles of Programming & Coding Computer-assisted instruction (CAI)

of numbers. Those instructions tell the machine how different iterations of the product. The resulting pro-
to move and what actions to perform in order to totypes are often manufactured using 3D printers.
construct the object. The types of machines used in Rapid prototyping results in improved quality con-
that process vary and may include milling machines, trol and a reduced time to bring a product to market.
drills, and lathes.
—Joy Crelin
In the early twenty-first century, 3D printers, devices
that manufacture objects out of thin layers of plastic
or other materials, began to be used in CAM. Unlike Bibliography
traditional CNC machinery, 3D printers are typically Bryden, Douglas. CAD and Rapid Prototyping for
used by individuals or small companies for whom Product Design. London: King, 2014. Print.
larger-scale manufacturing technology is excessive. Chua, Chee Kai, Kah Fai Leong, and Chu Sing
Lim. Rapid Prototyping: Principles and Applications.
Specialized Applications Hackensack: World Scientific, 2010. Print.
As CAD/CAM technology has evolved, it has come “Computer-Aided Design (CAD) and Computer-
to be used for a number of specialized applications. Aided Manufacturing (CAM).” Inc. Mansueto
Some CAD software, for instance, is used to perform Ventures, n.d. Web. 31 Jan. 2016.
four-dimensional building information modeling “Design and Technology: Manufacturing Processes.”
(4D BIM). This process enables a user to incorpo- GCSE Bitesize. BBC, 2014. Web. 31 Jan. 2016.
rate information related to time. For instance, the Herrman, John. “How to Get Started: 3D Modeling
schedule for a particular project can be accounted and Printing.” Popular Mechanics. Hearst Digital
for in the modeling process with 4D BIM. Media, 15 Mar. 2012. Web. 31 Jan. 2016.
Another common CAD/CAM application is rapid Krar, Steve, Arthur Gill, and Peter Smid. Computer
prototyping. In that process, a company or individual Numerical Control Simplified. New York: Industrial,
can design and manufacture physical prototypes of 2001. Print.
an object. This allows the designers to make changes Sarkar, Jayanta. Computer Aided Design: A Conceptual
in response to testing and evaluation and to test Approach. Boca Raton: CRC, 2015. Print.

COMPUTER-ASSISTED INSTRUCTION (CAI)


FIELDS OF STUDY areas to explore when, or determine the medium
or difficulty level of instruction; also known as a
Computer Science; Information Systems
“student-controlled program.”
ƒƒ learning strategy: a specific method for acquiring
ABSTRACT and retaining a particular type of knowledge, such
Computer-assisted instruction is the use of com- as memorizing a list of concepts by setting the list
puter technology as a means of instruction or an aid to music.
to classroom teaching. The instructional content ƒƒ learning style: an individual’s preferred approach
may or may not pertain to technology. Computer- to acquiring knowledge, such as by viewing visual
assisted instruction often bridges distances between stimuli, reading, listening, or using one’s hands to
instructor and student and allows for the instruction practice what is being taught.
of large numbers of students by a few educators. ƒƒ pedagogy: a philosophy of teaching that addresses
the purpose of instruction and the methods by
which it can be achieved.
PRINCIPAL TERMS
ƒƒ word prediction: a software feature that recog-
ƒƒ learner-controlled program: software that allows nizes words that the user has typed previously and
a student to set the pace of instruction, choose offers to automatically complete them each time
which content areas to focus on, decide which the user begins typing.

57
Computer-assisted instruction (CAI) Principles of Programming & Coding

Computer-Assisted vs. Traditional information through audio, video, text, images, or a


Instruction combination of these. It then quizzes the student to
In a traditional classroom, a teacher presents infor- make sure that they have paid attention and under-
mation to students using basic tools such as pencils, stood the material. Such instruction has several bene-
paper, chalk, and a chalkboard. Most lessons consist fits. First, students often receive information through
of a lecture, group and individual work by students, several mediums, so they do not have to adapt to the
and the occasional hands-on activity, such as a field teacher’s preferred style. Second, teachers can better
trip or a lab experiment. For the most part, students support students as they move through the lessons
must adapt their learning preferences to the teach- without having to focus on presenting information
er’s own pedagogy, because it would be impractical to a group.
for one teacher to try to teach to multiple learning
styles at once. Advantages and Disadvantages
Computer-assisted instruction (CAI) supplements CAI has both benefits and drawbacks. Certain soft-
this model with technology, namely a computing de- ware features make it easier to navigate the learning
vice that students work on for some or all of a lesson. environment, such as word prediction to make typing
Some CAI programs offer limited options for how easier and spell-checking to help avoid spelling mis-
the material is presented and what learning strategies takes. Copy-and-paste features save users time that
are supported. Others, known as learner-controlled they would otherwise spend reentering the same in-
programs, are more flexible. A typical CAI lesson formation over and over. Speech recognition can as-
focuses on one specific concept, such as long divi- sist students who are blind, have physical disabilities,
sion or the history of Asia. The program may present or have a learning disability that affects writing. Other

New Lesson

Sample Problem
Remediation

Expert Student
Solution Solution Help Session

Compare Solutions and Yes


Evaluate Students

Another
If Correct If Incorrect No
Provide Feedback Try?
to Student
Computer-assisted instruction uses programming to determine whether a student understands the lesson (correctly answers sample prob-
lems) or needs more help or remediation (incorrectly answers sample problems). This flowchart indicates a general path of computer-
assisted instruction. (Adapted from S. Egarievwe, A. O. Ajiboye, and G. Biswas, “Internet Application of LabVIEW in Computer Based
Learning,” 2000.)

58
Principles of Programming & Coding Conditional operators

helpful features are present despite not having been Distance Education
intended to benefit students. For example, CAI video CAI is especially important to the growing field of
lessons include the option to pause playback, skip online education. Online instructors often use ele-
ahead or back, or restart. These functions can be vital ments of CAI to supplement their curricula. For ex-
to a student who is struggling to grasp an especially ample, an online course might require students to
difficult lesson or is practicing note-taking. They can watch a streaming video about doing library research
stop the video at any time and restart it after catching so that they will know how to complete their own re-
up with the content that has been presented. By con- search paper for the course. Online education also
trast, in a regular classroom, the lecturer often con- enables just a few instructors to teach large numbers
tinues at the same pace regardless how many students of students across vast distances. Tens of thousands of
may be struggling to understand and keep up. students may enroll in a single massive open online
Learning is rarely a “one size fits all” affair. course (MOOC).
Different topics pose greater or lesser challenges to
—Scott Zimmer, JD
different students, depending on their natural abili-
ties and study habits. In regular classrooms, teachers
can often sense when some students are not ben- Bibliography
efiting from a lesson and adapt it accordingly. With Abramovich, Sergei, ed. Computers in Education. 2
some CAI, this is not an option because the lesson is vols. New York: Nova, 2012. Print.
only presented in one way. Erben, Tony, Ruth Ban, and Martha E. Castañeda.
Teaching English Language Learners through Tech-
Adaptive Instruction nology. New York: Routledge, 2009. Print.
Fortunately, some forms of CAI address different Miller, Michelle D. Minds Online: Teaching Effectively
learning rates by using adaptive methods to present with Technology. Cambridge: Harvard UP, 2014.
material. These programs test students’ knowledge Print.
and then adapt to those parts of the lesson with Roblyer, M. D., and Aaron H. Doering. Integrating
which they have more difficulty. For instance, if a Educational Technology into Teaching. 6th ed. Boston:
math program notices that a student often makes Pearson, 2013. Print.
mistakes when multiplying fractions, it might give Tatnall, Arthur, and Bill Davey, eds. Reflections on
the student extra practice in that topic. Adaptive the History of Computers in Education: Early Use of
programs give teachers the means to better assess stu- Computers and Teaching about Computing in Schools.
dents’ individual needs and track their progress. As Heidelberg: Springer, 2014. Print.
the technology improves, more detailed and specific Tomei, Lawrence A., ed. Encyclopedia of Information
results may bolster teachers’ efforts to tailor instruc- Technology Curriculum Integration. 2 vols. Hershey:
tion further. Information Science Reference, 2008. Print.

CONDITIONAL OPERATORS
FIELDS OF STUDY used to reduce the number of lines of code needed
for branching logic. Such refactoring makes code
Coding Techniques; Software Development; Computer
easier to understand, debug, and maintain.
Science
ABSTRACT PRINCIPAL TERMS
Conditional operators perform a similar function ƒƒ bool: in many programming languages, a data
in code to other conditional expressions such as the type consisting of either-or values, such as “true”
if-then-else construct. Conditional operators can be or “false,” “yes” or “no,” and “on” or “off.”

59
Conditional operators Principles of Programming & Coding

ƒƒ operand: in computer programming, the part of In programming code, conditional operators per-
a computer instruction that specifies the data on form a similar function to that of other conditional
which a given mathematical, relational, or logical expressions, such as the if-then-else construct. They
operation is to be performed; also refers to the can control program flow and implement condi-
data itself. tional logic as needed by the application.
ƒƒ ternary operator: an operator that takes three op- In many programming languages, the conditional
erands; most often refers to a conditional ­operator. operator uses the following syntax:

What Is a Conditional Operator? [condition] ? [result if condition is true] : [result


In computer programming, an operand repre- if condition is false]
sents the data on which a specific mathematical,
relational, or logical operation is to be performed. Conditional operators can be nested in paren-
A conditional operator is an operator that takes theses in order to test multiple conditions, much as
three operands. The first operand is a conditional “if” statements can be nested:
statement, the second operand is the result to re-
turn if the condition is true, and the third operand [condition 1] ? ([condition 2] ? [result A] : [re-
is the result to return if the condition is false. In sult B]) : [result C]
many programming languages, the conditional
operator is the only ternary operator that is com- Here, if condition 1 evaluates to false, the program
monly used. Because of this, the terms “conditional will simply return result C. If condition 1 evaluates to
operator” and “ternary operator” are often used true, however, the program will then evaluate condi-
interchangeably. tion 2. If condition 2 evaluates to true, the program
The conditional operator is a type of conditional will return result A; if it evaluates to false, the pro-
expression. Conditional expressions result in dif- gram will return result B.
ferent actions being taken depending on whether a
Boolean condition evaluates to true or false. A con-
Considerations with Conditional
ditional operator executes different blocks of code
Operators
based on the bool value returned by a Boolean condi-
Conditional operators can be used to reduce
tion. The condition can be a simple Boolean condi-
the number of lines of code needed to create
tion, such as x = 5. Alternatively, it can be a complex
branching logic. Such refactoring makes code easier
Boolean expression constructed with Boolean opera-
to understand, debug, and maintain. If many condi-
tors, such as x = 5 AND y = 6 AND z = 7.
tions need to be tested, however, an if-then-else con-
struct might be easier to understand.
It is crucial that developers be aware of how
conditional operators are implemented in a spe-
cific programming language. For example, the
conditional operator is right associative in many
languages. However, it is left associative in PHP.
Associativity refers to the direction in which the op-
eration is performed. To avoid errors of this type,
parentheses should be used to specify operator
precedence.

Conditional Operators in Practice


Along with a comparison operator, conditional operators can be
A developer is writing code to add functionality to an
used to combine more than one condition into a single test. True
and false examples of integers are provided for the following con- e-commerce application. The retailer wants to assign
ditional statements: (x < 3) AND (y > 6), (x < 1) OR (y <= 10), and a special holiday discount based on how much a cus-
the statement NOT (x = 6). tomer has spent that year. The developer could use

60
Principles of Programming & Coding Conditional operators

the following pseudocode if-then-else construct to ac- yearlyPurchases > 1000 ? (yearlyPurchases < =
complish this task: 5000 ? Discount = .1 : Discount = .15) :
Discount = .05
IF yearlyPurchases > 1000 THEN
Discount = .1 The Boolean expression used in the outermost
ELSE “if” statement becomes the first operand of the outer
Discount = .05 conditional operator. Likewise, the Boolean expres-
END IF sion used in the innermost “if” statement becomes
the first operand of the inner conditional operator.
This code sets Discount to 0.1, or 10 percent, if a
customer has spent more than $1,000 during the
The Benefits of Simplified Code
year and 0.05, or 5 percent, if the customer has spent
Conditional operators provide an alternative to the
$1,000 or less. A more efficient way to write this in-
if-then-else construct that can reduce the number of
struction would be to use a conditional operator, as
lines of code needed to create branching logic, par-
below:
ticularly in complicated nesting scenarios. This re-
duces the time needed to write, debug, and maintain
yearlyPurchases > 1000 ? Discount = .1 :
code and makes the code easier to understand. The
Discount = .05
time saved can be significant, as conditional expres-
sions are among the most common constructs used
Note how the Boolean expression from the if-then-
in computer programming. Branching logic is at the
else statement is the first operand of the conditional
core of many algorithms, making it a core capability
operator, the code from the “if” block is the second
required of any computer language. Thus, condi-
operand, and the code from the “else” block is the
tional operators will continue to be relevant as new
third operand.
computer languages are developed and existing lan-
Suppose the retailer wanted a more refined dis-
guages are improved.
count system in which customers who spent more
than $1,000 during the year received a discount of —Maura Valentino, MSLIS
10 percent, those who spent more than $5,000 re-
ceived 15 percent, and all others received 5 percent.
A nested if-then-else statement could be used to ac- Bibliography
complish the task, as follows: Friedman, Daniel P., and Mitchell Wand. Essentials of
Programming Languages. 3rd ed., MIT P, 2008.
IF yearlyPurchases > 1000 THEN Haverbeke, Marijn. Eloquent JavaScript: A Modern
IF yearlyPurchases < = 5000 THEN Introduction to Programming. 2nd ed., No Starch
Discount = .1 Press, 2015.
ELSE MacLennan, Bruce J. Principles of Programming
Discount = .15 Languages: Design, Evaluation, and Implementation.
END IF 3rd ed., Oxford UP, 1999.
ELSE Schneider, David I. An Introduction to Programming
Discount = .05 Using Visual Basic. 10th ed., Pearson, 2017.
END IF Scott, Michael L. Programming Language Pragmatics.
4th ed., Elsevier, 2016.
However, using a conditional operator could re- Van Roy, Peter, and Seif Haridi. Concepts, Techniques,
duce the lines of code required from nine to one: and Models of Computer Programming. MIT P, 2004.

61
Constraint programming Principles of Programming & Coding

CONSTRAINT PROGRAMMING
FIELDS OF STUDY interrelated variables like ripples across the surface
of a pond: other values change in ways that follow
Software Engineering; System-Level Programming
their constraints and are consistent with the rela-
tionships between values. The perturbation model is
ABSTRACT
much like a spreadsheet. Changing one cell’s value
Constraint programming typically describes the pro- causes changes in other cells that contain formulas
cess of embedding constraints into another language, that refer to the value stored in the original cell. A
referred to as the “host” language since it hosts the single change to a cell can propagate throughout
constraints. Not all programs are suitable for con- many other cells, changing their values as well.
straint programming. Some problems are better ad- A contrasting approach is the refinement model.
dressed by different approaches, such as logic pro- Whereas the perturbation model assigns particular
gramming. Constraint programming tends to be the values to variables, under the refinement model,
preferred method when one can envision a state in each variable can assume any value within its domain.
which multiple constraints are simultaneously satis- Then, as time passes, some values of one variable will
fied, and then search for values that fit that state. inevitably be ruled out by the values assumed by other
variables. Over time, each variable’s possible values
PRINCIPAL TERMS are refined down to fewer and fewer options. The
refinement model is sometimes considered more
ƒƒ constraints: limitations on values in computer pro-
flexible, because it does not confine a variable to one
gramming that collectively identify the solutions
possible value. Some variables will occasionally have
to be produced by a programming problem.
multiple solutions.
ƒƒ domain: the range of values that a variable may
take on, such as any even number or all values less
than −23.7. A Different Approach to Programming
ƒƒ functional programming: a theoretical approach Constraint programming is a major departure from
to programming in which the emphasis is on ap- more traditional approaches to writing code. Many
plying mathematics to evaluate functional rela- programmers are more familiar with imperative pro-
tionships that are, for the most part, static. gramming, where commands are issued to the com-
ƒƒ imperative programming: programming that pro- puter to be executed, or functional programming,
duces code that consists largely of commands is- where the program receives certain values and then
sued to the computer, instructing it to perform performs various mathematical functions using those
specific actions. values. Constraint programming, in contrast, can be
less predictable and more flexible.
Models of Constraint Programming A classic example of a problem that is especially
Constraint programming tends to be used in situa- well suited to constraint programming is that of map
tions where the “world” being programmed has mul- coloring. In this problem, the user is given a map of
tiple constraints, and the goal is to have as many of a country composed of different states, each sharing
them as possible satisfied at once. The aim is to find one or more borders with other states. The user is
values for each of the variables that collectively de- also given a palette of colors. The user must find a
scribe the world, such that the values fall within that way to assign colors to each state, such that no adja-
variable’s constraints. cent states (i.e., states sharing a border) are the same
To achieve this state, programmers use one of color. Map makers often try to accomplish this in real
two main approaches. The first approach is the per- life so that their maps are easier to read.
turbation model. Under this model, some of the Those experienced at constraint programming
variables are given initial values. Then, at different can immediately recognize some elements of this
times, variables are changed (“perturbed”) in some problem. The most obvious is the constraint, which
way. Each change then moves through the system of is the restriction that adjacent states may not be the

62
Principles of Programming & Coding Constraint programming

Define
problem

New constraints Decision-making


(decisions) (and retracting)
Define initial
constraints

Current set of Best fit solution


constraints according to current
constraints

Deduce Constraint
contradictions propagation

In constraint programming, the design of the program is dictated by specific constraints determined prior to development. After a problem
is identified, the initial constraints are defined and condensed into the current program constraints. As solutions are developed and tested,
decisions are made as to whether the constraints must be modified or retracted to remove duplications or whether new ones must be de-
veloped. The process cycles through current restraints and solutions until a solution is developed that meets all the constraints and solves
the initial problem. Adapted from Philippe Baptiste, “Combining Operations Research and Constraint Programming to Solve Real-Life
Scheduling Problems.”

same color. Another element is the domain, which is Another example of a problem for which constraint
the list of colors that may be assigned to states. The programming is well suited is that of creating a work
fewer the colors included in the domain, the more schedule. The department or team contains multiple
challenging the problem becomes. While this map- variables (the employees), each with their own con-
coloring problem may seem simplistic, it is an excel- straints. Mary can work any day except Friday, Thomas
lent introduction to the concept of constraint pro- can work mornings on Monday through Thursday but
gramming. It provides a useful situation for student only evenings on Friday, and so forth. The goal is to
programmers to try to translate into code. simply find a schedule that fits all of the constraints. It
does not matter whether it is the best schedule, and in
Feasibility vs. Optimization fact, there likely is no “best” schedule.
Constraint programming is an approach to problem —Scott Zimmer, JD
solving and coding that looks only for a solution that
works. It is not concerned with finding the optimal
solution to a problem, a process known as “optimiza- Bibliography
tion.” Instead, it seeks values for the variables that fit all Baptiste, Philippe, Claude Le Pape, and Wim Nuijten.
of the existing constraints. This may seem like a limita- Constraint-Based Scheduling: Applying Constraint
tion of constraint programming. However, its flexibility Programming to Scheduling Problems. New York:
can mean that it solves a problem faster than expected. Springer, 2013. Print.

63
Control systems Principles of Programming & Coding

Ceberio, Martine, and Vladik Kreinovich. Constraint Pelleau, Marie, and Narendra Jussien. Abstract
Programming and Decision Making. New York: Domains in Constraint Programming. London: ISTE,
Springer, 2014. Print. 2015. Print.
Henz, Martin. Objects for Concurrent Constraint Solnon, Christine. Ant Colony Optimization and
Programming. New York: Springer, 1998. Print. Constraint Programming. Hoboken: Wiley, 2010.
Hofstedt, Petra. Multiparadigm Constraint Programming Print.
Languages. New York: Springer, 2013. Print.

CONTROL SYSTEMS
FIELDS OF STUDY At the most basic level, control systems are classified
as either open-loop or closed-loop systems. In an
Embedded Systems; System Analysis
open-loop system, the output is based solely on the
input fed into the system. In a closed-loop system,
ABSTRACT the output generated is used as feedback to adjust
A control system is a device that exists to control mul- the system as necessary. Closed-loop systems can
tiple other systems or devices. For example, the con- make fault detection more difficult, as they are de-
trol system in a factory would coordinate the opera- signed to minimize the deviations created by faults.
tion of all of the factory’s interconnected machines. One of the first steps in designing a control system
Control systems are used because the coordination is system identification. This is the process of mod-
of these functions needs to be continuous and nearly eling the system to be controlled. It involves studying
instantaneous, which would be difficult and tedious the inputs and outputs of the system and deter-
for human beings to manage. mining how they need to be manipulated in order to
produce the desired outcome. Some control systems
PRINCIPAL TERMS require a certain degree of human interaction or
guidance during their operation. However, control-
ƒƒ actuator: a motor designed to move or control an- system designers generally prefer systems that can
other object in a particular way. function as autonomous agents. The purpose of a
ƒƒ automatic sequential control system: a mechanism control system is to reduce human involvement in
that performs a multistep task by triggering a se- the process as much as possible. This is partly so per-
ries of actuators in a particular sequence. sonnel can focus on other, more important tasks and
ƒƒ autonomous agent: a system that acts on behalf of partly because problems are more likely to arise from
another entity without being directly controlled by human error.
that entity. The downside of an autonomous agent is that it
ƒƒ fault detection: the monitoring of a system to iden- requires greater system agility, so that when problems
tify when a fault occurs in its operation. are encountered, the control system can either con-
ƒƒ system agility: the ability of a system to respond tinue to perform its role or “fail gracefully” rather
to changes in its environment or inputs without than failing catastrophically or ceasing to function al-
failing altogether. together. This could mean the difference between a
ƒƒ system identification: the study of a system’s inputs jammed conveyor belt being automatically corrected
and outputs to develop a working model of it. and that same belt forcing an entire assembly line to
shut down.
Types of Control Systems
Different types of control systems are used in dif- Control System Performance
ferent situations. The nature of the task being per- Control systems are more than just computers that
formed usually determines the design of the system. monitor other processes. Often, they also control

64
Principles of Programming & Coding Control systems

Feedback

Disturbance

System Output

Controller

Feed Forward/Anticipation/Planning

Disturbance

System Output

Controller

Control systems are used to alter a process pathway to reach a desired output. A controller senses some type of information along the
pathway and causes a change in the system. Making changes to the system prior to system input is called a “feed-forward control”; making
changes to the system based on the output is called “feedback control.” (Adapted from http://www.csci.csusb.edu/dick/cs372/a1.html.)

the physical movements of system components. type of raw material that produced increased heat
A control system may cause an assembly-line robot due to friction and caused the system to operate less
to pivot an automobile door so that another ma- efficiently, microsensors inside the machinery could
chine can attach its handle, or it may cause a device detect this and alert those in charge of supervising
to fold cardboard into boxes to be filled with candy. the system. Such information could help avoid costly
Such tasks are accomplished via actuators, which are breakdowns of equipment and delays in production
motors that the control system manipulates to exe- by allowing supervisors to address problems before
cute the necessary physical movements. Sometimes they become severe.
only a single movement is required from a device.
At other times, a device may have to perform sev- Linear Control Systems
eral different movements in a precisely timed se- Linear control systems are a type of closed-loop
quence. If this is the case, an automatic sequential system. They receive linear negative feedback from
control system is used to tell the machine what to do their outputs and adjust their operating param-
and when. eters in response. This allows the system to keep
The development of very small and inexpensive relevant variables within acceptable limits. If the
microprocessors and sensors has made it possible for sensors in a linear control system detect excess
them to be incorporated into control systems. Similar heat, as in the example above, this might cause the
to the closed-loop approach, these tiny computers system to initiate additional cooling. An example
help a control system monitor its performance and of this is when a computer’s fan speeds up after
provide detailed information about potential issues. an intensive application causes the system to begin
For example, if a control system were using a new generating heat.

65
Cowboy coding Principles of Programming & Coding

Behind the Scenes Chen, Yufeng, and Zhiwu Li. Optimal Supervisory
Control systems are a vital part of everyday life in the Control of Automated Manufacturing Systems. Boca
industrialized world. Most of the products people use Raton: CRC, 2013. Print.
every day are produced or packaged using dozens of Janert, Philipp K. Feedback Control for Computer Systems.
different control systems. Human beings have come Sebastopol: O’Reilly, 2014. Print.
to rely heavily on technology to assist them in their Li, Han-Xiong, and XinJiang Lu. System Design and
work, and in some cases to completely take over that Control Integration for Advanced Manufacturing.
work. Control systems are the mechanisms that help Hoboken: Wiley, 2015. Print.
make this happen. Song, Dong-Ping. Optimal Control and Optimization of
Stochastic Supply Chain Systems. London: Springer,
—Scott Zimmer, JD
2013. Print.
Van Schuppen, Jan H., and Tiziano Villa, eds.
Bibliography Coordination Control of Distributed Systems. Cham:
Ao, Sio-Iong, and Len Gelman, eds. Electrical Springer, 2015. Print.
Engineering and Intelligent Systems. New York:
Springer, 2013. Print.

COWBOY CODING
FIELDS OF STUDY them, and the properties of both those compo-
nents and their relationships.
Software Development; Programming Methodologies;
ƒƒ waterfall development: a traditional, linear soft-
Coding Techniques
ware-development methodology based on a series
of ordered phases.
ABSTRACT
Cowboy coding is a style of software development that What Is Cowboy Coding?
frees the programmer from the constraints of formal Cowboy coding is a style of software development
software-development methodologies. Proponents that gives individual programmers complete control
of cowboy coding maintain it promotes creativity, ex- of all aspects of the development process. Unlike tra-
perimentation, and “outside the box” thinking, while ditional software-development methodologies such
critics maintain it is inefficient and leads to the devel- as waterfall development, cowboy coding does not
opment of lower-quality software. follow a defined approach. Rather, it allows program-
mers to use any approach when developing software.
Cowboy coders may use elements of formal software
PRINCIPAL TERMS
methodologies in any combination or order, or they
ƒƒ agile development: an approach to software de- may forgo formal methodologies entirely. Cowboy
velopment that focuses on improving traditional coding is typically used by students, hobbyists, and
software-development methodologies and adapting developers working alone. It can be practiced by in-
to changes during the software life cycle. dividuals within larger development teams on proj-
ƒƒ requirement: a necessary characteristic of a soft- ects using formal methodologies, but cowboy coding
ware system or other product, such as a service it practices are typically considered inappropriate and
must provide or a constraint under which it must disruptive in such environments.
operate. Cowboy coding is often confused with agile devel-
ƒƒ software architecture: the overall structure of a opment. Like cowboy coding, agile software devel-
software system, including the components that opment aims to free programmers from constraints
make up the system, the relationships among imposed by traditional development methodologies.

66
Principles of Programming & Coding Cowboy coding

programmer from using established methodologies;


it simply frees them to use their own experience and
judgment to select which methodologies to use.
Critics of cowboy coding believe that the approach
does not work well in a professional software-develop-
ment environment. They argue that it tends to lead to
solutions that are poorly designed and implemented.
Lack of a formal planning and design process can
lead to project delays, incorrect scheduling, wasted
effort, and solutions that are incomplete or do not
meet the purpose for which they are designed. Critics
also maintain that teamwork is a key component of
all but the smallest development projects. If devel-
opers work with a high degree of independence, it
The approach to creating programming where one writes
code without thinking out a plan first is called cowboy coding.
can be difficult to effectively coordinate their ef-
Alternatively, one would think up a strategy for development and forts with those of other stakeholders on the types of
the user expectations of that software before writing code. large, complex projects often faced by professional
developers.
However, unlike cowboy coding, agile development
When Is It Good to Be a Cowboy?
does not dispense with formal methodologies when
While cowboy coding is not typically used in profes-
designing and implementing software architecture.
sional software development, it is often used by in-
Instead, it focuses on improving and optimizing the
dividual software developers who work in isolation.
use of existing methodologies. For example, rather
For example, this approach is frequently used by in-
than abandoning the comprehensive software testing
dependent game developers who design and code
included in many development methodologies, agile
their own games. Such a scenario minimizes cowboy
development encourages a focus on useful testing
coding’s weaknesses while emphasizing its strengths.
that adds value to the development process. In other
The lack of a development team reduces the need for
words, a test should be conducted to achieve a spe-
the planning and coordination required with larger
cific purpose, not simply because it is part of a given
projects. The lack of outside customers and other
methodology.
stakeholders reduces the need for agreed-upon
Agile also retains many traditional software-
benchmark deliverables and dates, detailed project
development elements, including a focus on proper
specification documents, scheduled releases, and
documentation and requirements identification.
timely updates.
These elements are frequently abandoned by cowboy
The principal resource being devoted to a small-
coders. In addition, agile development encourages
scale cowboy coding project is the developer’s time.
programmers to work in well-integrated develop-
As such, cost overruns and other financial and
ment teams, in contrast to the typically individual
resource-related risks addressed by formal develop-
focus of cowboy coding.
ment methodologies are not as critical, as they only
affect the developer. An experienced developer can
Cowboy Coding Is Controversial mitigate the negative effects of cowboy coding by
Cowboy coding encourages programmers to use employing elements of standard methodologies and
whatever process, model, or technology works best other professional practices. For this reason, cowboy
for them in any given situation. Proponents of this coding is best used by experienced developers who
approach believe it promotes creativity, experimenta- are familiar with such techniques.
tion, and thinking outside the box. They note that
its focus on results rather than process often pro- Rein Them In or Let Them Roam?
duces innovative solutions in an efficient manner. Cowboy coding remains controversial among software
They stress that cowboy coding does not prohibit the developers. Opponents believe that it undermines

67
CPU design Principles of Programming & Coding

the success of software-development projects and likely to persist as new methodologies and technolo-
that it has no place in the world of professional soft- gies are developed.
ware development. They maintain that the princi-
—Maura Valentino, MSLIS
ples of creativity and flexibility embraced by cowboy
coding can be encouraged within the framework of
defined software methodologies. They argue that Bibliography
defined software methodologies were developed to Bell, Michael. Incremental Software Architecture: A
address real-world needs identified by programmers Method for Saving Failing IT Implementations. John
and have been proved to produce effective software Wiley & Sons, 2016.
solutions in a timely and efficient manner. According Friedman, Daniel P., and Mitchell Wand. Essentials of
to this view, this effectiveness is threatened by cow- Programming Languages. 3rd ed., MIT P, 2008.
boy coders who never bother to learn best practices. Jayaswal, Bijay K., and Peter C. Patton. Design
Cowboy coders maintain that they produce the for Trustworthy Software: Tools, Techniques, and
best solutions when they work independently and Methodology of Developing Robust Software. Prentice
free of any restraints on their process or creativity. Hall, 2007.
They reject the use of “cowboy coding” as a deroga- MacLennan, Bruce J. Principles of Programming
tory term to imply sloppiness or lack of a compre- Languages: Design, Evaluation, and Implementation.
hensive outlook. In their view, the skill of the indi- 3rd ed., Oxford UP, 1999.
vidual programmer matters more than the methods Scott, Michael L. Programming Language Pragmatics.
used. Defined software development methodologies 4th ed., Elsevier, 2016.
remain integral to professional programming, but Van Roy, Peter, and Seif Haridi. Concepts, Techniques,
many programmers1 begin by working alone and and Models of Computer Programming. MIT P, 2004.
have an independent nature. Because of this, con- Wysocki, Robert K. Effective Project Management:
flict between cowboy coders and traditionalists is Traditional, Agile, Extreme. 7th ed., John Wiley &
Sons, 2014.

CPU DESIGN
FIELDS OF STUDY ƒƒ datapath design: describes how data flows through
the CPU and at what points instructions will be de-
Computer Engineering; Information Technology
coded and executed.
ƒƒ logic implementation: the way in which a CPU
ABSTRACT
is designed to use the open or closed state of
CPU design is an area of engineering that focuses combinations of circuits to represent informa-
on the design of a computer’s central processing tion.
unit (CPU). The CPU acts as the “brain” of the ma- ƒƒ microcontroller: a tiny computer in which all the
chine, controlling the operations carried out by the essential parts of a computer are united on a single
computer. Its basic task is to execute the instruc- microchip—input and output channels, memory,
tions contained in the programming code used to and a processor.
write software. Different CPU designs can be more ƒƒ peripherals: devices connected to a computer but
or less efficient than one another. Some designs are not part of the computer itself, such as scanners,
better at addressing certain types of problems. external storage devices, and so forth.
ƒƒ protocol processor: a processor that acts in a
PRINCIPAL TERMS
secondary capacity to the CPU, relieving it from
ƒƒ control unit design: describes the part of the CPU some of the work of managing communication
that tells the computer how to perform the in- protocols that are used to encode messages on the
structions sent to it by a program. network.

68
Principles of Programming & Coding CPU design

CPU Design Goals function tells designers what types of programs the
The design of a CPU is a complex undertaking . The CPU will most often run . This, in turn, helps deter-
main goal of CPU design is to produce an architec- mine what type of instruction-set architecture to use
ture that can execute instructions in the fastest, most in the microchip that contains the CPU . Knowing
efficient way possible . Both speed and efficiency are what types of programs will be used most frequently
relevant factors . There are times when having an in- also allows CPU designers to develop the most
struction that is fast to execute is adequate, but there efficient logic implementation . Once this has been
are also situations where it would not make sense to done, the control unit design can be defined . De-
have to execute that simple instruction hundreds of fining the datapath design is usually the next step, as
times to accomplish a task . the CPU’s handling of instructions is given physical
Often the work begins by designers considering form .
what the CPU will be expected to do and where it Often a CPU will be designed with additional sup-
will be used . A microcontroller inside an airplane ports to handle the processing load, so that the CPU
performs quite different tasks than one inside a itself does not become overloaded . Protocol proces-
kitchen appliance, for instance . The CPU’s intended sors, for example, may assist with communications

Fetch from memory

Decode for execution

Execute instructions

A generic state diagram shows the simple processing loop: fetch instructions from memory, decode instructions to determine the proper
execute cycle, execute instructions, and then fetch next instructions from memory and continue the cycle . A state diagram is the initial
design upon which data paths and logic controls can be designed .

69
CPU design Principles of Programming & Coding

protocol translation involving the transmission of continuously expand instruction sets to give pro-
data between the computer and its peripherals or grammers more options. Eventually, studies began to
over the Internet. Internet communication proto- show that adding more complex instructions did not
cols are quite complex. They involve seven different, always improve performance, however. In response,
nested layers of protocols, and each layer must be ne- CPU manufacturers produced reduced instruction
gotiated before the next can be addressed. Protocol set computer (RISC) chips. RISC chips could use less
processors take this workload off the CPU. complex instructions, even though this meant that a
larger number of instructions were required.
Instruction Sets
CPU design is heavily influenced by the type of in- Moore’s Law
struction sets being used. In general, there are two Moore’s law is named after Gordon Moore, a co-
approaches to instructions. The first is random logic. founder of the computer manufacturer Intel. In
Sometimes this is referred to as “hardwired instruc- 1975, Moore observed that the computing power of
tions.” Random logic uses logic devices, such as de- an integrated circuit or microchip doubles, on av-
coders and counters, to transport data and to per- erage, every two years. This pace of improvement has
form calculations. Random logic can make it possible been responsible for the rapid development in tech-
to design faster chips. The logic itself takes up space nological capability and the relatively short lifespan
that might otherwise be used to store instructions, of consumer electronics, which tend to become obso-
however. Therefore, it is not practical to use random lete soon after they are purchased.
logic with very large sets of instructions. —Scott Zimmer, JD
The second approach to instruction sets is micro-
code. Microcode is sometimes called “emulation”
because it references an operations table and uses Bibliography
sets of microinstructions indexed by the table in to Englander, Irv. The Architecture of Computer Hardware,
execute each CPU instruction. Microcode can some- Systems Software, & Networking: An Information
times be slower to run than random logic, but it also Technology Approach. Hoboken: Wiley, 2014. Print.
has advantages that offset this weakness. Microcode Hyde, Randall. Write Great Code: Understanding the
breaks down complex instructions into sets of mi- Machine. Vol. 1. San Francisco: No Starch, 2005.
croinstructions. These microinstructions are used Print.
in several complex instructions. A CPU executing Jeannot, Emmanuel, and J. Žilinskas. High Performance
microcode would therefore be able to reuse microin- Computing on Complex Environments. Hoboken:
structions. Such reuse saves space on the microchip Wiley, 2014. Print.
and allows more complex instructions to be added. Lipiansky, Ed. Electrical, Electronics, and Digital
The most influential factor to consider when Hardware Essentials for Scientists and Engineers.
weighing random logic against microcode is memory Hoboken: Wiley, 2013. Print.
speed. Random logic usually produces a speedier Rajasekaran, Sanguthevar. Multicore Computing: Algo-
CPU when CPU speeds outpace memory speeds. rithms, Architectures, and Applications. Boca Raton:
When memory speeds are faster, microcode is faster CRC, 2013. Print.
than random logic. Stokes, Jon. Inside the Machine: An Illustrated Introduc-
tion to Microprocessors and Computer Architecture. San
Reduced Instruction Set Computer Francisco: No Starch, 2015. Print.
(RISC) Wolf, Marilyn. High Performance Embedded Computing:
Early in the history of CPU design, it was felt that Architectures, Applications, and Methodologies. Am-
the best way to improve CPU performance was to sterdam: Elsevier, 2014. Print.

70
Principles of Programming & Coding Crowdfunding

CROWDFUNDING

Crowdfunding is a method by which an individual donors contribute money for a project, such as the
or group raises money for a project, cause, or busi- creation of a film or book, and in turn receive gifts
ness by receiving donations from a large group of such as a personal note from the author, a coffee
individuals, often by means of many small donations mug or t-shirt advertising the project, or a copy of the
from people who have no relationship to each other product created (e.g., a copy of the book or film).
beyond interest in the project. Crowdfunding began This model is similar to the fundraising method used
largely as a way for musicians, artists, and other cre- on National Public Radio (NPR) and PBS televi-
ative people to gain support for their projects and sion, where people make a charitable contribution
relies heavily on the Internet to reach potential to their local station or to a particular program they
funders. Crowdfunding is also used to raise money enjoy and may elect to receive some branded item
for philanthropic causes and to raise investment cap- in return. In investment crowdfunding, businesses
ital for new businesses. sell debt or equity stakes to investors, and those inves-
tors will share in the company’s profits, if there are
Overview any. Indiegogo, founded in 2008, allows fundraising
There are two primary models for crowdfunding: for any purpose other than business investment, in-
donation-based crowdfunding and investment cluding charity, and AngelList is specifically for tech
crowdfunding. In donation-based crowdfunding, startup companies looking for business investors.

A photo of crowd funding expert Pim Betist

71
Crowdsourcing Principles of Programming & Coding

GoFundMe, founded in 2010, allows for any kind of Bibliography


project, creative, business, charitable, or otherwise,
Barnett, Chance. “Top 10 Crowdfunding Sites for
as well as allowing people to fundraise for personal
Fundraising.” Forbes.com. Forbes.com LLC, 8 May
needs such as medical expenses.
2013. Web. 7 Aug. 2013.
Despite its burgeoning popularity in the Internet
Clifford, Catherine. “Crowdfunding Generates More
era, crowdfunding is not a new concept. For cen-
Than $60,000 an Hour.” Entrepreneur. Entrepreneur
turies artists and publishers have sought subscrip-
Media, 19 May 2014. Web. 22 May 2015.
tions to finance creative projects, and in the United
Cunningham, William Michael. The JOBS Act:
States notable examples include the public solicita-
Crowdfunding for Small Businesses and Startups. New
tion of contributions to pay for the pedestal for the
York: Springer, 2012. Print.
Statue of Liberty in 1884, and the 1933 public con-
Dredge, Stuart. “Kickstarter’s Biggest Hits: Why
tributions to build a swimming pool in the White
Crowdfunding Now Sets the Trends.” Guardian.
House so that President Franklin Roosevelt, who
Guardian News and Media, 17 Apr. 2014. Web. 22
was disabled as the result of polio, could enjoy water
May 2015.
therapy. In the 2010s, crowdfunding is primarily
Dushnitsky, Gary. “What If Crowdfunding Becomes
conducted over the Internet, often through web-
the Leading Source of Finance for Entrepreneurs
sites such as Kickstarter and the aforementioned
or Growing Companies?” Forbes. Forbes, 20 May
Indiegogo and AngelList. There are over 400 such
2015. Web. 22 May 2015.
sites in existence. Each site has its own set of rules;
Jacobs, Deborah L. “The Trouble with Crowdfunding.”
for instance, Kickstarter, launched in 2009, only
Forbes.com. Forbes.com LLC, 17 Apr. 2013. Web. 7
hosts campaigns for creative projects, and requires
Aug. 2013.
that project creators set a goal (amount of money
Lawton, Kevin, and Dan Marom. The Crowdfunding
to be raised) and a deadline; if the goal is not met
Revolution: How to Raise Venture Capital Using Social
by the deadline, no money is collected from the do-
Media. New York: McGraw. 2012. Print.
nors who pledged it. Other sites, such as Indiegogo,
Steinberg, Don. The Kickstart Handbook: Real-life
allow campaign creators to keep the donations from
Crowdfunding Success Stories. Philadelphia: Quirk,
a partially funded campaign.
2012. Print.
The field of crowdfunding is growing and chang­ing
Steinberg, Scott. “Amanda Palmer on Crowdfunding
rapidly. According to Chance Barnett, writing for
and the Rebirth of the Working Musician.”
Forbes.com in August 2013, in 2012 the crowdfunding
Rollingstone.com. Rolling Stone, 29 Aug. 2013. Web.
industry raised $2.7 billion across more than one
7 Aug. 2013.
million individual campaigns. In May 2014, a report
Trigonis, John T. Crowdfunding for Filmmakers: The Way
by the Crowdfunding Centre estimated that, world-
to a Successful Film Campaign. Studio City: Michael
wide, more than $60,000 were being raised via crowd-
Wiese Productions, 2013. Print.
funding every hour, and 442 crowdfunding campaigns
Young, Thomas Elliott. The Everything Guide to Crowd-
were being initiated each day.
funding: Learn How to Use Social Media for Small-
—Sarah E. Boslaugh, PhD, MPH Business Funding. Avon: F+W Media, 2013. Print.

CROWDSOURCING

The term crowdsourcing made its first print appear- content is solicited from a large, and often anony-
ance in the June 2006 issue of Wired magazine, and by mous, online community. Individuals respond to a
2013 it was an established way of conducting business call for information by providing small amounts of
on the Internet. Crowdsourcing can be thought of a data. The entities that sponsor crowdsourcing include
specialized variant of outsourcing, one where specific corporations, academic institutions, governments,

72
Principles of Programming & Coding Crowdsourcing

and individuals. Contributors to crowdsourcing proj- distinct goals. Crowd creation is used frequently to
ects may be paid professionals or volunteers merely solve complicated scientific problems. Crowdfunding
interested in sharing their knowledge. involves collecting small sums of money from nu-
merous contributors to meet fundraising goals for
Overview a start-up company or an artistic endeavor. Crowd
The appeal of crowdsourcing is based on its rela- searching leverages large networks of Internet and
tively inexpensive cost and its ability to undertake smartphone users to ascertain the location of a
problems too complex to solve with an organiza- missing item or individual. Crowd voting makes use
tion’s existing staff, as well as the idea that harnessing of communal judgment to grade, sort, and categorize
the knowledge of multiple individuals, who possess Web-based content; it is the most common type of
different knowledge and experiences, produces crowdsourcing (such as used on Reddit).
better, more accurate data. While individuals who Although crowdsourcing is a creation of the
participate in crowdsourcing are typically are demo- Internet era, information-gathering projects with
graphically diverse, many have academic training or considerable numbers of participants have existed
significant professional experience relevant to the for decades. Crowdsourcing served as the means for
project. Critics decry the quality and accuracy of the creation of the Oxford English Dictionary, was re-
crowdsourcing projects, but by the 2010s, the prac- sponsible for new methods for determining a ship’s
tice had become commonplace across a wide array of location in the Longitude Prize contest in Great
industries and endeavors. Britain, and became a way to collect genealogical
Specialized forms of crowdsourcing allow the ef- data for members of the Church of Jesus Christ of
forts of multiple users to achieve numerous types of Latter-day Saints.

The crowdsourcing process in eight steps.

73
Cryptography Principles of Programming & Coding

The Internet Movie Database and Wikipedia Bibliography


are two of the most successful examples of crowd-
Brabham, Daren C. Crowdsourcing. Cambridge: MIT
sourced Internet resources. Another well-received
Press, 2013. Print.
crowdsourcing project was the New York Public
Dawson, Ross, and Steve Bynghall. Getting Results from
Library’s “What’s on the Menu,” which began in
Crowds: The Definitive Guide to Using Crowdsourcing
2011 and sought to transcribe more than 45,000
to Grow Your Business. San Francisco: Advanced
historical restaurant menus from the 1840s to the
Human Technologies, 2011. Print.
2010s. In 2011 the California Digital Newspaper
Estelles-Miguel, Sofia, Ignacio Gil-Pechuán, and Fer-
Collection utilized crowdsourcing to correct the
nando J. Garrigos-Simon. Advances in Crowdsourcing.
text of digitized newspapers, some of which pre-
Cham: Springer, 2015. eBook Collection (EBSCOhost).
date California’s founding in 1850. The Katrina
Web. 19 June 2015.
PeopleFinder Project was developed in the wake
Howe, Jeff. Crowdsourcing: Why the Power of the Crowd
of Hurricane Katrina in 2005; more than ninety
Is Driving the Future of Business. New York: Crown,
thousand entries were inputted in an effort to keep
2009. Print.
track of the victims of the natural disaster. Carnegie
Powell, Juliette. 33 Million People in the Room: How to
Mellon University’s CAPTCHA system, established
Create, Influence, and Run a Successful Business with So-
in 2000, is a type of implicit crowdsourcing, where
cial Networking. Upper Saddle River: FT, 2009. Print.
users identify characters as part of a logon se-
Sloane, Paul, ed. A Guide to Open Innovation and
quence, which, in turn, is used to determinate text
Crowdsourcing: Advice from Leading Experts. London:
that optical character recognition (OCR) software
Kogan, 2012. Print.
cannot, thereby aiding the digitization of historical
Suie, Daniel, Sara Elwood, and Michael Goodchild,
text documents.
eds. Crowdsourcing Geographic Knowledge: Volunteered
Cloud-Based Software Crowdsourcing, (2015) edited
Geographic Information (VGI) in Theory and Practice.
by Wei Li, Michael N. Huhns, Wei-Tek Tsai, and
New York: Spring, 2013. Print.
Wenjun Wu, discusses the practice of using cloud
Surowiecki, James. The Wisdom of Crowds: Why the
computing to crowdsource computer software devel-
Many Are Smarter than the Few and How Collective
opment. By moving every stage of the software devel-
Wisdom Shapes Business, Economies, Societies, and
opment process to the cloud, it becomes a process of
Nations. New York: Doubleday, 2004. Print.
cocreation, in which the traditional distinctions be-
Tsai, Wei-Tek, et al., eds. Crowdsourcing : Cloud-Based
tween end-users and software developers are blurred.
Software Development. Heidelberg: Springer, 2015.
Cloud-based crowdsourcing allows for efficient and
eBook Collection (EBSCOhost). Web. 19 June 2015.
scalable software development.
Winograd, Morley. Millennial Momentum: How a New
—Leon James Bynum, MA Generation Is Remaking America. New Brunswick:
Rutgers UP, 2011. Print.

CRYPTOGRAPHY
FIELDS OF STUDY introduction of modern computers, cryptography
became an important tool for securing many types of
Computer Science; Computer Engineering; Algorithms
digital data.

ABSTRACT PRINCIPAL TERMS


Cryptography is the process of encrypting messages ƒƒ hash function: an algorithm that converts a string
and other data in order to transmit them in a form of characters into a different, usually smaller,
that can only be accessed by the intended recipients. fixed-length string of characters that is ideally im-
It was initially applied to written messages. With the possible either to invert or to replicate.

74
Principles of Programming & Coding Cryptography

ƒƒ public-key cryptography: a system of encryption who reads it by transforming (decrypting) it back


that uses two keys, one public and one private, to into its original form.
encrypt and decrypt data. Early forms of encryption were based on ciphers.
ƒƒ substitution cipher: a cipher that encodes a mes- A cipher encrypts a message by altering the charac-
sage by substituting one character for another. ters that comprise the message. The original mes-
ƒƒ symmetric-key cryptography: a system of encryp- sage is called the “plaintext,” while the encrypted
tion that uses the same private key to encrypt and message is the “ciphertext.” Anyone who knows the
decrypt data. rules of the cipher can decrypt the ciphertext, but
ƒƒ transposition cipher: a cipher that encodes a it remains unreadable to anyone else. Early ciphers
message by changing the order of the characters were relatively easy to break, given enough time and
within the message. a working knowledge of statistics. By the 1920s, elec-
tromechanical cipher machines called “rotor ma-
chines” were creating complex ciphers that posed
What Is Cryptography?
a greater challenge. The best-known example of a
The word “cryptography” comes from the Greek
rotor machine was the Enigma machine, used by the
words kryptos (“hidden,” “secret”) and graphein
German military in World War II. Soon after, the
(“writing”). Early cryptography focused on en-
development of modern computer systems in the
suring that written messages could be sent to their
1950s would change the world of cryptography in
intended recipients without being intercepted and
major ways.
read by other parties. This was achieved through
various encryption techniques. Encryption is based
on a simple principle: the message is transformed Cryptography in the Computer Age
in such a way that it becomes unreadable. The en- With the introduction of digital computers, the focus
crypted message is then transmitted to the recipient, of cryptography shifted from just written language to

Alice’s Public Key Digital


Private Key Cryptography Signature

Alice’s Hash
Digital
Message Function
Envelope

Sent to
Secret Key Bob
Random Encrypted
Crytography
Session Key Message

Bob’s Public Key Encrypted


Public Key Cryptography Session Key

This is a diagram of cryptography techniques: public (asymmetric) key, private (symmetric) key, and hash functions. Each secures data
in a different way and requires specific types of keys to encrypt and decrypt the data. Adapted from Gary C. Kessler, “An Overview of
Cryptography.”

75
Cryptography Principles of Programming & Coding

Caesar’s cipher table. Table organized original letters and replacement letters by
Caesar’s cipher.

any data that could be expressed in binary format. scheme. One of the simplest transposition ciphers
The encryption of binary data is accomplished involves reversing the order of letters in each word.
through the use of keys. A key is a string of data that When encrypted in this fashion, the message “MEET
determines the output of a cryptographic algorithm. ME IN THE PARK” becomes “TEEM EM NI EHT
While there are many different types of crypto- KRAP.” More complicated transposition ciphers
graphic algorithms, they are usually divided into two might involve writing out the message in a partic-
categories. Symmetric-key cryptography uses a single ular orientation (such as in stacked rows) and then
key to both encrypt and decrypt the data. Public-key reading the individual letters in a different orienta-
cryptography, also called “asymmetric-key cryptog- tion (such as successive columns).
raphy,” uses two keys, one public and one private. A substitution cipher encodes messages by sub-
Usually, the public key is used to encrypt the data, stituting certain letters in the message for other let-
and the private key is used to decrypt it. ters. One well-known early substitution cipher is the
When using symmetric-key cryptography, both the Caesar cipher, named after Julius Caesar. This ci-
sender and the recipient of the encrypted message pher encodes messages by replacing each letter with
must have access to the same key. This key must be a letter that is a specified number of positions to its
exchanged between parties using a secure channel, right or left in the alphabet. For example, Caesar is
or else it may be compromised. Public-key cryptog- reported to have used a left shift of three places when
raphy does not require such an exchange. This is one encrypting his messages.
reason that public-key cryptography is considered
more secure.
Another cryptographic technique developed for
use with computers is the digital signature. A digital SAMPLE PROBLEM
signature is used to confirm the identity of the sender
of a digital message and to ensure that no one has The following message has been encoded
tampered with its contents. Digital signatures use with a Caesar cipher using a left shift of five:
public-key encryption. First, a hash function is used JSHWDUYNTS NX KZS
to compute a unique value based on the data con-
What was the original text of the message?
tained in the message. This unique value is called a
“message digest,” or just “digest.” The signer’s private
key is then used to encrypt the digest. The combina- Answer:
tion of the digest and the private key creates the sig- The answer can be determined by replacing
nature. To verify the digital signature, the recipient each letter in the encoded message with the
uses the signer’s public key to decrypt the digest. The letter five places to the left of its position in
same hash function is then applied to the data in the the alphabet, as shown in the following chart:
message. If the new digest matches the decrypted di-
gest, the message is intact.

Decrypting a Basic Cipher


Among the earliest ciphers used were the transposi- Cipher table. Table organizes original letters and replace-
ment letters using a left shift of five cipher.
tion cipher and the substitution cipher. A transposi-
tion cipher encrypts messages by changing the order The original text read “ENCRYPTION IS FUN.”
of the letters in the message using a well-defined

76
Principles of Programming & Coding Cryptography

Using this cipher, Julius Caesar’s famous message Bibliography


“I came, I saw, I conquered” becomes “F ZXJB F PXT
Esslinger, Bernhard, et al. The CrypTool Script: Cryp-
F ZLKNRBOBA” when encrypted.
tography, Mathematics, and More. 11th ed. Frank-
furt: CrypTool, 2013. CrypTool Portal. Web. 2 Mar.
Why Is Cryptography Important?
2016.
The ability to secure communications against inter-
Hoffstein, Jeffrey, Jill Pipher, and Joseph H. Silverman.
ception and decryption has long been an impor-
An Introduction to Mathematical Cryptography. 2nd
tant part of military and international affairs. In the
ed. New York: Springer, 2014. Print.
modern age, the development of new computer-
Katz, Jonathan, and Yehuda Lindell. Introduction to
based methods of encryption has had a major impact
Modern Cryptography. 2nd ed. Boca Raton: CRC,
on many areas of society, including law enforcement,
2015. Print.
international affairs, military strategy, and business. It
Menezes, Alfred J., Paul C. van Oorschot, and Scott
has also led to widespread debate over how to balance
A. Vanstone. Handbook of Applied Cryptography.
the privacy rights of organizations and individuals
Boca Raton: CRC, 1996. Print.
with the needs of law enforcement and government
Neiderreiter, Harald, and Chaoping Xing. Algebraic
agencies. Businesses, governments, and consumers
Geometry in Coding Theory and Cryptography.
must deal with the challenges of securing digital com-
Princeton: Princeton UP, 2009. Print.
munications for commerce and banking on a daily
Paar, Christof, and Jan Pelzi. Understanding Cryptog-
basis. The impact of cryptography on society is likely
raphy: A Textbook for Students and Practitioners. Hei-
to increase as computers grow more powerful, cryp-
delberg: Springer, 2010. Print.
tographic techniques improve, and digital technolo-
gies become ever more important.
—Maura Valentino, MSLIS

77
D
DATA MINING
ABSTRACT History
Data mining has roots in three areas: classical statis-
Data mining is the relatively recent practice of using
tics, artificial intelligence, and machine learning. In
algorithms to distill patterns, summaries, and other
the late 1980s and early 1990s, companies that owned
specific forms of information from databases.
large databases of customer information, in partic-
ular credit card banks, wanted to explore the poten-
Category tial for learning more about their customers through
Business, Economics, and Marketing. their transactions. The term “data mining” had been
used by statisticians since the 1960s as a pejorative
term to describe the undisciplined exploration of
FIELDS OF STUDY
data. It was also called “data dredging” and “fishing.”
Fields of Study: Data Analysis and Probability; However, in the 1990s, researchers and practitioners
Measurement; Number and Operations. from the field of machine learning began successfully
Advances in technology in the latter half of the applying their algorithms to these large databases in
twentieth century led to the accumulation of mas- order to discover patterns that enable businesses to
sive data sets in government, business, industry, make better decisions and to develop hypotheses for
and various sciences. Extracting useful information future investigations.
from these large-scale data sets required new math- Partly to avoid the negative connotations of the
ematical and statistical methods to model data, ac- term “data mining,” researchers coined the term
count for error, and handle issues like missing data “knowledge discovery in databases” (KDD) to de-
values and different variable scales or measures. Data scribe the entire process of finding useful patterns
mining uses tools from statistics, machine learning, in databases, from the collection and preparation of
computer science, and mathematics to extract infor- the data, to the end product of communicating the
mation from data, especially from large databases. results of the analyses to others. This term gained
The concepts involved in data mining are drawn popularity in the machine learning and AI fields, but
from many mathematical fields such as fuzzy sets, the term “data mining” is still used by statisticians.
developed by mathematician and computer scien- Those who use the term “KDD” refer to data mining
tist Lotfi Zadeh, and genetic algorithms, based on as only the specific part of the KDD process where
the work of mathematicians such as Nils Barricelli. algorithms are applied to the data. The broader in-
Because of the massive amounts of data processed, terpretation will be used in this discussion.
data mining relies heavily on computers, and math- Software programs to implement data mining
ematicians contribute to the development of new emerged in the 1990s and continue to evolve today.
algorithms and hardware systems. For example, the There are open-source programs (such as WEKA,
Gfarm Grid File System was developed in the early http://www.cs.waikato.ac.nz/ml/weka and packages
twenty-first century to facilitate high-performance in R, http://www.r-project.org) and many commer-
petascale-level computing and data mining. cial programs that offer easy-to-use graphical user

78
Principles of Programming & Coding Data mining

interfaces (GUIs), which can facilitate the spread of those involving many variables at the same time, is
data mining practice throughout an organization. called “visualization.”

Algorithms
Types of Problems
Data mining uses a variety of algorithms (computer
The specific types of tasks that data mining addresses
code) based on mathematical equations to build
are typically broken into four types:
models that describe the relationship between the
response variable and a set of predictor variables.
1. Predictive Modeling (classification, regres-
The algorithms are taken from statistics and machine
sion)
learning literature, including such classical statistical
2. Segmentation (data clustering)
techniques as linear regression and logistic regres-
3. Summarization
sion and time series analysis, as well as more recently
4. Visualization
developed techniques like classification and regres-
sion trees (ID3 or C4.5 in machine learning), neural
Predictive modeling is the building of models for a
networks, naïve Bayes, K-nearest neighbor tech-
response variable for the main purpose of predicting
niques, and support vector machines.
the value of that response under new—or future—
One of the challenges of data mining is to choose
values of the predictor variables. Predictive modeling
which algorithm to use in a particular application.
problems, in turn, are further broken into classifica-
Unlike the practice in classical statistics, the data
tion problems or regression problems, depending on
miner often builds multiple models on the same data
the nature of the response variable being predicted.
set, using a new set of data (called the “test set”) to
If the response variable is categorical (for example,
evaluate which model performs best.
whether a customer will switch telephone providers
Recent advances in data mining combine models
at the end of a subscription period or will stay with
into ensembles in an effort to collect the benefits
his or her current company), the problem is called
of the constituent models. The two main ensemble
a “classification.” If the response is quantitative (for
methods are known as “bootstrap aggregation” (bag-
example, the amount a customer will spend with the
ging) and “boosting.” Both methods build many
company in the next year), the problem is a “regres-
(possibly hundreds or even thousands of) models on
sion problem.” The term “regression” is used for
resampled versions of the same data set and take a
these problems even when techniques other than
(usually weighted) average (in the case of regression)
regression are used to produce the predictions.
or a majority vote (in the case of classification) to com-
Because there is a clear response variable, predictive
bine the models. The claim is that ensemble methods
modeling problems are also called “supervised prob-
produce models with both less variance and less bias
lems” in machine learning. Sometimes there is no re-
than individual models in a wide variety of applica-
sponse variable to predict, but an analyst may want to
tions. This is a current area of research in data mining.
divide customers into segments based on a variety of
variables. These segments may be meaningful to the Applications
analyst, but there is no response variable to predict in Data mining techniques are being applied every-
order to evaluate the accuracy of the segmentation. where there are large data sets. A number of impor-
Such problems with no specified response variable tant application areas include the following:
are known as “unsupervised learning problems.”
Summarization describes any numerical sum- 1. Customer relationship management (CRM). Credit
maries of variables that are not necessarily used to card banks formed one of the first groups of
model a response. For example, an analyst may want companies to use large transactional data-
to examine the average age, income, and credit bases in an attempt to predict and understand
scores of a large batch of potential new customers patterns of customer behavior. Models help
without wanting to predict other behaviors. Any banks understand acquisition, retention, and
use of graphical displays for this purpose, especially cross-selling opportunities.

79
Data warehouse Principles of Programming & Coding

2. Risk and collection analytics. Predicting both kinds of data mining and discovery are illegal. There
who is most likely to default on loans and are federal and state privacy laws that protect the in-
which type of collection strategy is likely to be formation of individuals. Nearly every Web site, credit
successful is crucial to banks. card company, and other information collecting
3. Direct marketing. Knowing which customers organization has a publicly available privacy policy.
are most likely to respond to direct marketing Social networking sites, such as Facebook, have been
could save companies billions of dollars a year criticized for sharing and selling information about
in junk mail and other related costs. subscribers for data mining purposes. In healthcare,
4. Fraud detection. Models to identify fraudulent the Health Insurance Portability and Accountability
transactions are used by banks and a variety Act of 1996 (HIPAA) was enacted to help protect
of government agencies including state comp- individuals’ health information from being shared
troller’s offices and the Internal Revenue Ser- without their knowledge.
vice (IRS).
5. Terrorist detection. Data mining has been used —Richard De Veaux
by various government agencies in an attempt
to help identify terrorist activity—although
concerns of confidentiality have accompanied Bibliography
these uses. Berry, M. A. J., and G. Linoff. Data Mining Techniques
6. Genomics and proteomics. Researchers use data For Marketing, Sales and Customer Support. Hoboken,
mining techniques in an attempt to associate NJ: Wiley, 1997.
specific genes and proteins with diseases and De Veaux, R. D. “Data Mining: A View From Down in
other biological activity. This field is also the Pit.” Stats 34 (2002).
known as “bioinformatics.” ———, and H. Edelstein. “Reducing Junk Mail Using
7. Healthcare. Data mining is increasingly used to Data Mining Techniques.” In Statistics: A Guide
study efficiencies in physician decisions, phar- to the Unknown. 4th ed. Belmont, CA: Thomson,
maceutical prescriptions, diagnostic results, Brooks-Cole, 2006.
and other healthcare outcomes. Piatetsky-Shapiro, Gregory. “Knowledge Discovery in
Real Databases: A Workshop Report.” AI Magazine
Concerns and Controversies 11, no. 5 (January 1991).
Privacy issues are some of the main concerns of the
public with respect to data mining. In fact, some

DATA WAREHOUSE
A data warehouse is a database that collects informa- Overview
tion from various disparate sources and stores it in Computer scientist William H. Inmon, is largely cred-
a central location for easy access and analysis. The ited with having codified and popularized the concept
data stored in a data warehouse is a static record, or a of data warehousing. Inmon began discussing the
snapshot, of what each item looked like at a specific underlying principles in the 1970s and published the
point in time. This data is not updated; rather, if the first book on the subject, Building the Data Warehouse,
information has changed over time, later snapshots in 1992. The term itself was coined in 1988 when Barry
of the same item are simply added to the warehouse. A. Devlin and Paul T. Murphy published their paper
Data warehouses are commonly used in business to “An Architecture for a Business and Information
aid management in tracking a company’s progress System,” which discusses a new software architecture
and making decisions. they describe as a “business data warehouse.”

80
Principles of Programming & Coding Data warehouse

Alternatively, the bottom-up model of data ware-


housing, developed by Ralph Kimball, views a data
warehouse as simply a union of the various data
marts. In this method, the data marts—separate
databases used and maintained by individual
departments—are created first and then linked to
create a data warehouse. The merits of one approach
over the other are often debated; the cheaper, faster,
and more flexible bottom-up design is generally re-
garded as better in small or medium-sized businesses
but too unwieldy for large corporations, where the
sheer number of different people entering new data
into different data marts would make any efforts
to maintain consistency and avoid duplication ex-
tremely time consuming.
Data warehouse overview. Cloud computing is the use of a remote server
network on the Internet rather than a local server or
hard drive to store, manage, and process data. Cloud
Simply put, a data warehouse is a central database computing can be used for data warehousing; ware-
that contains copies of information from several dif- housing data in the cloud offers both benefits and
ferent sources, such as other, smaller databases and challenges. The benefits of moving a data warehouse
company records, stored in a read-only format so to the cloud include the potential to lower costs and
that nothing in the warehouse can be changed or increase flexibility and access. Challenges include
overwritten. Since its inception, data warehousing maintaining data security and privacy, network per-
has been associated with the field of business intel- formance, and management of intellectual property.
ligence, which deals with analyzing a company’s accu-
mulated data for the purpose of developing business —Randa Tantawi, PhD
strategies. However, data warehouses are used in non-
business contexts as well, such as scientific research
or analysis of crime statistics. Bibliography
There are two main approaches to designing a data Chandran, Ravi. “DW-on-Demand: The Data
warehouse: from the top down and from the bottom Warehouse Redefined in the Cloud.” Business
up. Inmon champions the top-down model, in which Intelligence Journal 20.1 (2015): 8–13. Business
the warehouse is designed as a central information Source Complete. Web. 8 June 2015.
repository. Data is entered into the warehouse in its Devlin, Barry A., and Paul T. Murphy. “An Architecture
most basic form, after which the warehouse can be for a Business and Information System.” IBM
subdivided into data marts, which group together re- Systems Journal 27.1 (1988): 60–80. Print.
lated data for easy access by the team or department Greenfield, Larry. Data Warehousing Information
to which that information pertains. The advantages Center. LGI Systems, 1995. Web. 8 Oct. 2013.
of creating data marts in a top-down data warehouse Griffith, Eric. “What Is Cloud Computing?” PC
include increased performance for the user, as they Magazine. Ziff Davis, PCMag Digital Group, 17 Apr.
can be accessed with greater efficiency than the 2015. Web. 8 June 2015.
much larger warehouse, as well as the ability to in- Henschen, Doug, Ben Werther, and Scott Gnau. “Big
stitute individual security protocols on different sub- Data Debate: End Near for Data Warehousing?”
sets of data. However, data marts are not a necessary InformationWeek. UBM Tech, 19 Nov. 2012. Web. 8
component of top-down warehouse design, and they Oct. 2013.
have their drawbacks, such as a propensity toward du- Inmon, William H. Building the Data Warehouse. 4th
plicated or inconsistent data. ed. Indianapolis: Wiley, 2011. Print.

81
Database design Principles of Programming & Coding

Laberge, Robert. The Data Warehouse Mentor: Practical Making.” International Journal of Engineering Science
Data Warehouse and Business Intelligence Insights. and Technology 3.7 (2011): 6049–57. PDF file.
New York: McGraw, 2011. Print. Steier, Sandy. “To Cloud or Not to Cloud: Where
Mohamed, Arif. “A History of Cloud Computing.” Does Your Data Warehouse Belong?” Wired. Condé
Computer Weekly. TechTarget, 2000–2015. Web. 8 Nast, 29 May 2013. Web. 9 Oct. 2013.
June 2015. Williams, Paul. “A Short History of Data Ware-
Singh, Ajit, D. C. Upadhyay, and Hemant Yadav. housing.” Dataversity. Dataversity Educ., 23 Aug.
“The Analytical Data Warehouse: A Sustainable 2012. Web. 8 Oct. 2013.
Approach for Empowering Institutional Decision

DATABASE DESIGN
Database design comprises the plan, models, speci- Variations in database design exist but method-
fications, and instructions for creating a structure ologies generally follow a sequence of steps starting
(database) where data can be stored in a permanent with gathering information and user requirements
(persistent) manner. Users can extract that data in through choosing the appropriate software and
combinations that answer questions in a particular hardware technologies and then iterative devel-
area (domain). Successful database design requires opment and testing. A six-step process defined by
complete and current understanding of database the University of Liverpool’s Computer Science
technologies and methods. Further, designers must Department is typical.
understand how people work and the types of ques- The first step in the Liverpool methodology is
tions a database will answer. Because of the wide va- the requirements analysis where an organization’s
riety of technical and intellectual skills that come information needs are documented. What does the
into play, there is an ongoing debate as to whether organization need to know? What pieces of data are
database design is an art or a science. required to form the picture that the organization
requires? How are these data to be organized and
Overview relationships defined? The second step, conceptual
Databases store data so users can access it to provide database design, identifies all of the pieces of data
information and insights into how an organization is and puts them into a model in which their place and
functioning. Electronic databases, as we currently use relationships are also defined. At the same time, the
the term, date back only to the late 1950s when they business processes that create the data are also mod-
were developed for the US Department of Defense. eled. This second step is extremely critical because it
By the 1960s databases were being designed and cre- requires that the database designers thoroughly un-
ated for business and academic use. derstand the customers’ needs and way of working.
In the intervening years database design has Often a problem arises at this stage because while da-
changed in response to increased computing ca- tabase designers are experts at databases they do not
pabilities and, just as importantly, to the changing always have similar expertise in the organization’s
needs of organizations and the increasingly sophisti- business area.
cated information expertise of potential users. The third step is the choice of hardware and soft-
Several database design methods have come into ware, including the choice of security programs to
favor over the years, resulting from an evolution in protect the database. In some instances, the available
how users and designers have looked at data and how options are wide, allowing potential users to get the
it can serve their needs. Organizations’ information capabilities they need on an affordable scale.
requirements have become larger and more com- The fourth step is logical design. Business pro-
plex; how people look at information and its use has cesses (transactions) are documented and dia-
also grown more sophisticated. grammed followed by a mapping of these workflows

82
Principles of Programming & Coding Database structuring conventions

to the capabilities of the selected (or newly devel­ Churcher, Clare. Beginning Database Design: From
oped) database. The fifth step (physical design) Novice to Professional. 2nd ed. Berkeley: Apress,
determines where data will be stored and how it is 2012. Print.
moved in the database. Creswell, John. W. Research Design: Qualitative,
The final step is planning how the database is ac- Quantitative, and Mixed Methods Approaches.
tually developed with continual (iterative) testing Thousand Oaks: Sage, 2013. Print.
at every stage until installation and use when it is Currim, Sabah, et al. Using a Knowledge Learning
then usually managed by a company’s database Framework to Predict Errors in Database Design.”
administrator. Elsevier 40 (Mar. 2014): 11–31. Print.
Grad, Burton, and Thomas J. Bergin. “History of
—Robert N. Stacy, CSS, MA
Database Management Systems.” IEEE Annals of the
History of Computing 31.4 (2009): 3–5. Print.
Bibliography Hernandez, Michael J. Database Design for Mere
Badia, Antonio, and Daniel Lemire. “A Call to Arms: Mortals: A Hands-On Guide to Relational Database
Revisiting Database Design.” ACM SIGMOD Record Design. Upper Saddle River: Addison-Wesley, 2013.
40.3 (2009): 61–69. Print. Print.
Buxton, Stephen. Database Design: Know it All. Boston: Stephens, Rod. Beginning Database Design Solutions.
Morgan Kaufmann, 2009. Print. Indianapolis: John Wiley & Sons, 2009. Print.

DATABASE STRUCTURING CONVENTIONS

FIELDS OF STUDY ƒƒ primary key: an attribute that uniquely defines


each entity stored in a database.
Software Development; Coding Techniques;
ƒƒ trigger: a procedure that executes when data is
Computer Science
changed in a database.

ABSTRACT Entities and Their Attributes


Database structuring conventions are used to ensure Databases are built on entities. An entity is simply a
that a database design provides access to the required single item of interest, such as a person, thing, event,
data quickly and accurately while making efficient or place, about which data is stored. For example,
use of system resources such as network bandwidth entities in a database might represent employees
and database storage. Standard conventions are (people), products (things), concerts (events), or
used in defining entities, attributes, keys, views, and towns (places). Each entity has an associated set of
triggers. attributes, which constitute the information stored in
the database. For example, attributes of employees
PRINCIPAL TERMS might include position, salary, and years of employ-
ment. Databases can be modeled as tables, with each
ƒƒ attribute: in computer science, a property or char- entity represented by a row in the table and the var-
acteristic of an object or entity. ious attributes represented by columns. Entities of
ƒƒ entity: in a database, an item of interest whose at-
tributes constitute the data being stored.
ƒƒ foreign key: an attribute of an entity in one table
of a database that is the primary key of an entity in
another table of the same database and serves to
establish a relationship between the two entities.

83
Database structuring conventions Principles of Programming & Coding

different types are listed in separate tables. If a da- Establishing a consistent naming convention is an
tabase contained records of both a company’s em- important part of database design. When naming ob-
ployees and the different departments within that jects in a database, keep names as short, clear, and
company, for example, one table would list the em- descriptive as possible. If abbreviations are needed,
ployees and their attributes, and the other would list use standard ones. Avoid using terms that might
the departments and their attributes. change over time, as database objects can be difficult
Relationships can be constructed between entities to rename. An organization’s naming conventions,
of different types. These relationships take one of such as those used for file naming, should inform
the following main forms: one-to-one, one-to-many, database naming. Various database systems also im-
or many-to-many. For example, multiple employees pose their own limits on object naming. In general,
(many entities) might each have a relationship with underscores, not spaces, are used to separate words.
the same department (one entity). To construct A prefix or suffix may identify views.
­relationships, each entity must first be assigned an
attribute called a primary key. This is a unique iden- Using Normalization to Optimize
tifier whose value must not be repeated within the Databases
same table. An employee number might be used Once the necessary entities and attributes are de-
to uniquely identify each employee, and a unique termined, the database structure can be optimized
­department identification (ID) number could be cre- through normalization. Normalization maximizes the
ated for each department. Next, the relationship be- use of keys to relate tables to reduce duplication. For
tween entities is defined by making the primary key example, if the database of a US-based company had
of an entity in one table an attribute of an entity in one table for employees and another for customers,
the other table. This new attribute is called a foreign both tables would likely have an attribute for each
key. For example, the foreign key column of the em- entity’s state of residence. As a result, data would be
ployee table would hold the department ID of each duplicated between the two tables, taking up unneces-
employee’s department, establishing a relationship sary space. In addition, if the state names were abbrevi-
between the employee and their department. ated differently in the different tables—for example,
When data is updated in one table, it is often nec- if Texas were abbreviated as “Tex.” in one table and
essary to update data in a related table. For example, “TX” in the other—this could cause errors. During
if the department ID changes, that information must normalization, a state table would be created to store
also be changed in the employee table for all em- the name and abbreviation of each state. This table
ployees of that department. Triggers and constraints would then be linked to the employee and customer
can be used to ensure that the correct updates occur. tables using keys, thus preventing data duplication.
Normalization also ensures that the correct attrib-
utes are stored in the correct tables. For instance, it
is more logical for an employee’s work hours to be
stored in the employee table than in the department
table. This makes searches, or queries, of the data
easier to perform.
Normalization reduces the size of tables, which
offers performance advantages. Updates and inser-
tions are faster because there is no need to update
or add data in multiple places. Deletions do not risk
the loss of other, needed data. In general, normal-
ized databases perform well when data is written to
the database or changed more often than it is read.
In contrast, denormalized databases offer perfor-
Common conventions for building a database can be visualized in
mance advantages when data is read from the data-
an entity relationship model. This model shows the relationships be-
tween users, blog posts, blogs, hits, and campaigns and lists some of base more often than it is written. This is because
the attributes of each of those entities. the data required can be retrieved from a single
84
Principles of Programming & Coding Debugging

Normalization and denormalization must therefore


SAMPLE PROBLEM balance the read and write performance for a par-
ticular database.
A developer is designing a database to store
information used by a university’s payroll Good Structure Maximizes Performance
department. The database will contain at In order for a database to offer the maximum pos-
least three tables: one for the university’s sible performance while using system resources ef-
employees, one for its departments, and ficiently, it must be well designed. The foundation
one for the different campus locations. The of a successful design is a sound database structure.
following is a partial list of the names that have Established database structuring conventions help
been assigned to various database objects. developers create the most efficient database based
In addition, two views have been named: on the individual requirements of the end user.
vw_humanities_departments and vw_down- Following these conventions has proved to result in
town_maintenance_employees. Given these improved database design.
names, describe the naming conventions used
—Maura Valentino, MSLIS
by the developer.

Answer: Bibliography
All names are in lowercase, and multiple Churcher, Clare. Beginning Database Design: From
words in names are separated by underscores. Novice to Professional. 2nd ed., Apress, 2012.
Few standard abbreviations have been Harrington, Jan L. Relational Database Design and
used (e.g., in department_id, “id” is an Implementation. 4th ed., Elsevier, 2016.
abbreviation, but “department” is spelled out Hernandez, Michael J. Database Design for Mere Mortals:
rather than abbreviated as “dept”). Entity and A Hands-On Guide to Relational Database Design. 3rd
attribute names are singular. The primary keys ed., Addison-Wesley, 2013.
for each table are assigned a short name (id), MacLennan, Bruce J. Principles of Programming
and foreign key names combine the name of Languages: Design, Evaluation, and Implementation.
the entities in the referenced table with the 3rd ed., Oxford UP, 1999.
name of the primary key (e.g., department_ Mullins, Craig S. Database Administration: The Complete
id). Views are identified with a prefix (vw_). Guide to DBA Practices and Procedures. 2nd ed.,
Addison-Wesley, 2013.
Scott, Michael L. Programming Language Pragmatics.
4th ed., Elsevier, 2016.
table, which is faster than accessing multiple tables,
Van Roy, Peter, and Seif Haridi. Concepts, Techniques,
as is needed in a normalized database. Index usage
and Models of Computer Programming. MIT P, 2004.
is also more efficient if a database is denormalized.

DEBUGGING
FIELDS OF STUDY systems. It is an essential step in the development of
all kinds of programs, from consumer programs such
Computer Science; Software Engineering
as web browsers and video games to the complex
systems used in transportation and infrastructure.
ABSTRACT
Debugging can be carried out through a number of
Debugging is the process of identifying and ad- methods depending on the nature of the computer
dressing errors, known as “bugs,” in computer system in question.

85
Debugging Principles of Programming & Coding

PRINCIPAL TERMS a program’s code is syntactically correct but does not


make logical sense. For instance, a string of code
ƒƒ delta debugging: an automated method of debug-
with flawed logic may cause the program to become
ging intended to identify a bug’s root cause while
caught in an unintended loop. This can cause it to
eliminating irrelevant information.
become completely unresponsive, or freeze. In other
ƒƒ in-circuit emulator: a device that enables the de-
cases, a logic error might result when a program’s
bugging of a computer system embedded within a
code instructs the computer to divide a numerical
larger system.
value by zero, a mathematically impossible task.
ƒƒ integration testing: a process in which multiple
units are tested individually and when working in Why Debug?
concert. Bugs may interfere with a program’s ability to per-
ƒƒ memory dumps: computer memory records from form its core functions or even to run. Not all bugs
when a program crashed, used to pinpoint and ad- are related to a program’s core functions, and some
dress the bug that caused the crash. programs may be usable despite the errors they con-
ƒƒ software patches: updates to software that correct tain. However, ease of use is an important factor that
bugs or make other improvements. many people consider when deciding which program
to use. It is therefore in the best interest of software
Understanding Debugging creators to ensure that their programs are as free of
Debugging is the process of testing software or other errors as possible. In addition to testing a program
computer systems, noting any errors that occur, and or other computer system in house prior to releasing
finding the cause of those errors. Errors, or “bugs,” them to the public, many software companies col-
in a computer program can seriously affect the lect reports of bugs from users following its release.
program’s operations or even prevent it from func- This is often done through transfers of collected data
tioning altogether. The goal of debugging is to get commonly referred to as memory dumps. They can
rid of the bugs that have been identified. This should then address such errors through updates known as
ensure the smooth and error-free operation of the software patches.
computer program or system. While bugs are an inconvenience in consumer
Computer programs consist of long strings of spe- computer programs, in more specialized computer
cialized code that tell the computer what to do and systems, they can have far more serious conse-
how to do it. Computer code must use specific vocabu- quences. In areas such as transportation, infrastruc-
lary and structures to function properly. As such code ture, and finance, errors in syntax and logic can
is written by human programmers, there is always the place lives and livelihoods at risk. Perhaps the most
possibility of human error, which is the cause of many prominent example of such a bug was the so-called
common bugs. Perhaps the most common bugs are Y2K bug. This bug was projected to affect numerous
syntax errors. These are the result of small mistakes, computer systems beginning on January 1, 2000. The
such as typos, in a program’s code. In some cases, a problem would have resulted from existing practices
bug may occur because the programmer neglected related to the way dates were written in computer
to include a key element in the code or structured it programs. However, it was largely averted through
incorrectly. For example, the code could include a the work of programmers who updated the affected
command instructing the computer to begin a spe- programs to prevent that issue. As the example of the
cific process but lack the corresponding command to far-reaching Y2K bug shows, the world’s growing reli-
end it. ance on computers in all areas of society has made
Bugs fall into one of several categories, based on thorough debugging even more important.
when and how they affect the program. Compilation
errors prevent the program from running. Run-time Identifying and Addressing Bugs
errors, meanwhile, occur as the program is run- The means of debugging vary based on the nature
ning. Logic errors, in which flaws in the program’s of the computer program or system in question.
logic produce unintended results, are a particularly However, in most cases bugs may be identified and
common form of bug. Such errors come about when addressed through the same general process. When a

86
Principles of Programming & Coding Device drivers

bug first appears, the programmer or tester must first debugging known as integration testing is often used
attempt to reproduce the bug in order to identify the when a program consists of numerous components.
results of the error and the conditions under which After each component is tested and debugged on its
they occur. Next, the programmer must attempt own, they are linked together and tested as a unit.
to determine which part of the program’s code is This ensures that the different components function
causing the error to occur. As programs can be quite correctly when working together.
complex, the programmer must simplify this process
by eliminating as much irrelevant data as possible. Historical Note
Once the faulty segment of code has been found, the The first computer bug was an actual bug (insect)
programmer must identify and correct the specific that had flown into one of the old vacuum tube com-
problem that is causing the bug. If the cause is a typo puters and fried itself. The name stuck even after the
or a syntax error, the programmer may simply need technology changed.
to make a small correction. If there is a logic error,
—Joy Crelin
the programmer may need to rewrite a portion of the
code so that the program operates logically.
Bibliography
Debugging in Practice Foote, Steven. Learning to Program. Upper Saddle
Programmers use a wide range of tools to debug River: Pearson, 2015. Print.
programs. As programs are frequently complex and McCauley, Renée, et al. “Debugging: A Review of
lengthy, automating portions of the debugging pro- the Literature from an Educational Perspective.”
cess is often essential. Automated debugging pro- Computer Science Education 18.2 (2008): 67–92.
grams, or “debuggers,” search through code line by Print.
line for syntax errors or faulty logic that could cause Myers, Glenford J., Tom Badgett, and Corey Sandler.
bugs. A technique known as delta debugging pro- The Art of Software Testing. Hoboken: Wiley, 2012.
vides an automated means of filtering out irrelevant Print.
information when the programmer is looking for the St. Germain, H. James de. “Debugging Programs.”
root cause of a bug. University of Utah. U of Utah, n.d. Web. 31 Jan. 2016.
Different types of programs or systems often require “What Went Wrong? Finding and Fixing Errors
different debugging tools. An in-circuit emulator is through Debugging.” Microsoft Developer Network
used when the computer system being tested is an Library. Microsoft, 2016. Web. 31 Jan. 2016.
embedded system (that is, one located within a larger Zeller, Andreas. Why Programs Fail: A Guide to Systematic
system) and cannot otherwise be accessed. A form of Debugging. Burlington: Kaufmann, 2009. Print.

DEVICE DRIVERS
FIELDS OF STUDY could ever need to communicate with. OSs contain
some device drivers, but these can also be installed
Computer Engineering; Software Engineering
when new devices are added to a computer.
ABSTRACT PRINCIPAL TERMS
Device drivers are software interfaces that allow a ƒƒ device manager: an application that allows users
computer’s central processing unit (CPU) to commu- of a computer to manipulate the device drivers
nicate with peripherals such as disk drives, printers, installed on the computer, as well as adding and
and scanners. Without device drivers, the computer’s removing drivers.
operating system (OS) would have to come prein- ƒƒ input/output instructions: instructions used by
stalled with information about all of the devices it the central processing unit (CPU) of a computer

87
Device drivers Principles of Programming & Coding

when information is transferred between the CPU drive has to other hardware in the computer . The
and a device such as a hard disk . device driver acts as an interface between computer
ƒ interface: the function performed by the device components .
driver, which mediates between the hardware When a program needs to send commands to a
of the peripheral and the hardware of the com- peripheral connected to the computer, the program
puter . communicates with the device driver . The device
ƒ peripheral: a device that is connected to a com- driver receives the information about the action that
puter and used by the computer but is not part of the device is being asked to perform . It translates this
the computer, such as a printer . information into a format that can be input into the
ƒ virtual device driver: a type of device driver used device . The device then performs the task or tasks re-
by the Windows operating system that handles quested . When it finishes, it may generate output that
communications between emulated hardware and is communicated to the driver, either as a message
other devices . or as a simple indication that the task has been com-
pleted . The driver then translates this information
How Device Drivers Work into a form that the original program can understand .
The main strength of device drivers is that they en- The device driver acts as a kind of translator between
able programmers to write software that will run on the computer and its peripherals, conveying input/
a computer regardless of the type of devices that are output instructions between the two . Thus, the com-
connected to that computer . Using device drivers al- puter program does not need to include all the low-
lows the program to simply command the computer level commands needed to make the device function .
to save data to a file on the hard drive . It needs no The program only needs to be able to tell the device
specific information about what type of hard drive driver what it wants the device to do . The device driver
is installed in the computer or connections the hard takes care of translating this into concrete steps .

Device Device Bus Device Device


Driver Driver ... Driver ... Driver Driver

Device Controller / Bus Driver Bus Bus


Driver Driver

CPU
Micro-controller

Device Controller Device Device


Controller Controller

Device DVD
Mouse Keyboard ... Controller ... Monitor
Reader
Each device connected to a CPU is controlled by a device driver, software that controls, manages, and monitors a specific device (e .g .,
keyboard, mouse, monitor, DVD reader) . Device drivers may also drive other software that drives a device (e .g ., system management bus,
universal serial bus controller) .

88
Principles of Programming & Coding Diffusion of innovations

How Device Drivers Are Made to emulate a piece of hardware. This often occurs
Writing device drivers is a highly technical under- when an OS runs a program that was created for a
taking. It is made more challenging by the fact that different OS by emulating that operating environ-
device drivers can be unforgiving when a mistake is ment. One example would be a Windows OS running
made in their creation. This is because higher-level a DOS program. If the DOS program needed to in-
applications do not often have unlimited access to terface with an attached printer, the computer would
all of the computer’s functionality. Issuing the wrong use a virtual device driver.
command with unrestricted privileges can cause se-
rious damage to the computer’s operating system Device Managers
(OS) and, in some cases, to the hardware. This is a Most OSs now include device managers that make
real possibility with device drivers, which usually need it easier for the user to manage device drivers. They
to have unrestricted access to the computer. allow the user to diagnose problems with devices,
Because writing a device driver requires a lot of troubleshoot issues, and update or install drivers.
specialized information, most device drivers are Using the graphical interface of a device manager
made by software engineers who specialize in driver is less intimidating than typing in text commands to
development and work for hardware manufacturers. perform driver-related tasks.
Usually the device manufacturer has the most infor-
—Scott Zimmer, JD
mation about the device and what it needs to function
properly. The exception to this trend is the impres-
sive amount of driver development accomplished by Bibliography
the open-source movement. Programmers all over Corbet, Jonathan, Alessandro Rubini, and Greg
the world have volunteered their own time and talent Kroah-Hartman. Linux Device Drivers. 3rd ed.
to write drivers for the Linux OS. Cambridge: O’Reilly, 2005. Print.
Often development is separated into logical and McFedries, Paul. Fixing Your Computer: Absolute
physical device driver development. Logical device Beginner’s Guide. Indianapolis: Que, 2014. Print.
driver development tends to be done by the creator Mueller, Scott. Upgrading and Repairing PCs. 22nd ed.
of the OS that the computer will use. Physical device Indianapolis: Que, 2015. Print.
driver development, meanwhile, is handled by the Noergaard, Tammy. Embedded Systems Architecture: A
device manufacturer. This division of labor makes Comprehensive Guide for Engineers and Programmers.
sense, but it does require coordination and a will- 2nd ed. Boston: Elsevier, 2012. Print.
ingness to share standards and practices among the Orwick, Penny, and Guy Smith. Developing Drivers with
various parties. the Windows Driver Foundation. Redmond: Microsoft
P, 2007. Print.
Virtual Device Drivers “What Is a Driver?” Microsoft Developer Network.
Virtual device drivers are a variation on traditional Microsoft, n.d. Web. 10 Mar. 2016.
device drivers. They are used when a computer needs

DIFFUSION OF INNOVATIONS
Diffusion of innovations (DOI) theory offers a frame- as new by an individual or culture. Diffusion is the
work for studying the processes of adopting an inno- process whereby an innovation is communicated over
vation through the lens of change; it tells the story of time among the members of a social system resulting
why and how quickly change occurs. Everett Rogers’s in individual or social change. Diffusion of innova-
1962 seminal book, Diffusion of Innovations, defines tions applies primarily to technology integration and
innovations as ideas, practices, or objects perceived paves the way to study adoption in other disciplines.

89
Diffusion of innovations Principles of Programming & Coding

Overview A final component offered by the DOI theory is


In the fifth edition of Diffusions of Innovations Rogers a classification structure of adopters. Innovators
describes adoption as the “full use of an innovation as tend to rapidly embrace a technology, followed
the best course of action available” and rejection as closely by early adopters who readily accept change.
the decision “not to adopt an innovation.” Four ele- Alternately, early majority adopters typically need
ments of DOI theory include innovation, time, com- more time, whereas, late majority adopters openly
munication channels, and social systems. The accep- express skepticism but will eventually buy-in to the in-
tance of an innovation is influenced by uncertainty. novation once the majority has accepted the change.
Change can often be a slow, uncomfortable process, Individuals more comfortable with the status quo are
which takes time before diffusion is accomplished. termed laggards.
Adoption research has kindled the development
of two popular instruments designed to measure
change. In 1973 Gene Hall and colleagues devel-
oped the concerns-based adoption model (CBAM)
that measures change along the continuum of skill
development. A second dimension of CBAM identi-
fies stages of concern (SoC), in which concern is con-
ceptualized as the intensity of motivations, thoughts,
and feelings moving an individual past internal ac-
ceptance toward a more global perspective.
Rogers’s theoretical framework remains the most
widely used theory leading to a deeper understanding
of the process and rate of adoption of an innovation.
The characteristics and classifications described are
the pivotal factors influencing individual change and
The diffusion of innovations according to Rogers (1962). With acceptance of an innovation into a social system.
successive groups of consumers adopting the new technology —Mitzi P. Trahan, MA, PhD
(shown in blue), its market share (yellow) will eventually reach the
saturation level.
Bibliography
Specialized interpersonal communication channels Gollakota, Kamala, and Kokila Doshi. “Diffusion of
are necessary for diffusion. Social systems ultimately Technological Innovations in Rural Areas.” Journal
decide to modify an innovation to fit their culture. of Corporate Citizenship 41 (2011): 69–82. Print.
Rogers proposes that the rate of adoption is influ- Hall, Gene E., R. C. Wallace, and W. A. Dossett.
enced by multiple perceptions of relative advantage A Developmental Conceptualization of the Adoption
over a previous technology, compatibility with ex- Process within Educational Institutions. Austin: U of
isting needs, complexity and perceived difficulty of Texas, 1973. Print.
use, and available trialability and observability to ex- Hebert, Dustin M. “Innovation Diffusion Factors
periment and see the results of the innovation. The Affecting Electronic Assessment System Adoption
rate of adoption has been found to be positively cor- in Teacher Education.” National Teacher Educational
related to these characteristics. Journal 5.2 (2012): 35–44. Print.
Diffusion of an innovation occurs in stages, begin- Magsamen-Conrad, Kate, et al. “Bridging the Divide:
ning with knowledge and followed by persuasion, Using UTAUT to Predict Multigenerational Tablet
decision, implementation, and finally confirmation. Adoption Practices.” Computers in Human Behavior
Knowledge relates to the upfront understanding of 50 (2015): 186–196. Print.
the new technology. Persuasion is a positive attitudinal Neo, Emily, and Philip J. Calvert. “Facebook and the
disposition. Decision is closely aligned to commitment Diffusion of Innovation in New Zealand Public
followed by implementation. Confirmation is deter- Libraries.” Journal of Librarianship and Information
mined by the positive outcomes that reinforce use. Science 44.4 (2012): 227–37. Print.

90
Principles of Programming & Coding Digital divide

Parrinello, Michael. C. “Prevention of Metabolic Soffer, Tal, Rafi Nachmias, and Judith Ram.
Syndrome from Atypical Antipsychotic “Diffusion of Web Supported Instruction in Higher
Medications: Applying Rogers’ Diffusion of Education—the Case of Tel-Aviv University.”
Innovations Model in Clinical Practice.” Journal of Journal of Educational Technology & Society 13.3
Psychosocial Nursing & Mental Health Services 50.12 (2010): 212. Print.
(2012): 36–44. Print. Stummer, Christian, et al. “Innovation Diffusion
Rogers, Everett M. Diffusion of Innovations. 5th ed. of Repeat Purchase Products in a Competitive
New York: Free Press, 2003. Print. Market: An Agent-Based Simulation Approach.”
Sahin, Ismail I. “Detailed Review of Rogers’ European Journal of Operational Research 245.1
Diffusion of Innovations Theory and Educational (2015): 157–167. Print.
Technology-related Studies Based on Rogers’ Zhang, Xiaojun, et al. “Using Diffusion of Innovation
Theory.” The Turkish Online Journal of Educational Theory to Understand the Factors Impacting
Technology 5.2 (2006): 14–23. PDF file. Patient Acceptance and Use of Consumer
Shinohara, Kazunori, and Hiroshi Okuda. “Dynamic E-Health Innovations: A Case Study in a Primary
Innovation Diffusion Modeling.” Computational Care Clinic.” BMC Health Services Research 15.1
Economics 35.1 (2010): 51–62. Print. (2015): 1–15. PDF file.

DIGITAL DIVIDE
The advent of Information and Communication 2013 data from the Pew Research Center shows that
Technology (ICT), including a range of digital de- children and youth from American Indian, Latino,
vices that allow connection to the Internet, has and African-American backgrounds have signifi-
changed the way people communicate, interact, cantly lower access to technology than children and
learn, produce, and circulate information. While youth from white and Asian-American backgrounds;
ICTs have been lauded for their potential to democ- residents in rural areas less likely to have access to
ratize access to information, a serious gap exists in ac- computers in their households; and there is a gen-
cess to and use of ICTs. This gap is often referred to as erational gap between young people, who have had
the digital divide. The digital divide surfaces between access to and experience with ICTs, and older adults,
countries based on economic and technological for whom opportunities to access and learn with ICTs
infrastructure. It also emerges within a country, be- has been limited. People with disabilities and people
tween individuals who differ in terms of social class, who speak Spanish as their primary language are also
education, location (urban or rural), age, and racial significantly less likely to use the Internet at all, and
and ethnic backgrounds. Over time, the definition of the gap is even larger when looking only at those who
the digital divide has expanded to include access to can access the Internet at home. The factors that ap-
skill development, as well as access and use of ICTs. pear to be most significant for higher levels of access
and use, however, are higher levels of income and
Overview education.
Initially, the digital divide was defined as the gap The digital divide identifies a new landscape of in-
between those with access to ICTs, the “haves,” and equity. People who do not have access to ICTs early in
those without access, the “have-nots.” The absence life and/or frequently are at a disadvantage. They will
of or limited access to affordable ICT infrastruc- have limited access to information, including media
ture and services is viewed as a contributing factor reports, medical information, and opportunities to
to the growing digital divide between and within learn, as well as limited access to current methods of
countries. Within countries, differences along the communication. Cost, inadequate computer skills,
lines of income, education, location, age, and race and lack of interest are some factors relating to peo-
and ethnicity are factors that differentiate ICT and ple’s disconnection from the Internet. In response,
Internet use. For example, in the United States, scholars are studying a second kind of divide that

91
Digital divide Principles of Programming & Coding

Der Digitale Graben (vgl. 1. Abbildung); Karte ohne Jahr.

includes differences in ICT skills and skill develop- effective use of ICTs in classrooms and enable stu-
ment as attributes of a widening digital gap. dents to benefit from, and grow with, the digitized
Access to, use of, and skills for engaging with ICTs world. However, until availability, access, and skills
are not developing equally across groups, communi- are made equally available to everyone, inside of and
ties, and countries. A lack of availability, access, and outside of schools, the digital divide is likely to exist.
experience with ICTs, along with the thinking and
—Hitaf R. Kady, MA, and
practical skills that develop as a result, is hampered by
Jennifer A. Vadeboncoeur, MA, PhD
insufficient public services and scarcity in technology
resources. Educational environments are positioned
to either: (1) contribute to the divide, for example, Bibliography
when educators lack preparation and support to Creeber, Glen, and Royston Martin, eds. Digital
teach with ICTs; or (2) enable children and youth to Cultures: Understanding New Media. Berkshire:
overcome it, for example, when the use of ICTs is in- Open UP, 2009. Print.
tegrated throughout classroom practices as a method File, Thom. “Computer and Internet Use in the
for both teaching and learning. Educational policies United States: Population Characteristics.” Census.
and practices are changing in ways that support the gov. US Dept. of Commerce, 2013. PDF file.

92
Principles of Programming & Coding Digital forensics

Graham, Mark. “The Knowledge Based Economy Technology & Politics 7 (2010): 22–35. Taylor &
and Digital Divisions of Labour.” The Companion to Francis Online. PDF file.
Development Studies. Ed. V. Desai and R. Potter. 3rd Nair, Mahendhiran, Mudiarasan Kuppusamy, and
ed. London: Routledge, 2014. 189–95. Print. Ron Davison. “A Longitudinal Study on the
Kellner, Douglas. “New Media and New Literacies: Global Digital Divide Problem: Strategies to Close
Reconstructing Education for the New Cross-Country Digital Gap.” The Business Review
Millennium.” The Handbook of New Media: Cambridge 4.1 (2005): 315–26. PDF file.
Social Shaping and Consequences of ICTs. Eds. National Telecommunications and Information
Leah Lievrouw and Sonia Livingstone. Thousand Administration. “Digital Nation: Expanding
Oaks: Sage, 2002. Print. Internet Usage.” National Telecommunications and
Light, Jennifer. “Rethinking the Digital Divide.” Information Administration. US Dept. of Commerce,
Harvard Educational Review 71.4 (2001): 709–33. 2011. PDF file.
Print. Rainie, Lee. “The State of Digital Divides.” Pew
Looker, Dianne, and Victor Thiessen. “The Digital Research Internet Project. Pew Research Center, 5
Divide in Canadian Schools: Factors Affecting Nov. 2013. Web. 11 Nov. 2014.
Student Access to and Use of Information Tatalović, Mićo. “How Mobile Phones Increased the
Technology.” Statistics Canada. Statistics Canada, Digital Divide.” SciDev.Net. SciDev.Net, 26 Feb.
2003. PDF file. 2014. Web. 11 Nov. 2014.
Min, Seong-Jae. “From the Digital Divide to the van Deursen, Alexander, and Jan van Dijk. “Internet
Democratic Divide: Internet Skills, Political Skills and the Digital Divide.” New Media and Society
Interest, and the Second-Level Digital Divide in 13.6 (2010): 893–911. PDF file.
Political Internet Use.” Journal of Information

DIGITAL FORENSICS
FIELDS OF STUDY ƒƒ logical copy: a copy of a hard drive or disk that
captures active data and files in a different con-
Information Technology; System Analysis; Privacy
figuration from the original, usually excluding
ABSTRACT free space and artifacts such as file remnants;
contrasts with a physical copy, which is an exact
Digital forensics is a branch of science that studies copy with the same size and configuration as the
stored digital data. The field emerged in the 1990s original.
but did not develop national standards until the ƒƒ metadata: data that contains information about
2000s. Digital forensics techniques are changing rap- other data, such as author information, organiza-
idly due to the advances in digital technology. tional information, or how and when the data was
created.
PRINCIPAL TERMS
ƒƒ Scientific Working Group on Digital Evidence
ƒƒ cybercrime: crime that involves targeting a com- (SWGDE): an American association of various aca-
puter or using a computer or computer network demic and professional organizations interested
to commit a crime, such as computer hacking, in the development of digital forensics systems,
digital piracy, and the use of malware or spyware. guidelines, techniques, and standards.
ƒƒ Electronic Communications Privacy Act: a 1986
law that extended restrictions on wiretapping to An Evolving Science
cover the retrieval or interception of information Digital forensics is the science of recovering and
transmitted electronically between computers or studying digital data, typically in criminal investiga-
through computer networks. tions. Digital forensic science is used to investigate

93
Digital forensics Principles of Programming & Coding

Digital Forensics Techniques


Once forensic investigators have access to equipment
that has been seized or otherwise legally obtained,
COMPUTER COMPUTER they can begin forensic imaging . This process in-
FORENSICS NETWORK volves making an unaltered copy, or forensic image,
FORENSICS
of the device’s hard drive . A forensic image records
the drive’s structures, all of its contents, and meta-
data about the original files .
MOBILE Digital DATABASE A forensic image is also known as a “physical copy .”
FORENSICS Forensics FORENSICS There are two main methods of copying computer
data, physical copying and logical copying . A physical
copy duplicates all of the data on a specific drive,
FORENSIC SOCIAL including empty, deleted, or fragmented data, and
DATA NETWORK stores it in its original configuration . A logical copy,
ANALYSIS FORENSICS by contrast, copies active data but ignores deleted
files, fragments, and empty space . This makes the
data easier to read and analyze . However, it may not
provide a complete picture of the relevant data .
Digital forensics encompasses computer forensics, mobile foren- After imaging, forensics examiners analyze the im-
sics, computer network forensics, social networking forensics, da- aged data . They may use specialized tools to recover
tabase forensics, and forensic data analysis or the forensic analysis
deleted files using fragments or backup data, which is
of large-scale data .
stored on many digital devices to prevent accidental
data loss . Automated programs can be used to search
cybercrimes . These crimes target or involve the use and sort through imaged data to find useful informa-
of computer systems . Examples include identity theft, tion . (Because searching and sorting are crucial to
digital piracy, hacking, data theft, and cyberattacks . the forensic process, digital forensics organizations
The Scientific Working Group on Digital Evidence invest in research into better search and sort algo-
(SWGDE), formed in 1998, develops industry guide- rithms) . Information of interest to examiners may
lines, techniques, and standards . include e-mails, text messages, chat records, financial
files, and various types of computer code . The tools
Digital Forensics Policy and techniques used for analysis depend largely on
Digital forensics emerged in the mid-1980s in re- the crime . These specialists may also be tasked with
sponse to the growing importance of digital data interpreting any data collected during an investiga-
in criminal investigations . The first cybercrimes tion . For instance, they may be called on to explain
occurred in the early 1970s . This era saw the emer- their findings to police or during a trial .
gence of “hacking,” or gaining unauthorized access
to computer systems . Some of the first documented Challenges for the Future
uses of digital forensics data were in hacking Digital forensics is an emerging field that lags behind
investigations . fast-changing digital technology . For instance, cloud
Prior to the Electronic Communications Privacy computing is a fairly new technology in which data
Act (ECPA) of 1986, digital data or communica- storage and processing is distributed across multiple
tions were not protected by law and could be col- computers or servers . In 2014, the National Institute
lected or intercepted by law enforcement . The ECPA of Standards and Technology identified sixty-five
was amended several times in the 1990s and 2000s challenges that must be addressed regarding cloud
to address the growing importance of digital data computing . These challenges include both technical
for private communication . In 2014, the Supreme problems and legal issues .
Court ruled that police must obtain a warrant before The SWGDE works to create tools and standards
searching the cell phone of a suspect arrested for a that will allow investigators to effectively retrieve
crime . and analyze data while keeping pace with changing

94
Principles of Programming & Coding Digital libraries

technology. It must also work with legal rights orga­ Gogolin, Greg. Digital Forensics Explained. Boca Raton:
nizations to ensure that investigations remain within CRC, 2013. Print.
boundaries set to protect personal rights and privacy. Holt, Thomas J., Adam M. Bossler, and Kathryn C.
Each forensic investigation may involve accessing Seigfried-Spellar. Cybercrime and Digital Forensics:
personal communications and data that might be An Introduction. New York: Routledge, 2015. Print.
protected under laws that guarantee free speech and Pollitt, Mark. “A History of Digital Forensics.”
expression or prohibit unlawful search and seizure. Advances in Digital Forensics VI. Ed. Kam-Pui Chow
The SWGDE and law enforcement agencies are de- and Sujeet Shenoi. Berlin: Springer, 2010. 3–15.
bating changes to existing privacy and surveillance Print.
laws to address these issues while enabling digital fo- Sammons, John. The Basics of Digital Forensics:
rensic science to continue developing. The Primer for Getting Started in Digital Forensics.
Waltham: Syngress, 2012. Print.
—Micah L. Issitt
Shinder, Deb. “So You Want to Be a Computer
Forensics Expert.” TechRepublic. CBS Interactive,
Bibliography 27 Dec. 2010. Web. 2 Feb. 2016.
“Digital Evidence and Forensics.” National Institute of
Justice. Office of Justice Programs, 28 Oct. 2015.
Web. 12 Feb. 2016.

DIGITAL LIBRARIES
In the early 1990s, when traditional library systems Digital libraries offer an important strategy for ex-
were first galvanized by the sweeping possibilities of tending the reach of traditional libraries, and public
digitalizing centuries of paper artifacts and documents and university libraries routinely subscribe to global
into computer databases, library scientists believed a databases for patron use in addition to participating
global network of digitalized materials was just around in ongoing projects to convert centuries of print ma-
the corner. This grand digital library would be acces- terial into digital format. Although library science is
sible to individual users anytime on any computer, thus well on its way to catching up to the possibilities of
rendering obsolete the notion of a library as a public digital collections, distinctions have been established
building servicing a given community. However, that between materials that have to be digitalized—a pro-
bold vision proved to be a significant challenge to bring cess that is relatively quick, cheap, and applicable to
to fruition. Computer software experts and library sci- basically to any publication from before 1990—and
entists charged with devising the systems, system links, materials that are “born digital.” Those charged with
and databases and amassing the archives to create developing the templates for digital libraries stress
digital libraries realized that reaching their goal would the virtual system’s need to organize the ever-growing
involve overcoming a myriad of complexities that still body of materials to permit efficient and transparent
remained unresolved in the early twenty-first century. access to users worldwide, given that there will be no
central digital library, simply links that connect data-
Overview bases and archives around the world. Such a system
Not every available archive of information, docu-
ments, specialized publications, and data is a digital
library; by that definition, any Internet search engine
would qualify. Instead, much like traditional libraries,
digital libraries stress organization of the materials
in addition to the traditional functions of long-term
storage and preservation. The World Digital Library logo.

95
Digital native Principles of Programming & Coding

would require well-trained professionals to move Libraries.” E-Publishing and Digital Libraries: Legal
users smoothly through an often-intimidating net- and Organizational Issues. Ed. Ioannis Iglezakis,
work of information. Tatiana-Eleni Synodinou, and Sarantos Kapidakis.
The development of digital libraries poses a Hershey: IGI Global, 2011. 1–30. Print.
number of significant challenges, including de- Chowdhury, G. G., and Schubert Foo, eds. Digital
signing the superstructure of an architecturally Libraries and Information Access: Research Perspectives.
sound interrelated network of systems, rewriting ex- New York: Neal, 2012. Print.
isting international copyright laws for reproduction Goodchild, Michael F. “The Alexandria Digital
and distribution of materials, and generating meta- Library Project: Review, Assessment, and
data—that is, data that describes and can be used to Prospects.” Trends in Information Management 1.1
catalog primary materials, much like traditional card (2005): 20–25. Web. 21 Aug. 2013.
catalogs or indexes. In addition, libraries must keep Jeng, Judy. “What Is Usability in the Context of the
up with the ever-expanding body of data that includes Digital Library and How Can It Be Measured?”
not only traditional print materials, such as books Information Technology and Libraries 24.2 (2005):
and periodicals, but also films, music, government re- 47–56. Web. 21 Aug. 2013.
cords, and scientific and research data. Coordinating Lesk, Michael. Understanding Digital Libraries. 2nd ed.
a theoretically unlimited number of digital libraries, San Francisco: Morgan, 2004. Print.
each storing and organizing a specific area of avail- McMurdo, Thomas, and Birdie MacLennan. “The
able materials, and putting that network within reach Vermont Digital Newspaper Project and the
of users ably assisted by digital librarians is the chal- National Digital Newspaper Program: Cooperative
lenge that remains for library scientists and com- Efforts in Long-Term Digital Newspaper Access
puter engineers. and Preservation.” Library Resources & Technical
Services 57.3 (2013): 148–63. Web. 21 Aug. 2013.
—Joseph Dewey, MA, PhD
Reese, Terry, Jr., and Kyle Banerjee. Building Digital
Libraries: A How-to-Do-It Manual. New York: Neal,
2008. Print.
Bibliography Yi, Esther. “Inside the Quest to Put the World’s
Candela, Leonardo, Donatella Castelli, and Pasquale Libraries Online.” Atlantic. Atlantic Monthly
Pagano. “History, Evolution, and Impact of Digital Group, 26 July 2012. Web. 21 Aug. 2013.

DIGITAL NATIVE
A digital native is someone who was born during Overview
or after the information age, a period of emerging The term “digital native” was coined by writer Marc
digital technology. The term “digital native” most Prensky in 2001 in an article for the journal On
commonly refers to those born at the end of the the Horizon about an emerging issue in education;
twentieth century and into the twenty-first century. he also created the term “digital immigrant” in the
Digital natives began interacting with digital tech- same article. In the article, he was writin