Collocation in Code
- by Dan McGrath
Quite some time ago I remember reading an article from 'Joel on Software' that mentioned collocation of information in code was important.
By collocation, I mean that relevant information about the code is present when the code is. I'm currently writing an article that has a small bit in it about collocation so I went searching for sources and found the quote in the article 'Making Wrong Code Look Wrong'
In order to make code really, really
robust, when you code-review it, you
need to have coding conventions that
allow collocation. In other words, the
more information about what code is
doing is located right in front of
your eyes, the better a job you’ll do
at finding the mistakes. When you have
code that says
For me, collocation isn't just about the code itself, but the tool used to view the code. If it can help with the 'collocation factor' (term coined by me?) I believe it can help with the programmers productivity. Take for example the modern IDEs that show you the variables type by hovering over it.
Are their any other articles written about collocation in code and/or are their other terms that this is known by?