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:
Strings are a Domain-Specific Language
Code: assembly, C, Perl, Python, Ruby
Comments Off on Strings are a Domain-Specific Language
Question: Isn’t a domain-specific language just the same thing as a library?
Source: Pretty much everyone the first time they hear of DSLs.
Answer: No, a DSL is much more than a library, and I have an example that won’t make you say, “Well, sure, if you’re doing something that esoteric…”