Foreword
Imagine you run a research or development group where writing software is the means
to examine new physics or new designs. You look for students or employees who have a
technical background in that specific physics or science, yet you also look for some software
experience. You will typically find that students will have taken a programming class or
have tinkered around with some small programs. But in general they have never written
software with any serious complexity, they have never worked in a team of people, and they
are scared to dive into an existing piece of scientific software.
Well, that is my situation. My research group studies electron flow at the nanometer
scale in the very transistors that power your future computer. As a faculty member I have
found that most of today’s graduated bachelor students in engineering or physical sciences
are used to writing small programs in scripting languages and are not even familiar with
compiling, practical debugging, or good programming practices.
I believe my situation is not unique but quite common in academia and industry. How
can you bring these novices up to speed? How can you give them the day-to-day practical
insights fast, that I had to learn through years of slow cut and try experiences?
Most advanced programming books explain complex or larger programs that are correct
and beautiful. There is an analogy here between reading a well-written book and composing
a new novel yourself. Literature analysis helps the reader to appreciate the content or the
context of a novel. While many people can read a correctly formulated algorithm in C,
few people would be able to write this code even if they were given the pseudocode (the
storyline). This book provides an entry into writing your own real code in C.
I believe that this new book provides an excellent entry way into practical software
development practices that will enable my beginning and even advanced students to be
more productive in their day-to-day work, by avoiding typical mistakes and by writing
cleaner code, since they understand the underlying implications better. This book will also
facilitate the collaborations within the group through exemplary coding styles and practices.
This book explains the importance of detecting hidden problems. A common mistake
among most students is that they pay attention to only the surface: the outputs of their
programs. Their programs may have serious problems beneath the surface. If the programs
generate correct outputs in a few cases, the students believe that the programs are correct.
This is dangerous in this connected world: A small careless mistake may become a security
threat to large complex systems. Creating a secure and reliable system starts from paying
attention to details. This book certainly covers many details where careless mistakes may
cause serious problems.
I wished I had this book some 20 years ago after I had read through Kernighan and
Richie. Back then I began writing a large code basis in C after my coding experience in
FORTRAN. Passing by reference, passing by value—simple concepts, but this book plays
out these concepts in a pedagogically sound approach. I truly like the hands-on examples
that are eye opening.
I recommend this book to anyone who needs to write software beyond the tinkering level.
You will learn how to program well. You will learn how to identify and eliminate bugs. You
will learn how to write clean code, that cleans up after itself, so it can be called millions of
xxi
xxii F oreword
times without crashing your own or someone else’s computer. You will learn how to share
code with others. All along you will begin to use standard LINUX-based tools such as ddd,
valgrind, and others.
Gerhard Klimeck
Reilly Director of the Center for Predictive Materials and Devices (c-PRIMED) and the
NCN (Network for Computational Nanotechnology)
Professor of Electrical and Computer Engineering at Purdue.
Fellow of the Institute of Physics (IOP), the American Physical Society, (APS) and
Institute of Electrical and Electronics Engineers (IEEE).
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset