Student or educator? Sign up with your school email and get 6 months of Pro free.
CoChat
Cited by 245

The DOI matches its Crossref record.

Hacker's delight

· 2013 · Choice Reviews Online

Abstract

From the Book: Caveat Emptor: The cost of software maintenance increases with the square of the programmer's creativity. First Law of Programmer Creativity, Robert D. Bliss, 1992 This is a collection of programming tricks which the author has comeacross over many years. Most of them will work only on computers that representintegers in two's-complement form. Although a 32-bit machine is assumedwhen the register length is relevant, most of the tricks are easily adapted tomachines with other register sizes. This book does not deal with tricks such as sophisticated sorting andcompiler optimization techniques. Rather, it deals with small tricks that usuallyinvolve individual computer words or instructions, such as counting thenumber of 1-bits in a word. Such tricks often use a mixture of arithmetic and logicalinstructions. It is assumed throughout that integer overflow interrupts have been maskedoff, so they cannot occur. C, Fortran, and even Java programs run in thisenvironment, but Pascal and ADA users beware! The presentation is informal. Proofs are given only when the algorithm is definitelynot obvious, and sometimes not even then. The methods use computer-arithmetic, floor functions, mixtures of arithmetic and logical operations, etc.Proofs in this domain are often difficult and awkward to express.To reduce typographical errors and oversights, many of the algorithms havebeen executed. That is why they are given in a real programming language eventhough it, like every computer language, has some ugly features. For the highlevel language C is used, because it is widely known, it allows the straightforwardmixture of integer and bit-stringoperations, and C compilers are availablethat produce high quality object code. Occasionally machine language is used. It employs a 3-address format, mainlyfor ease of readability. The assembly language used is that of a fictitiousmachine that is representative of today's RISC computers. Branch-free code is favored. This is because on many computers branchesslow down instruction fetching and inhibit executing instructions in parallel.Another problem with branches is that they may inhibit compiler optimizationssuch as instruction scheduling, commoning, and register allocation. That is, thecompiler may be more effective at these optimizations with a program that consistsof a few large basic blocks, rather than many ones. The code sequences also tend to favor immediate values, comparisons tozero (rather than to some other number), and instruction-level parallelism.Although much of the code would become more concise by using table lookups(from memory), this is not often mentioned. This is because loads are becomingmore expensive relative to arithmetic instructions, and the table lookup methodsare often not very interesting (although they are often practical). But there areexceptional cases. Finally, I should mention that the term in the title is meant in the originalsense of an aficionado of computers—someone who enjoys making computersdo new things, or do old things in a new and clever way. The hacker isusually quite good at his craft, but may very well not be a professional computerprogrammer or designer. The hacker's work may be useful or may be just agame. As an example of the latter, more than one determined hacker has writtena program which, when executed, writes out an exact copy of itself. 1 This is thesense in which we use hacker. If you're looking for tips on how to break intoother's computers, you won't find them here. H. S. Warren, Jr. February 2002

Overview

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.5860/choice.50-5043

Cites

Statistics

Verification

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Citations

Cited by

See all 245

Metadata

Venue
Choice Reviews Online
Published
2013-04-17
Volume
50
Issue
09
Pages
50-5043-50-5043
ISSN
  • 0009-4978 (ISSN-L)
  • 1523-8253
OpenAlex
W1530458829
Cited by
245
References
0
Type
book review
Language
en
Open access
closed

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

How to cite

Cite CoChat for the checks on this page, and the paper for its own findings.

This page
CoChat. (2026). Citation check: Hacker's delight. https://app.cochat.ai/papers/10.5860/choice.50-5043
The paper
Hacker's delight. (2013). Choice Reviews Online. https://doi.org/10.5860/choice.50-5043

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.