Elements of Programming
by Alexander Stepanov; Paul McJones
Statistics Hacks
by Bruce Frey
Write Great Code, Volume 2
by Randall Hyde
The Art of Computer Programming Volume 4, Fascicle 4: Generating All Trees History of Combinatorial Generation
by Donald E. Knuth - Stanford University
The Art of Computer Programming, Volume 4, Fascicle 1: Bitwise Tricks & Techniques; Binary Decision Diagrams
by Donald E. Knuth - Stanford University
"This is the first book that promises to tell the deep, dark secrets of computer arithmetic, and it delivers in spades. It contains every trick I knew plus many, many more. A godsend for library developers, compiler writers, and lovers of elegant hacks, it deserves a spot on your shelf right next to Knuth."
--Josh Bloch
"When I first saw the title, I figured that the book must be either a cookbook for breaking into computers (unlikely) or some sort of compendium of little programming tricks. It's the latter, but it's thorough, almost encyclopedic, in its coverage."
--Guy Steele
These are the timesaving techniques relished by computer hackers--those devoted and persistent code developers who seek elegant and efficient ways to build better software. The truth is that much of the computer programmer's job involves a healthy mix of arithmetic and logic. In Hacker's Delight, veteran programmer Hank Warren shares the tricks he has collected from his considerable experience in the worlds of application and system programming. Most of these techniques are eminently practical, but a few are included just because they are interesting and unexpected. The resulting work is an irresistible collection that will help even the most seasoned programmers better their craft.
Topics covered include:
A broad collection of useful programming tricks
Small algorithms for common tasks
Power-of-2 boundaries and bounds checking
Rearranging bits and bytes
Integer division and division by constants
Some elementary functions on integers
Gray code
Hilbert's space-filling curve
And even formulas for prime numbers!
This book is for anyone who wants to create efficient code. Hacker's Delight will help you learn to program at a higher level--well beyond what is generally taught in schools and training courses--and will advance you substantially further than is possible through ordinary self-study alone.
0201914654B06272002
Average Amazon.com® Rating: ![]()
![]()
![]()
![]()
Based on 15 Ratings
Absolute essential - 2007-02-28
Reviewer Rating: ![]()
![]()
![]()
![]()
![]()
This book is an absolute essential to the right reader. That right reader is either a low-level coder, a high-level logic designer, or someone who builds tools and libraries for same. In other words, not a lot of people. This is hacking at its bit-level finest, though. If you're among those few, or think you might be, or want a good laugh at the people who are, dig in.
It's good for things like counting the number of 1 bits in a word-length integer (hint: if you count the bits, you're doing it the hard way). It's good for things like fast division by an integer constant, or mod to a constant integer modulus (hint: if you perform division by dividing, you're barking up the wrong tree). If you can look into a 32x32 bit multiplication and see a convolution going on, you're way ahead of the game. The only tricks I know that didn't appear here are A) for purposes that almost no one has or B) for machines that almost no one has.
Warren presents the coolest collection of slimy coding tricks ever collected, with full attention to the number of machine cycles and the compiler-writer's unique needs. I've seen a lot, and this is by far the biggest and coolest collection around. I have two complaints, though, a small one and a really big one. The small one is that the author didn't score a direct bullseye on my somewhat offbeat needs. Well, he never tried to - that's just me griping that he didn't write a different book. The big complaint is that pages, lots of them, just fluttered out of this pricey book and onto the floor. GRRR. This takes nothing away from the content of the book, until some critical page flutters off never to be seen again. Still, if you can keep a rubber band around it, this will be one of the deepest mines of coolness in your uber-geek library.
//wiredweird
Fun, interesting and useful - 2007-01-24
Reviewer Rating: ![]()
![]()
![]()
![]()
![]()
My first introduction to binary operators wizardry was in a 1st year, 1st semester course in Digital Systems at the Technion, IIT. I thought it was fun. While I was trying to write a computer program to compute Karnaugh Maps for me, I run into performance problems, and then some binary hackery helped me get back on the horse.
Since then, whenever I come across some binary trick I write it down with a few examples of usage and sometimes with some reasoning why it works.
Then came "Hacker's Delight" and I felt compelled to buy it.
I wasn't disappointed at all! Not only it contained all of the tricks that I have collected, but also it contains a lot more in depth examples of how these tricks can come in handy when trying to squeeze performance from an implementation or save a few more bytes and bits.
The book also gave me a fresh perspective on the implementation of some well known algorithms with the twist of binary arithmetic. This was very enlightening.
I read the "BASICS" chapter (chapter 2) with a single breath of air, and just couldn't leave it down. Not only it was nice to have all these tricks summarized in one book, but also I liked some of the reasoning and the "so-called" proofs.
Remaining chapters were, as I mentioned before, a fresh look for me on known algorithms. This fresh look was through the glasses of binary arithmetic.
I'd recommend this book to anyone who feels comfortable with binary arithmetic and/or computer organization -- even just for the fun of it!
I'd recommend the book to developers who don't necessarily have a sympathy to this topic, but would like a Copy&Paste solution to some problems they have to tackle.
I really enjoyed reading this book, and I will probably reference it from time to time.
This is a fantastic book! - 2007-03-23
Reviewer Rating: ![]()
![]()
![]()
![]()
![]()
I have a virtual calculator called the DIY Calculator that accompanies my own book "How Computers Do Math" The Definitive Guide to How Computers Do Math : Featuring the Virtual DIY Calculator.
I recently added a "Conundrums, Puzzles, and Posers" section to the "Programs and Subroutines" page on my DIY Calculator website ([...]) and I've started to build a collection of simple puzzles for people to play with.
One of the first problems I posed was to count the number of ones in the 8-bit accumulator and to present the result as a binary value. I thought I had discovered the best-possible solution, until someone pointed me in the direction of the "Hacker's Delight". (In this context, "Hacker" refers to a hero who is manipulating code; not a nefarious rapscallion who breaks into other people's computer systems.)
I immediately ordered a copy from Amazon, and took delivery just yesterday as I pen these words. This book is fantastic - I kid you not - on the first page of Chapter 2, for example, I discovered at least five or six capriciously clever tricks that blew my solutions out of the water!
I highly recommend this book.
Comprehensive! - 2009-02-23
Reviewer Rating: ![]()
![]()
![]()
![]()
![]()
Hacker's Delight really is delightfully comprehensive, not to mention fantastically dense. It's really more of a reference but you can certainly read it from cover to cover... but be prepared to be stalled for hours or days on certain pages if you really want to understand why things work.
Be warned: this book is not an introduction to the subject of bit manipulation. It doesn't explain basic concepts and only falls into prose later in the book; much of it is page after page of mindblowing formulas for every concievable task. Beginners can get through it, but only with serious effort. Although the framework you need to understand bit manipulation is very simple, certain devices come up frequently in code examples, but take awhile to grasp for the uninitiated.
Above all this is a very entertaining -see how many pages you can read without grinning at the magic- and thorough compilation of fascinating little tricks and algorithms. It probably won't be very useful to a Java programmer or "software engineer", but in any case it's good to expand your thinking. If you appreciated HAKMEM, you must get Hacker's Delight!
Bit-banger's delight. More fun than a barrel of monkeys. - 2008-09-12
Reviewer Rating: ![]()
![]()
![]()
![]()
![]()
If you find delight in the optimization of code--and you SHOULD--this is the book for you.
The book contains a great collection of techniques and tricks for highly efficient numerical programming.
Great read.
Top Level Categories:
Software Engineering
Sub-Categories:
Software Engineering > Algorithms
Some information on this page was provided using data from Amazon.com®. View at Amazon >