msgbartop
Code that explodes conventions
msgbarbottom

19 Sep 11 The Coding Thought Process

There are many coders out there, but not all of them understand the thought process that leads to optimal code quality.   I will endeavor to elucidate the thought process that leads to optimal code quality in the paragraphs below.   This thought process is not unique to me, but I believe it to be the most natural way to write the best code possible consistently.

Every code project has dependencies, which create a critical path.  That critical path allows the developer to draw a road map in his mind, as certain steps must be done in a certain order.  This path helps guide the development process.  This guidance allows the developer to code with an eye towards the future.

What is the benefit of having an eye towards the future?   Coding within a bubble is often effective, but incompatibilities may emerge, as that code has to interact with other code.  A failure to anticipate those interactions can lead to painful redesigns, which also lead to bugs.  Bugs not only take up valuable time but they generally lead to a reduction in quality.  For every bug that you discover and fix, there are several other ones hiding in the code.   Clearly, shortsightedness has costs, yet those costs need not be borne.

The foresight provided by understanding what the code needs work with and what the entire code needs to do provides a vision of what compatibility issues may arise.   As a result, the coder can write with an eye towards resolving future issues.    This foresight leads to fewer bugs, which also leads to fewer hidden bugs.   The result is optimal code quality.

Playing devil’s advocate for a moment, I would like to state that incompatibilities are not always guaranteed; instead, they can be potential incompatibilities.  A given piece of code may have several potential incompatibilities.    The solution to those potential problems can sometimes be mutually exclusive as well.  Having a roadmap laid out does not resolve the mutual exclusivity of the solutions.  Still, the foresight to understand that such problems may occur is better than being blindsided.  The developer can make notes about the problems.   Deeper redesigns to avoid the problem could also be jotted down as well.  A developer who lacks any foresight will have none of that information.   Ultimately, a developer with foresight may end up in a bad situation but the developer without foresight will be in a worse one.

Clearly, the foresight that a roadmap provides not only allows basic errors to be resolved but the impact of disasters to be mitigated as well.    The product that emerges will be optimized as a result.   Just as important, the headaches felt by the developer will be greatly reduced.  That is an ancillary benefit, which is quite valuable as well.

As you read these words, I would hope that they lead to reflection on your own thought process.    I hope that reflection will lead you to become more aware of your own flaws as well.   I have certainly benefitted from examining my own methodology.   My hope is that you receive the same benefit from reading what I have written.

Loading...
Join thousands and get updates for free...No-Spam Guarantee