push.cx
Peter Bhat Harkins
The Two Kinds of Integers
Code: abstractions, assembly, Haskell, Ruby, values
Comments Off on The Two Kinds of Integers
A small thing I see tripping up developers is that there are two kinds of integers: numbers and identifiers.
We don’t know what the integer 4 means unless we know what it’s for. Are we counting things, or identifying them? It’s really easy to slip between the two, like this real code snippet I found: