Design Philosophy
The principles behind Instacalc's design.
My goal was to build an effortless, forgiving calculation helper. A magical “back of the envelope” that figured out what you meant as you wrote.
A few principles:
- Helpful. Assume that
1/2 cmmeans0.5 cm, not1 / (2cm). Don’t force gnarly syntax gotchas onto the user. A calc shouldn’t “teach” the user to use the right syntax. We need to be more like Google’s “did you mean?” and just do the lookup, not scold people about typos. We aren’t building nuclear reactors, we’re trying to help with quick number crunching. - Do something reasonable, explain assumptions.
15 miles/hr in /minprobably means15 miles/hr -> miles/min. Right? What else would it mean? So, instead of an error, do a reasonable conversion and explain what happened. - The user’s syntax is always right. Let people write how they think, no matter what background they have.
15 x 3and15 times 3and15 * 3should all work: the intent is clear. And it’s not just beginners:123 as hexandhex(123)and123 -> hexshould all work. - Effortless. I love the quote “Make the easy things easy, and the hard things possible”. You should be able to type as you think and speak.
- Snappy. To the extent possible, Instacalc should feel instant, and get out of your way.
- Convenient all-in-one. Traditional wisdom is “one thing well”, but what is the “one thing” your phone does well? It’s always within reach for the 90% of things you want to do. Instacalc is about convenient math: results as you type, variables, units, currencies, graphs, without forcing you to change tools.
- On your side. The goal is to help you think and understand, not lock you in. It’s a tool I use, my friends use, my mom uses, and it’s not build to “extract value”.
Non-goals
When making a calculation tool, you can go down many feature rabbit holes. Here’s what I’m not trying to build:
High precision scientific computing. Instacalc handles reasonable floating-point issues (such as
.1 + .2 == .3), but we aren’t calculating Pi to 1000 digits. Wolfram Alpha is better.Encyclopedia of arcane units. I’ve added most imperial, SI units, currencies, etc., but Frink or GNU Units is more complete.
Perfect parsing. The parser has layers of heuristics, cleaning up input before the final parse. It can be tricked. That’s ok.
Lots of rows. At some point, the calc UX breaks down and you want Excel. After a few hundred rows you probably want a different tool.
On being “Mostly right”
Is the earth a sphere? No. Strictly speaking, it’s an oblate spheroid. So should “earth == sphere” be true?
Let’s be helpful, on the user’s side. In corner cases, explain what happened, and a savvy user can infer the correct thing. And a new user will be mostly right.
On making the easy things easy
We should aim for the “least surprising” interpretation. Examples:
Including
$auto-formats as currency:$22/7 = $3.14(rounded to cents). That’s usually what people want. Allow$$for quick rounding without the symbol. (Earlier,$just did rounding, which was confusing! People wanted the sign.)Including
%auto-formats as percent:50% = 50%. Earlier, it always converted to decimal (50% = .5). Only convert to decimal when the percent is used in a calculation:50% * 3 = 1.5.Fractions like
2/3 cmare(2/3) cmand not the strict2 / (3cm). It’s extremely unlikely someone wanted inverse cm. If they do, they can write it2 / (3 cm)or2/3 cm^-1. However, if you writex = 3cm, then2/xwill have units of inverse cm. Yes, yes, the “substitution” isn’t the same, but it’s what people expect.
Don’t make me think
Don’t make me think is the best usability reference I’ve seen. That simple principle helps shape so many decisions.
- If a user types fractions
1/2 + 1/3, show the result as a decimal and fraction. (They are probably using fraction math!)
- If a user types a hex/bin/oct number (
0xff), show the result in the other formats. (They are probably doing some bit manipulation!)
Yes, there are conversion functions (1/2 + 1/3 as fraction and 0xff as bin)… but don’t make people think! Just show the likely conversions they need.
- If someone writes with tape measure units (
3' 4" + 3'), they are probably not creating the string'4" + 3'. Don’t let string parsing rules interfere with natural unit math. Display the output using the same input tape measure format, but also with decimal (don’t make people think about the conversion!).
On having the right design
As time goes on, changes should get easier. It’s clearer where a new unit, conversion, etc. should go. Special cases are handled automatically. A design that easily flexes to add new features, without adding more abstractions, feels like the right one.