Published on 3 July 2013.
Today’s thought is about visualizing hierarchy and groupings in code.
One place that does this fairly good is documentation for Haskell libraries. Have a look at the documentation for the Map
data structure for example.
A map is like a dictionary or a hash table in other languages. All functions described in the documentation has to do with maps, so they obviously belong there. But in addition to that, the functions have been grouped under headers depending on their function. For example, there is one header called “Insertion” where all functions related to inserting elements in a map are grouped together.
This additional grouping information helps when trying to understand how to use a map.
I think it is worthwhile to think about how information of this kind can be incorporated into our code bases to make them easier to understand.
–
What is Rickard working on and thinking about right now?
Every month I write a newsletter about just that. You will get updates about my current projects and thoughts about programming, and also get a chance to hit reply and interact with me. Subscribe to it below.