Programming is an art, even though this discipline falls under sciences and in some places engineering there are many attributes of art that is needed in programming in order to be successful, and this are:
These are not all what it takes to be a programmer but part of a bigger list, some others are, critical thinking, problem solving, programming languages skills, analysis and algorithms. A lot coders when given a specification to write a software according to that specification, they directly jump into coding as if it is their personal projects, which still if it is its not an excuse. The good practice of programming is to actually know what you want to achieve at the end of the project, then try to design or sketch your problem or specification in a structural manner, identifying each object or components functionality, its properties, behaviors and relationship with other components and also with its environment. Establishing this grounds will move you a step further to solving your problem and also whatever you do afterwards will not be blind coding. Now after establishing the structure next you need to start coding, but also you need to use a particular development model according to what you are planing to develop, this helps to make a standard which makes the probability of your project failing less. During development process (Coding) it is important to take note of some very important features:
Commenting - This is a very big issue amongst developers, sometimes because of laziness but it is very important in times when you need help from someone in your development or after a long period you decide to go back to an old project i.e i have friends that after 6 months whatever code they have written becomes very difficult for them to read or modify.
Use of Patterns - A pattern is an idea that has been developed to help solve a particular reoccurring problems in programming, for instance if you have a collection and you by means want to manipulate its contents, instead of writing complicated and cumbersome for loops and going form index to index, you can instead use an Iterator pattern that makes it very easy and efficient to iterate through a collection.
Refactoring - A lot of developers write spagetti code, and unstructured some times making it impossible to know what method goes where, what variable belongs to what or the relationship between two components or objects. Refactoring is just a process of changing the internal structure of a code and still the code behaves the same way, if one makes a habit to refactoring, then you will find it very easy to modify, change, read, debug a particular segment or body of code. Indentation is another very useful aspect of refactoring because it makes your code readable.
Testing - this is a very important phenomenon that helps in developing less buggy codes or softwares. Testing should be done in units, components, and system at large and some times good to also invite people to test your work. Test-Driven development is a very efficient way of developing softwares, because at every stage completed you need to test and see if the code segment actually does what it suppose to, in this manner, we reduce the stress of complex debugging, and also develop the right product.
When one takes all this points together and makes it a habit, you will realize that you have become more effective, productive and also make maintenance an easy process. I myself have improved my coding skills over the years and have become a better programmer, i can feel it and i have also come to realize that programming its not about just writing a sleek of code that works, but also beautifying the code b well indentation, refactoring and commenting e.t.c
When you take all this into a consideration, you will share your experience with me. Happy hacking and keep coding!