When programming, I frequently find myself kind of guessing at what code will work, pumping some input through the function I write and checking to see if the output is consistent with my expectations.
I do not always bother to figure out whether a loop should start at zero or one before I just try it.
Yes, this can cause problems, but that process seems to run counter to what is said here.
As you say, there are differences between individual human programmers in just how detailed their models about code behavior are (and indeed, for the same human based on mental state; lack of concentration can lead to sloppiness in that activity as anywhere else).
Even so, I maintain that if your software works at all, you have had a much-better-than-nothing model in your mind (and conversely, if you ever have implementation bugs, that model is not perfect). You might not precisely model the right way to start a loop, but you probably had a good reason to put a loop there—as opposed to a triple pointer dereference or something—and to make it dependent on certain specific data (even if the precise dependence isn’t clear in your mind without experimentation), as opposed to just trying out random variables you have lying around as targets for (approximate) loop iteration count.
This is in contrast to an unintelligent process like e.g. natural evolution, which would try entirely random things and simply look at how well they perform. You couldn’t reasonably program anything in that manner with human typing speeds; the number of attempts would make it infeasible.
When programming, I frequently find myself kind of guessing at what code will work, pumping some input through the function I write and checking to see if the output is consistent with my expectations.
I do not always bother to figure out whether a loop should start at zero or one before I just try it.
Yes, this can cause problems, but that process seems to run counter to what is said here.
As you say, there are differences between individual human programmers in just how detailed their models about code behavior are (and indeed, for the same human based on mental state; lack of concentration can lead to sloppiness in that activity as anywhere else).
Even so, I maintain that if your software works at all, you have had a much-better-than-nothing model in your mind (and conversely, if you ever have implementation bugs, that model is not perfect). You might not precisely model the right way to start a loop, but you probably had a good reason to put a loop there—as opposed to a triple pointer dereference or something—and to make it dependent on certain specific data (even if the precise dependence isn’t clear in your mind without experimentation), as opposed to just trying out random variables you have lying around as targets for (approximate) loop iteration count.
This is in contrast to an unintelligent process like e.g. natural evolution, which would try entirely random things and simply look at how well they perform. You couldn’t reasonably program anything in that manner with human typing speeds; the number of attempts would make it infeasible.