ifacethoughts

Transparency And Abstraction

Bill Higgins brings up the tension between transparency and abstraction. Abstraction has been beneficial for software development, in fact it is at the heart of the design principles.

In the layman’s language, the abstraction specifies what has to be done, without specifying how it has to be done. The categorical dual of abstraction is encapsulation, which leads to hiding of the how. For the programmers, when I want to use a third party library I worry about what a library does rather than how it does something. At an atomic level, knowing only the signature of the function is enough for me to use it, not the entire function body. Abstraction helps in knowing what is necessary and speeding development.

However, there are times when how is also important. This can be best explained using an example. I was discussing with a friend why binary searches can break for certain values. The binary search can break depending on how it is written, leading to a break in my code. Knowledge of how it works would help me when I sit to debug. Similarly if I use a link-list traversal function it might help me to know whether it is iterative or recursive. Though the output might be the same, there can be side-effects that have an impact on the entire application. Transparency will let you have this knowledge.

Most of times transparency is required to debug if there are problems. Which is what Grady Booch calls failing of an abstraction in an unexpected way. Failures in an expected way can take the route of the principle of least astonishment, but solving the unexpected ones require transparency.

Note that transparency does not mean making everything open. Bill defines:

Transparency is the quality of how easy (or hard) it is to understand how a mechanism works.

Better transparency can lead to faster debugging and resolution of a problem.

All development should be as transparent as possible, that is, the mechanism should be easy to understand. However, I wonder if everyone needs to worry about it. The real world benefit of abstraction is responsibility. A single entity is responsible for an action, if it does not happen it has to take the responsibility of making it work. According to Joel all abstractions are leaky. When this happens transparency helps. Both are required, because I believe people who need to know about abstraction and transparency are different. Abstraction is for users, transparency is for problem solvers.

Discussion [Participate or Link]

  1. Bill Higgins / others on transparency and abstraction said:

    [...] And not only does it cost, but it usually costs *more* than we think it does – because the person designing the abstraction is not the same person who has to invest the effort to learn how the abstraction works later on. (more) Abhijit: [...]

  2. Why Java Is A Different Beast | iface thoughts said:

    [...] has always been a tussle in transparency and abstraction. We need the right balance of these two to be able to identify and solve problems. Most of the [...]

  3. DSL Or API? | iface thoughts said:

    [...] for multiple reasons – convenience and reusability being two of them. Also, the balance of transparency and abstraction can be different, rather dependent upon purpose of the API. An API can be reusable across more [...]

  4. Moving to Arch Linux | iface thoughts said:

    [...] I started feeling a while back that I need to know more in Linux to do more with it. I know, I know, this sounds geeky and not very user-friendly, but believe me this stage is not avoidable. As you start getting better at a tool, you start looking for a different balance of abstraction and transparency. [...]

Say your thought!

If you want to use HTML you can use these tags: <a>, <em>, <strong>, <abbr>, <code>, <blockquote>. Closing the tags will be appreciated as this site uses valid XHTML.

freshthoughts

contactme

Abhijit Nadgouda
iface Consulting
India
+91 9819820312
My bookmarks

badgesand...

This is the weblog of Abhijit Nadgouda where he writes down his thoughts on software development and related topics. You are invited to subscribe to the feed to stay updated or check out more subscription options. Or you can choose to browse by one of the topics.