Thinking Out Loud About Your Code
One thing I do more often is talking to myself. Thinking out loud. But not only with my voice, but also with my code. I use the comments to say to myself how the code should behave. And it’s very useful keeping in mind that I usually develop one piece of code (open source in github for example) and the next time I have time to modify or improve it, it’s several months later.
At beginning I remember I read the code. The whole code to try to figure out what I tried to do the first time I wrote that. My memory is not good enough to remember more than two or three projects at the same time. And worse if that project was untouched by me in the previous months.
That is a tedious mission. I read it, yes I did it, I know, but I’m improving in a constant pace my skills of programming and sometimes I try to use something new. Maybe I will never use that new thing anymore and I forgot to put the reference where I read it first time from Internet. Bad deal.
Something I learnt from Rubber Ducking sessions is you need to think and you need to think out loud. Put your thoughts together to talk about them and realise where is the fail, the problem and even what could be the solution.
For example. Your code is not compiling. You’re modifying it again and again. Trying to figure out where is the problem. But if you stop and realise you’re not thinking about the problem, if you talk and try to understand the problem and how is working your system talking about it, you finally realise (with a more wide perspective) where the fail could be.
This is a technique I use a lot and is very useful. I had to share it.