This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Noise
Feed Title: Michael Lucas-Smith
Feed URL: http://www.michaellucassmith.com/site.atom
Feed Description: Smalltalk and my misinterpretations of life
I've been trying to monitor a phenomena that I've been seeing in my code.. I call it "Noise".
What is this noise thing all about. Well, to put it simply, ever time you add a new method, you add noise. The longer the method, the more noise in that method. The more methods, the more noise, the more classes, the more noise, the more packages the more noise.
What is being done to combat this? Well, there is the whole concept of a class - encapsulation. Put the behaviour where it belongs. This allows developers to organise their code well, but it creates more noise by moving unrelated behaviour to the place that can provide the answer.
I fully agree that the code should be where it can run, but I don't agree that unrelated behaviour should be closely 'related' via viewership. When you look at a class, you see a hodgepodge of concepts muddled together.
What is being done to combat this? Well, Smalltalk has the concept of Extensions. This allows you to define methods on a class but have them live in different packages. This means you can put the behaviour on the class it belongs on, but hide it from unrelated concepts.
Unfortunately this means you need many many packages to properly segregate all the different kinds of behaviour. This simply isn't possible sometimes - also, instance variables must all live on the core. As you add more and more instance variables to support the concepts the class itself becomes noise.
So what can be done about this? - to tell the truth I believe this may be the reason there are so many anti-OO people out there. The supposed reduction of complexity actually increases noise.
Let's look at it from a different angle - Smalltalk is the only language I know that has gone to the trouble of trying to reduce the noise. And it shows.. teams can work on larger amounts of code for longer periods of time before the "Noise limit" is hit. Yet, I'm still finding myself uncomfortable as code becomes more "lived in".. cluttered.
I requested a new definition of 'categories' in VisualWorks, such that it is a cosmetic human organisation technique only. But the engineers were unreceptive to the concept. Perhaps I wasn't able to articulate what the true problem was well enough. Let alone the fact that other environments are still far behind VisualWorks in this regard any way.