No Kindle device required. Download one of the Free Kindle apps to start reading Kindle books on your smartphone, tablet, and computer.
Getting the download link through email is temporarily not available. Please check back later.

  • Apple
  • Android
  • Windows Phone
  • Android

To get the free app, enter your mobile phone number.

Digital List Price: CDN$ 31.99
Kindle Price: CDN$ 20.99

Save CDN$ 25.00 (54%)

includes free international wireless delivery via Amazon Whispernet

These promotions will be applied to this item:

Deliver to your Kindle or other device

Deliver to your Kindle or other device

From Mathematics to Generic Programming by [Stepanov, Alexander A., Rose, Daniel E.]
Kindle App Ad

From Mathematics to Generic Programming Kindle Edition

See all 3 formats and editions Hide other formats and editions
Amazon Price
New from Used from
Kindle Edition
"Please retry"
CDN$ 20.99

Length: 311 pages Enhanced Typesetting: Enabled Page Flip: Enabled

Kindle Featured Deals
Browse Kindle featured deals from our publishers. See more.

Product Description

Product Description

In this substantive yet accessible book, pioneering software designer Alexander Stepanov and his colleague Daniel Rose illuminate the principles of generic programming and the mathematical concept of abstraction on which it is based, helping you write code that is both simpler and more powerful.


If you’re a reasonably proficient programmer who can think logically, you have all the background you’ll need. Stepanov and Rose introduce the relevant abstract algebra and number theory with exceptional clarity. They carefully explain the problems mathematicians first needed to solve, and then show how these mathematical solutions translate to generic programming and the creation of more effective and elegant code. To demonstrate the crucial role these mathematical principles play in many modern applications, the authors show how to use these results and generalized algorithms to implement a real-world public-key cryptosystem.


As you read this book, you’ll master the thought processes necessary for effective programming and learn how to generalize narrowly conceived algorithms to widen their usefulness without losing efficiency. You’ll also gain deep insight into the value of mathematics to programming—insight that will prove invaluable no matter what programming languages and paradigms you use.


You will learn about

  • How to generalize a four thousand-year-old algorithm, demonstrating indispensable lessons about clarity and efficiency
  • Ancient paradoxes, beautiful theorems, and the productive tension between continuous and discrete
  • A simple algorithm for finding greatest common divisor (GCD) and modern abstractions that build on it
  • Powerful mathematical approaches to abstraction
  • How abstract algebra provides the idea at the heart of generic programming
  • Axioms, proofs, theories, and models: using mathematical techniques to organize knowledge about your algorithms and data structures
  • Surprising subtleties of simple programming tasks and what you can learn from them
  • How practical implementations can exploit theoretical knowledge


About the Author

Alexander A. Stepanov studied mathematics at Moscow State University from 1967 to 1972. He has been programming since 1972: first in the Soviet Union and, after emigrating in 1977, in the United States. He has programmed operating systems, programming tools, compilers, and libraries. His work on foundations of programming has been supported by GE, Polytechnic University, Bell Labs, HP, SGI, Adobe, and, since 2009,, Amazon’s search technology subsidiary. In 1995 he received the Dr. Dobb’s Journal Excellence in Programming Award for the design of the C++ Standard Template Library.


Daniel E. Rose is a research scientist who has held management positions at Apple, AltaVista, Xigo, Yahoo, and His research focuses on all aspects of search technology, ranging from low-level algorithms for index compression to human–computer interaction issues in web search. Rose led the team at Apple that created desktop search for the Macintosh. He holds a Ph.D. in cognitive science and computer science from University of California, San Diego, and a B.A. in philosophy from Harvard University.

Product Details

  • Format: Kindle Edition
  • File Size: 8850 KB
  • Print Length: 311 pages
  • Page Numbers Source ISBN: 0321942043
  • Simultaneous Device Usage: Up to 5 simultaneous devices, per publisher limits
  • Publisher: Addison-Wesley Professional; 1 edition (Nov. 13 2014)
  • Sold by: Amazon Digital Services LLC
  • Language: English
  • Text-to-Speech: Enabled
  • X-Ray:
  • Word Wise: Not Enabled
  • Enhanced Typesetting: Enabled
  • Average Customer Review: Be the first to review this item
  • Amazon Bestsellers Rank: #65,046 Paid in Kindle Store (See Top 100 Paid in Kindle Store)
  •  Would you like to give feedback on images or tell us about a lower price?

What Other Items Do Customers Buy After Viewing This Item?

click to open popover

Customer Reviews

There are no customer reviews yet on
5 star
4 star
3 star
2 star
1 star

Most Helpful Customer Reviews on (beta) HASH(0x9c495f30) out of 5 stars 42 reviews
51 of 53 people found the following review helpful
HASH(0x9c4abb34) out of 5 stars Great illustration of the core ideas in Generic Programming Nov. 21 2014
By kurseewalla - Published on
Format: Paperback Verified Purchase
This is a remarkable book. It vividly illustrates the relationship of abstract mathematics to generic programming, and I don't know of any other book that gets to the heart of generic programming the way this one does.

It starts by describing two algorithms which have been known for millennia - the Egyptian multiplication algorithm, and Euclid's greatest common measure algorithm - and then traces their evolution through history, describing how the algorithms were extended by successive generations of mathematicians. At each step, the authors implement the algorithm in C++, illustrating the process of taking a concrete algorithm and successively generalizing it. These two parallel threads of algorithm evolution and implementation generalization run throughout the book, providing a very compelling demonstration that the process of generalizing an algorithm is precisely the same as the process that mathematics has followed through the ages.

Along the way, we meet many great figures from mathematics, which turns what could have been a dry theoretical text into an absorbing story of the evolution of mathematical thought and the remarkable people that led it. This is an informal book, designed to be easy to read (in stark contrast to "Elements of Programming" by Stepanov and McJones), and any competent programmer with an understanding of high school math should be able to follow it comfortably.
24 of 26 people found the following review helpful
HASH(0x9c4abd80) out of 5 stars Great Resource for Designing Reusable Code Dec 15 2014
By Andrew Norton - Published on
Format: Paperback
I am currently an undergraduate CS student, and I really like using math to solve programming problems. In this book, the authors present mathematical approaches to generalization that would be extremely useful to anyone designing libraries of code.

This book applies abstract algebra to the problem of designing reusable program code. (If you're not familiar with abstract algebra already, don't worry--the authors introduce and explain the relevant concepts as needed.) It proposes a paradigm of studying operations on data types separately from the types themselves. One can then categorize these operations--for instance, whether or not the associative/commutative/distributive laws hold--and then use the templates/generics feature of a programming language to create methods that work on many different data types (sometimes these types are so far separated that one wouldn't think that the same code would work for both).

Throughout the book, the authors use the Euclidean algorithm (for computing the greatest common divisor) as an example of the flexibility of an algorithm. After analyzing what properties the related operations and data types must satisfy, they show how the *same code* for the Euclidean algorithm on integers can be used to determine the GCD of two polynomials, two complex numbers, and more. I like writing and maintaining some personal libraries of code, and I believe that the techniques that the authors cover in this book will help me write better code.

Although the primary focus of this book is on the use of Generic Programming, one part of the book that I really appreciated was the time the authors spent taking note of the efficiency of each method. Since this book is describing techniques that are to be used when designing library functions that may be called millions of times a second, every iteration of a loop matters. The authors' careful description of how they take the naive approach and pare it down to the minimum number of operations helped improve my own coding style.

The authors also provide biographical information on the people whose work greatly affected the concepts in this book. This gives the reader a sense of how this topic progressed through history. Some people may not like this (some people want to know only what is immediately useful to them right now), but I enjoyed seeing the progression and refinement of generic mathematics followed by generic programming.

This book uses C++ for all its examples (which shouldn't be unexpected--after all, Stepanov did design the STL), but the book includes a really helpful "C++ for non-C++ Programmers" section in the appendices. (My "primary language" is Java, but using that appendix made all of the code in the book quite understandable.)
18 of 19 people found the following review helpful
HASH(0x9c4abfc0) out of 5 stars Another masterpiece from Alex Stepanov Nov. 17 2014
By Fernando Pelliccioni - Published on
Format: Paperback
Another masterpiece from Alex Stepanov.
I had the honor of reviewing the draft version, and I can say it is a wonderful book!
It combines mathematics, programming and history in a gorgeous and unique way.
Contains ancient geometric algorithms, abstract algebra, and generic programming.
A journey through history, visiting the most prominent figures of mathematics, whose influence can be seen in Generic Programming.
It is a pleasure to read.
Strongly recommended for all programmers who love their profession.
Thanks Alex for improving our discipline.
61 of 77 people found the following review helpful
HASH(0x9c4b7258) out of 5 stars Not what I expected Jan. 20 2015
By Joseph - Published on
Format: Paperback
This book did not meet my expectations.
I can see from all of the very positive reviews that I am alone in my assessment. I am writing this review for people, who like myself, may come across this book, read the description, have a certain set of expectations, and get a different product from what was expected.
If you like number theory, then you will like this book.
If you like to code a numerical, computational algorithm, then you will like this book.
This book is replete with arithmetic computations where efficiency improvements can be made. The book follows the path of taking centuries-old algorithms and detailing how improvements were made to those algorithms. These improvements can be coded. If you want to read a book about numerical, computational algorithms, trace those algorithms, code algorithms, and make improvements to those algorithms, then this is the book for you.
What I expected from this book was the interlacing of mathematical concepts, which are not always grounded in nor always relevant to number theory, and software development. To be fair, I did buy Alexander Stepanov's other book, Elements, which I intent to read in its entirety as well.
Just because this book didn't meet my expectations or fulfill my interest doesn't mean it is a bad book. Again, if you like number theory, then you will like this book.
8 of 9 people found the following review helpful
HASH(0x9c4b754c) out of 5 stars This book is very good, one of a kind Dec 15 2014
By Technology - Published on
Format: Paperback Verified Purchase
This book is very good, one of a kind. Explanations are clear. It's fun to read. The math and code are intertwined in quite a remarkable fashion. I guess this is what a Rembrandt painting would look like, if painted in C++ on math canvas. I would recommend this book to anyone who programs in C++, from beginner to expert level.