3 ms·
This is great advice, but needs a caveat. I'd say it this way: The less battle-tested a part of the stack is, the more likely it is to contain a bug. Suppose
by nathan_long 9y ago
This is great advice, but needs a caveat. I'd say it this way:
The less battle-tested a part of the stack is, the more likely it is to contain a bug.
Suppose I'm using a database library written in Elixir to run a PostgreSQL query and I get a weird result. Where is the problem?
PostgreSQL has executed billions of queries in thousands of projects for tens of years and has many contributors.
The Elixir library is much newer and has many fewer contributors and has been used much less.
My brand-new query has been executed a handful of times by me and has only been looked at by me.
The chances are overwhelmingly high that the bug is in my code. If I can't find it there, the next candidate is the Elixir library. Only after exhaustive search in those two should I consider that PostgreSQL may have a bug.
Or to include more of the stack:
my code > Elixir lib > Elixir > Erlang > PostgreSQL
The author's own anecdote with finding a bug in JavaScript's `sort()` illustrates this principle: it was not in (say) the Firefox or Chrome JS interpreter, but in a much less-used one: https://github.com/code-dot-org/JS-Interpreter/pull/23 https://github.com/code-dot-org/JS-Interpreter/pull/23
- dnautics 9y agoI definitely found a compiler error in an early version of Julia, luckily the solution was to upgrade to the newer release that I'd been too lazy to bump to.
- nathan_long 9y agoGood example. "An early version of Julia" is a less-tested piece of your stack than, say, "a recent version of Java". Especially if the feature in question is something absolutely everyone uses in Java.
- dnautics 9y agoAnd the feature with the bug is a little-used part of julia
- iainmerrick 9y agoThis is a great way to put it, and very practical. Gives you a ranking of possible suspects, rather than completely ruling out any of them. You're allowed to suspect the compiler but only if other leads have been exhausted.