Abstraction - Nand2Tetris

Abstraction - Nand2Tetris

The reason why we never think about our little friend binary.

Some of the quotes and information are part of the Nand2Tetris course available on Coursera.

We are usually worried about the what of everything we come across. What should I use to get an output? The print function. What should I use to get user input? The input function, etc.

But very few times, or at least never, we do not ask the question, How?

The "what" is abstraction and the "how" is implementation.

Don't worry about the rest; just worry about what it's supposed to do and trust that someone else worried about the how.

Separating concerns is the most potent tool in computer science. We forget the implementation once it's done and only care about what it does.

This really gives us a perspective about various problem-solving techniques that we use like divide and conquer, dynamic programming, etc. where we implement a solution for a small problem and then forget what it does and only zoom out and focus on the bigger picture that we get.

I would say, it is a boon that we are able to do that and all of this is possible only because we have efficient interfaces that we can talk with.

This also highlights the importance of good naming conventions and writing function and variable names that do and store what they exactly sound like. Now, we definitely don't have to worry about how something is implemented and trust the interface to actually depict what is happening under the hood.

I also recently discovered that Apple uses seriously long names for some of its iOS APIs. (I was unable to find the most recent API but here is an example. Link). Now, maybe I can justify long names and actually write them out instead of trying to make them very short or have very weird names like "abc, "xyz" or the holy word "temp", which I suppose will definitely fail to represent what the function does.