The Quality in the Code
The bugs are always in the code. The programmers till now have been creative types, but most of them did not have any grounding in mathematics or logic. Some of the freshers I see today dont even know much about flowcharts, binary, hexadecimal, etc.
Anyway, I am making a much more finer point. The way we write a loop.
for(i=0;i<10;i++)
This manner of writing the loop is popular because this is the way it is taught. I have always found it irritating because this is a half-open interval. I would prefer to write it as a closed interval, like this:
for(i=0;i<=9;i++)
Big deal, you say? What difference does it make, you ask? They both work the same way, you exclaim! That just goes to show how difficult it would be to reach quality in the code. At the level of pseudocode, such things should be standardized ( or recommended)..
when writing a counting loop, always use closed intervals.
This should apply whether you are writing in java, c, python, ruby, whatever.
Instead we have people talking endlessly about how to name variables and do indentation. These things do not affect quality, and dont need to be done manually.


