Friday, October 28, 2011

It's Alive

I and my friend are both in the process of building our houses (I actually already moved in, but the process never ends ;)).
Needless to say, that we invested a lot of energy (and money) to oversee the construction.

Somehow, during one of our talks, we touched a very interesting observation. We both hired an architect (a real one, not a software architect :)) and we both benefited from the great ideas these architects brought to the table.

You see, the house I am building is just a simple 5 rooms apartment, which will stay for me the same 5 rooms apartment regardless where the kitchen will be located. However, just from a quick glance at the sketches, my architect is able to spot things, that usually would take me a long time to identify and to appreciate as a better utilization of the space and the structure.

The interesting thing is that the same process happens to me while working with code.
Somehow the code becomes alive when I am looking at it.

These aren't just simple assignments or method calls. These aren't just simple lines of code.
When I read and write software (*) I see relations and responsibilities...
I see "real" interactions between objects trying to talk together in order to accomplish a task.
It is quite amazing, as sometimes I am able to "visualize" the code in front of me: It forms a story.


Usually I can follow the story by spotting who said what to whom; As all great stories I can spot the places where somebody said too much or tipped something to somebody he shouldn't. Following the plot, I can identify the core characters (the must components); Without them there is no point in the story at all. Watching the interactions enables me to visualize different abstraction levels; Those in turn will reveal the required actions on the core (or other) characters.

Definitely, I can continue on and on with the analogy.
Yet, I am not the first one to point about the relation between writing in general and writing (constructing) software.

If you really want to become a great programmer you should read (and write) code as a story; Visualize and watch the plot!

(*) The reading is intentionally before the writing

No comments:

Post a Comment