DEV Community

Serguey Asael Shinder
Serguey Asael Shinder

Posted on

You Compared the Two Files by Switching Windows and Missed the Change

Staging worked.

Production did not.

Same service,
same version,
two config files
that were supposed to be the same.

You opened both,
one in each window,
and went through them line by line.

Look at this one.

Switch.

Look at that one.

Switch.

Ninety lines.

You found nothing,
and said so in the channel.

An hour later
a colleague pasted both into a diff.

Line forty one.

The connection pool,
twenty in staging,
two in production.

You had looked at that line twice.

Here is the mechanism.

It has a name,
change blindness.

You feel as if you see
the whole screen.

You do not.

You hold a few things at a time
in visual memory,
and the rest is a rough impression
your brain fills in.

Researchers showed it
with two versions of the same photo,
one with something large changed,
flashed one after the other
with a blank screen between them.

People took many cycles
to spot changes
that were obvious
the moment they were pointed out.

Take the blank screen away,
so the two images swap directly,
and the change jumps out,
because your eyes
are drawn to motion.

Switching windows
is the blank screen.

The moment of the switch
wipes out the signal
that would have pulled your eye
straight to the change.

So you are comparing
what you remember
against what you see,
and you remember
what you expected.

Twenty and two
are both short numbers
in the right place.

So stop comparing by memory.

Use a diff.

It has no expectations
and it never blinks.

If the files are not in the same form,
normalise them first,
sort the keys,
strip the comments,
then diff.

If you have to look by eye,
put them side by side
and read one line across,
both values,
before moving on.

And when you report
that two things are the same,
say how you checked.

Your eyes are good at noticing
what moves.

They are bad at noticing
what changed
while they were looking away.

– Serguey Asael Shinder

Top comments (0)