Skip to content

Instantly share code, notes, and snippets.

@kskuhlman
Created January 24, 2019 00:14
Show Gist options
  • Save kskuhlman/defbb87da7c3363b8dc964fa8cf095f3 to your computer and use it in GitHub Desktop.
Save kskuhlman/defbb87da7c3363b8dc964fa8cf095f3 to your computer and use it in GitHub Desktop.
A tale of cats and dogs and friends
Ma and Pa Kuhlman keep a list of animals that live on their farm.
They don't have good memories anymore, so if it's not on the list then it's probably been forgotten.
Often busy, they don't get a chance to communicate right away, so each keeps a seperate list.
They start with Dog, since loyal Fluffy is always at their feet.
At the end of the first day, Ma's list has Dog & Cat. Pa's list has Dog. After staring at eachother for a while,
they can't decide whether Ma discovered that they own a cat, or if Pa discovered that their cat had passed away. Neither one
kept a copy of the original list. And that idea didn't occur to them at first.
So Pa just replaced Ma's list with his. So they were in sync again, with just "Dog".
This happened several times before Ma got upset and told Pa that they needed to talk. She insisted on making a copy of the
list before they left for the day. Then, when they got together again, they saw they didn't have a cat at the beginning of the day,
so Ma's list that included it must mean that they do have one -- Dad's list couldn't be telling them that the cat passed away since they
didn't used to own one!
They called their son, a software developer, and told him of their exciting discovery. He said they'd invented a simple form of
what's called a "3 way diff and patch" & he'd learned about it in college. They wondered why they spent so much on tuition for things
he could have learned at home.
The next evening, both Ma & Pa's lists said "Dog, Cat, Cat". Had they seen the same cat? They couldn't decide if the master list should
be updated to say "Dog, Cat, Cat" or "Dog, Cat, Cat, Cat". They finally determined that the list should only include each animal once.
If the list allowed duplicates then they'd never be able to reconcile it. So they agreed that they'd never try to syncronize any list
that allowed dups.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment