Please add links to your favorite programming books with a short description.
The goal is to make a minimal reading list to become a good programmer. Feel free to discuss the listed books and propose better alternatives.
Algorithms
- Introduction to computer programming using LOGO language (free e-book). Very good for an absolute beginner (includes such topics as loops, conditions, procedures, recursion, etc.) You can use an online LOGO interpreter for executing your programs.
- Algorithms in C (also in C++ and Java) by Robert Sedgewick (printed book). A practical book on algorithms with examples, pictures, and source code. Covers most classical algorithms: sorting, search trees, hash tables, B-trees, graph algorithms, etc.
- Introduction to Algorithms (lecture notes from MIT). The code is in Python.
- Algorithms by S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani (free e-book, printed book). Covers primality testing, graph theory, dynamic programming, and other interesting theoretical problems.
- Wikibook on algorithms (free e-book). It's unfinished, but still useful for learning design of algorithms including divide-and-conquer, backtracking, and other methods.
- Algorithms and Data Structures by Niklaus Wirth, the author of Pascal language (e-book).
- Algorithmic Graph Theory by David Joyner, Minh Van Nguyen, and Nathann Cohen (e-book). Under construction (as of March 2010), but already useful as an introduction to graph theory.
- Dynamic Programming Practice Problems (a web-site with flash animation). Dynamic programming problems and their solutions.
- Lecturefox. Free university lectures (video lectures, podcasts, and lecture notes).
- Google Code University (articles, e-books). Some information on algorithms and web programming (AJAX, Python). For example, read Robert Sedgewick's course on algorithms.
Math algorithms and optimization
- Numerical Recipes in C (free e-book). Algorithms for computer math (such as integration or solving differential equations).
- The Floating-Point Guide (web site). What every programmer should know about floating-point arithmetic.
- Simply FPU by Raymond Filiatreault (web site). A detailed tutorial on x87 FPU programming.
- The Elements of Statistical Learning: Data Mining, Inference, and Prediction by Trevor Hastie, Robert Tibshirani, and Jerome Friedman (free e-book). A book on data analysis and data mining.
- An Introduction to Data Mining and presentations by Dr. Saed Sayad.
- Applied Mathematical Programming by Bradley, Hax, and Magnanti (free e-book). This book is the main text for Introduction to Optimization taught at MIT.
Compression and encryption
- Everything you need to know about cryptography in 1 hour (slides in PDF format). An introduction to cryptography.
- Data Compression Explained by Matt Mahoney (free e-book). A good introduction to compression.
- The Scientist and Engineer's Guide to Digital Signal Processing by Steven W. Smith (free e-book). The book provides an overview of audio and image processing, speech recognition and synthesis, neural networks, data compression, and other DSP tasks.
Text processing
- String-Matching Algorithms (free e-book): Boyer-Moore, Knuth-Morris-Pratt, and alike.
- The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) by Joel Spolsky (a good introductory article).
- Unicode standard (e-book, printed book). The official description of Unicode including implementation guidelines and information about writing systems of the world.
- Roman Czyborra's web site about codepages and Unicode. Contains code charts for many popular encodings.
- Natural Language Processing lectures by Christopher D. Manning.
Compilers and Languages
- Basics of Compiler Design by Torben Æ. Mogensen (free e-book, printed book). Lexical and syntax analysis, machine code generation, register allocation, and optimization.
- Advanced Programming Language Design by Raphael A. Finkel (free e-book). Comparison of different programming languages and paradigms (OOP, functional programming, declarative languages, etc.)
- Compiler Construction by Niklaus Wirth (e-book).
- Learn Prolog Now (free e-book). An introductory course to programming in Prolog.
- Get It Done With MySQL (e-book, some chapters are free). See also Common MySQL Queries and MySQL Tips & Snippets.
C/C++
- The Development of the C Language by Dennis M. Ritchie (article).
- A Retargetable C Compiler: Design and Implementation, David R. Hanson and Christopher W. Fraser (printed book). How one good compiler (lcc) is actually written (structured explanations and code in Knuth's "literal programming" style). After learning theory about compiler writing, a good and convenient place to study one good implementation. lcc is open source. The book is documentation and explanation of the code of lcc 3.6.
- Evolving a language in and for the real world: C++ 1991-2006 by Bjarne Stroustrup (article). The history and philosophy of C++ and STL.
- The Boost C++ Libraries by Boris Schäling (free e-book).
Functional programming
- Can Your Programming Language Do This by Joel Spolsky (article). Easy-to-read introduction into functional programming.
- Advanced programming languages by Matt Might (article). What language to learn next: Haskell, Scala, OCaml, and Scheme.
- Practical Common Lisp by Peter Seibel (printed book, free e-book). A book on Lisp with practical examples (writing a spam filter, an ID3 tag parser, etc.)
- Structure and Interpretation of Computer Programs (printed book, free e-book). Learning algorithms and data structures in Scheme.
- Higher-Order Perl by Mark Jason Dominus (printed book, free e-book). About functional programming techniques in Perl. How to write functions that can modify and manufacture other functions. The book could have been smaller, still it demonstrates that "functional" ideas are not useful only in "classic" functional languages.
- Learn You a Haskell for Great Good by Miran Lipovača (free e-book). A guide to Haskell programming language.
- The Little Schemer and The Seasoned Schemer by Friedman and Felleisen (printed books). These books will teach you to 'think' in a functional way using Scheme. It has a very unique format with a series of statements and questions, and the reader must implement various functions and algorithms to solve these problems. The problems build upon one another nicely, increasing in complexity at a good pace.
Operating Systems
- Operating Systems, Fourth Edition by William Stallings (printed book). A course on high-level OS design. The design concepts are illustrated with two examples: Windows 2000 and UNIX.
- The Evolution of the Unix Time-sharing System by Dennis M. Ritchie (article).
- NTFS file system by Dmitry Mikhailov (article).
- Design and Implementation of the Second Extended Filesystem by Rémy Card, Theodore Ts'o, and Stephen Tweedie (article).
Computer architecture
- Computer Systems: A Programmer's Perspective by Randal Bryant and David O'Hallaron (printed book). This book is a must-have for programmers interested in system programming and low-level techniques. Lecture notes based on the book.
- Computer Architecture, 4th Edition, A Quantitative Approach, John L. Hennessy and David A. Patterson (printed book). Performance aspects of modern computer architectures (4th Ed is from 2007). Also read their survey of RISC architectures.
- See MIPS Run, 2nd Edition, Dominic Sweetman (printed book). For in-depth explanation of how MIPS processors function and how they should be programmed on assembly level. Very good to learn RISC logic. Another RISC architecture, ARM, is widely used in mobile phones.
- CMPSCI 201 Architecture and Assembly Language, Dr. William T. Verts. Introductionary university course (with lecture notes) which uses ARM as the target processor.
- Modern microprocessors: a 90 minute guide by Jason Patterson. A good explanation of pipelining, ILP, superscalar, VLIW, OoO, etc.
- Web lectures by Bob Brown. Explains digital logic with nice pictures and animations.
- Intel's Sandy Bridge Architecture Exposed by Anand Lal Shimpi (article). The microarchitecture of the new Intel Core i7 processors. Read also an analysis of AMD Bobcat & Bulldozer microarchitectures by the same author.
- Intel® Architecture Instruction Set Extensions Programming Reference (PDF reference). The description of new instructions in the upcoming Haswell processor, including transactional memory support, hardware random number generator, and 256-bit vector integer operations. The transactional memory instructions should be useful for GIL (global interpreter lock) in Python and Ruby. They tried to eliminate it with software TM, but it was too slow.
Software engineering
- Programming Pearls by Jon Bentley (also More Programming Pearls by the same author; both are printed books). Covers such topics as choosing the algorithm, making estimates, and optimizing your code. Easy writing style makes this book pleasant to read.
- The practice of programming by Brian W. Kernighan and Rob Pike (printed book). Contains a lot of clever ideas for improving your code (e.g. using small languages or designing better interfaces between modules).
- Code Complete by Steve McConnell (printed book). Covers a lot of topics including coding style, coding techniques, testing, debugging, refactoring, and code optimization. Every programmer will find something new for him or her in this book.
- The Pragmatic Programmer by Andrew Hunt and David Thomas (printed book). Covers the core processes involved in developing software in a professional manner.
- Code Kata by Dave Thomas (web site). Short exercises to sharpen your programming skills (from the author of The Pragmatic Programmer).
- C Unleashed by Richard Heathfield and other people from comp.lang.c newsgroup (printed book). Written by different authors, the chapters cover classical algorithms, data structures, optimization, debugging, code generation, expression evaluation, genetic algorithms, arbitrary-precision arithmetic, compression, and encryption.
Usability
- Task-Centered User Interface Design by Clayton Lewis and John Rieman (shareware e-book). An introduction to usability methods with examples and exercises.
- User Interface Design For Programmers by Joel Spolsky (article). Some ideas and principles such as designing with user model in mind and minimizing the number of options.
- Interface design chapter from Getting Real (printed book, free e-book). Useful ideas: paying more attention to blank state and error state, using one interface for users and admins.
- About Face: The Essentials of User Interface Design by Alan Cooper, Robert Reimann, and David Cronin (printed book).
- Interface Hall of Shame and Interface Hall of Fame (web site). Examples of good and bad designs. The listed programs are obsolete now, but the principles still apply. Be sure to read Globalization Tips and Writing Effective Error Messages.
- UI Pearls (web site, partially in Russian). Interesting/useful controls and UI design tricks.
- Alertbox by Jakob Nielsen (newsletter). The most authoritative column on web usability.
Code optimization
- Optimization manuals for x86 platform by Agner Fog. Detailed, frequently updated e-books on optimizing C/C++ and assembly language programs with a lot of useful tips and examples.
- Hacker's Delight by Henry Warren, Jr. A printed book on bit-hacking algorithms: rounding, bit counting, transposing bits, replacing division by constant with multiplication, etc. The web site contains some interesting info, too, for example, Computist Quiz.
- x86 Instruction Latency, Memory Latency and CPUID dumps (web site). Instruction latency and throughput tables for different processors (Intel, AMD, VIA, etc.) measured with Lavalys Everest.
Computer graphics
- Lode's Computer Graphics Tutorial (web site).
Win32 programming
- Catch-22 (web site). Win32 tips and tricks, design and implementation of a Win32 text editor in C. It's useful for anybody writing custom controls or doing Unicode text processing in Win32.
- The Old New Thing. The blog by Raymond Chen.
- Windows API Tutorial by Reliable Software. Win32 programming with C++ wrapper classes (no MFC).
Similar lists
- The Hacker Shelf: a community-edited list of free programming books.
12 comments
Ten recent comments are shown below. Show all comments
Yes you're right, radix sort is the generalization of counting sort, and I've described the counting sort. So I still must prove that "the whole idea" can be expressed shortly. So I've just stolen from the wikipedia a few sentences and modified them a little: Take the least significant group of bits (LS radix) of each key, then group the whole keys to leave them sorted by that radix, but otherwise keep the original order of keys (sorting must be "stable"). Repeat the grouping process with each more significant radix.
It can be a good exercise to try to describe some principle as short as possible without losing the important details. This also allows us to find the limits – it appears to me that counting sort would work efficiently for files much bigger than RAM (providing that counting of the keys fits in RAM of course), whereas radix can need potentially a lot of passes – so much that k in k * N is too big to be practical?
I'm still somewhat curious to learn what this guy described in the rest of the book (chapter titles certainly don't help much), but I'd really expect the short descriptions (or links to something else in better form).
(digression) I've taken a look at the "strings.ps". Benchmarks are for the computers of that time, MIPS and x86 machines, the fastest being MIPS R4400 on 150 MHz. My current router (ASUS WL-500g Premium) uses MIPS processor on 266 MHz taking only 12 W of power, total. If anybody stumbles to some sources and results of some complete benchmark which run on MIPS then I'd like to cross compile them and run them on WL-500gP. (/digression)
re radix sort, here's one implementation of radix sort over linked lists, I haven't checked details though: http://www.codersnotes.com/rsort/
IMHO, the shortest explanations are pictures:
Radix sorting is basically a counting sorting applied to each digit. The order of the digits can be MSD or LSD (most significant or least significant digit first).
I'm curious about the Heller's book, too :). Most of his optimizations are not very useful today, but he has some ideas I never found anywhere else.
Thanks for the linked lists example, it's a nice implementation (though, he should make shift a function parameter, not a template parameter).
Contains measured CPUID dumps and latency/throughput of instructions for a large number of processors
Chris Shore, ARM
http://www.eetimes.com/General/DisplayPrintViewContent?contentItemId=4210470
JavaScript: The Good Parts
presented by Doug Crockford February 27, 2009
http://www.youtube.com/watch?v=hQVTIJBZook
Two other books that I'm very fond of, covering less common but still useful algorithms:
Managing Gigabytes (Witten, Moffat and Bell). An engrossing description of text indexing and compression, as well as black & white image compression. What's nice is that in addition to describing the techniques used in the associated software, the authors describe the techniques they rejected, and why.
The Algorithm Design Manual (Steven Skiena). A level beyond the usual big-O notation and priority-queue algorithm textbooks, this describes graph algorithms and NP-hard approximation heuristics.
Stop using strncpy already!
http://randomascii.wordpress.com/2013/04/03/stop-using-strncpy-already/
checkedthreads: bug-free shared memory parallelism
http://www.yosefk.com/blog/checkedthreads-bug-free-shared-memory-parallelism.html