7

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?

1
  • Ah yes, Joel's infamous defence of Hungarian notation. All that article did for me was illustrate the strength of strong semantic typing over the reliance of obfuscating variable names with secret code letters.
    – smithco
    Feb 21, 2011 at 4:36

1 Answer 1

2

"Object-oriented inspection in the face of delocalisation" describes the problem in some depth, as it relates in particular to object-oriented programming. It doesn't provide solutions so much as calling for further research into the problem:

Rather, further research is required which must address: partitioning code for inspection ("what to read"), reading strategies ("how to read"), and support for understanding what isn't read - "localising the delocalisation".

2
  • Thanks for the answer. It would appear there really isn't that much on what would appear to be such an important factor for productivity/maintainability in programming Feb 24, 2011 at 19:34
  • 1
    Indeed! I suspect one would need to step away from working with code in a bunch of files to "relocalise" things. There has been some work in the Smalltalk community (OmniBrowser, Whisker), but probably nowhere near sufficient work. Feb 24, 2011 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.