Shortcut for chapter specific information

Saturday, May 14, 2011

Mistakes made by a programmer - some hypotheses of why they are there.

I had a sense of disappointment after today's practice.   It seems like I am still in the process of not able to write perfect code in the first shot.   Of course I have improved but it makes you wonder how you can go beyond that.

After some thought, I believe this is an issue of concentration and how human write and check syntax of a statement.  There are several issues here, one is the precision of my thought.  To put the whole program in one's brain require more structure than I thought.  For example, the seemingly simple insertion sort imply many constraints among the characters within its source code.   So, every time you write an insertion sort,  you don't just type an arbitrary stream of characters.  You are typing characters which are interrelated with others in a certain way.   Simply speaking that's syntax.  But human brain is not a machine of syntax.  That's why mistakes come up from time to time.

On that front, I believe it is an issue of training.  Continuously put myself into the thinking process.  Avoid fuzzy thinking.  Always demand myself having a solid understanding of every tidbit of the algorithm and the environment.   This will help.  

The second issue is the how precise my hand can represented by thought.   That is another layer of potential mistakes.   For example, sometimes I think for(i=0;i<N;i++) but I then typed for(i=0;j<N;i++).   Visually it doesn't look like a big mistake.   It will also likely to skip checking. 

For this I believe it is just an issue of professional typing skill.   This can be improved by touch-typing training and can be improved if I desired to put time on it.

The third issue is checking.  How come my mental checking fails for me?  The reason is that my head doesn't always contain all the required syntax when I was checking my own words.   How can I improve this? Hmm. I don't know.  But I guess it is one type of human limitation which require special means to resolve.

Nevertheless, I am happy though that my self-study has expanded my horizon in algorithms.  This is certainly something I can learn.  It is also something that if I spent my time on it, I would improve.   The most important of all, this is something if I spent my time on it, the payoff is handsome.  That's why I am happy to put more time on it in future.

33_P

No comments:

Post a Comment