There’s only one problem with our search project: we’ve got three different blocks that all do the same thing (finding a number in a list). That’s way more complicated than it needs to be...how could we use abstraction to make this clearer and simpler for others who want to find numbers in a list?

Here’s a thought: what if we created a single block "find number x in list y" that made no mention of how it found the number. The user of the block could assume that it would do what it said without worrying about the technicalities of how it gets it done. Then, even if you started with a terribly slow version of the block, you could easily update the algorithm it used without changing anything outside of the block itself. The input and output would remain the same -- only the steps to get from one to the other would change.

This is the beauty of abstraction with algorithms: users are able to assume that a particular block works without having to understand all of the details of the algorithm itself! Did you investigate the sort block included with this lab? You didn’t have to -- you could just assume that it worked!

In fact, each of the blocks in Snap! has an algorithm that tells it how to do what it does. Think how much harder it would be to work with Snap! if you had to understand how each block worked before you could use it!