A Coder's Handwriting
This is a phrase coined by i-don't-know-who. But this is a phrase used my a colleague of mine at office. When ever there is any issue in the code on the TFS, instead of doing a history check and the past check-ins, this guys identifies the author of that code based on its "handwriting". Interestingly enough more often than not, he is correct. And surprisingly enough, when you think about it for a minute, there seems to be some sense in his method.
Any coder, no mater how much he has coded, or whom he codes with, has a basic style of coding. It may change over time. That is because a lot of factors effect how one writes code. The kind of software one uses to write code. The sort of framework/technology/language someone is working with or how much they know about it, the kind of practices one uses while coding, which involve, comments, regions, proper grouping of a particular kind of data variables and methods and the names used for those. Its a sum total of everything. And that is what i think my colleague means.
Now every one has their own hand in coding and it keeps changing from time to time, more in the early days of work. But, as you go on, it stabilizes. Or so i guess. You can teach a coder how to use comments, and how to put everything in regions and how to make sure that he uses the same naming conventions everywhere. But there are so many things out there, (hell...even the kinds and number of commenting styles can overwhelm you at times) that it is only human for a coder to pick up a subset of all those standards and notations. Mind you, not all those standards are the best for any and every kind of scenario. But, those such as using comments to write the steps in your code, or place the methods in the probable sequence in which they will be called, or using access modifiers whether required or not, really help in the process of coding well.
Many will beg to differ with me at this point, and i do not blame them. For i, myself believe that logic is the most important thing for a coder and everything else comes later. But, having such habits is not a bad thing really. Having comments is good for your own logic building. You really do not have to keep looking at the code and deciphering it, in order to understand what you have done. If you were to write the steps of your logic in comments, then the next time you open your code, you can just pick up from where you left, without dwelling into the code too much. This way you are not wasting time in revising on old stuff but actually moving on to new logic or logic enhancements. And it also makes it easier for someone who has to give you ideas/suggestions/reviews for your code. He can then actually understand what you have written. What is the point of writing good logic with poorly understandable code? Its like writing a new idea on paper with a doctor's handwriting. No one will understand your idea. Not because it was a complex idea, but because your handwriting sucked and your words were difficult to read.
Writing neat code also conveys a clarity of thought. I think the reverse psychology also works here. What i mean is that a good coder with a clear mind will in all probability write clean code with proper naming conventions. Similarly, if you were to force yourself to use clear naming conventions you actually begin to have a clear understanding your own code. And that is the first step to good coding with sound logic development.
Still not convinced? Look at it this way: You write code for your understanding, not the computer's. The computer will always convert your code to its own language which happens to be the binary, something you cannot not understand anyway. So whom are you writing that code for in a high level language, if not for yourself and your understanding?